JPH04129429A - Dictionary retrieval system for data compressor - Google Patents

Dictionary retrieval system for data compressor

Info

Publication number
JPH04129429A
JPH04129429A JP2251499A JP25149990A JPH04129429A JP H04129429 A JPH04129429 A JP H04129429A JP 2251499 A JP2251499 A JP 2251499A JP 25149990 A JP25149990 A JP 25149990A JP H04129429 A JPH04129429 A JP H04129429A
Authority
JP
Japan
Prior art keywords
dictionary
address
memory
character
character string
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2251499A
Other languages
Japanese (ja)
Other versions
JP3038234B2 (en
Inventor
Yoshiyuki Okada
佳之 岡田
Hirotaka Chiba
広隆 千葉
Shigeru Yoshida
茂 吉田
Yasuhiko Nakano
泰彦 中野
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2251499A priority Critical patent/JP3038234B2/en
Publication of JPH04129429A publication Critical patent/JPH04129429A/en
Application granted granted Critical
Publication of JP3038234B2 publication Critical patent/JP3038234B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Document Processing Apparatus (AREA)

Abstract

PURPOSE:To attain quick dictionary retrieval by forming a link list utilizing the external hash method with a consecutive address in the dictionary retrieval of LZW coding. CONSTITUTION:The system is provided with a dictionary memory 20 in which a link address of an external has address based on input data consists of consecutive address of a next memory 200 partially and with a dictionary retrieval means 16 generating continuously an address of the next memory 200 based on the input data and retrieving an object data of an expansion memory 300 coincident with the input data. That is, the index address of the dictionary memory 20 having a list structure based on the external hash method in the dictionary retrieval of the LZW coding is formed by a consecutive address. Thus, since a succeeding address is predicted when one hash address is decided, the retrieval address of an object character is more quickened and the coding by high speed read for the dictionary memory 20 is attained and the coding processing time is reduced.

Description

【発明の詳細な説明】[Detailed description of the invention] 【概要】【overview】

ユバ−サル符号化の一種である増分分解型の改良として
のLZW符号化によるデータ圧縮装置の辞書検索方式に
関し、 外部ハツシュ法のリスト構造を利用した辞書メモリの高
速読出を可能にして辞書検索時間を短縮することを目的
とし、 辞書メモリをファーストメモリ(索引メモリ)、ネクス
トメモリ(連結メモリ)及び候補文字を格納した拡張メ
モリでなる外部ハツシュ法に従ったリスト構造とし、ネ
クスメモリの索引アドレスを連続アドレスに構成し、入
力文字に基づく最初の検索に続いて連続アドレスによる
検索を行って高速化するように構成する。
Regarding a dictionary search method for a data compression device using LZW encoding as an improvement of the incremental decomposition type, which is a type of universal encoding, the dictionary search time is reduced by enabling high-speed reading of the dictionary memory using the list structure of the external hash method. With the aim of reducing The system is configured to use consecutive addresses, and after the initial search based on input characters, a search using consecutive addresses is performed to speed up the search.

【産業上の利用分野】[Industrial application field]

本発明は、ユバ−サル符号化の一種である増分分解型の
改良としてのLZW符号化によるデータ圧縮装置の辞書
検索方式に関する。 近年、文字コード、ベクトル情報、画像など様々な種類
のデータがコンピュータで扱われるようになっており、
扱われるデータ量も急速に増加してきている。大量のデ
ータを扱うときは、データの中の冗長な部分を省いてデ
ータ量を圧縮することで、記憶容量を減らしたり、速く
伝送したりできるようになる。 このような様々なデータを1つの方式でデータ圧縮でき
る方法としてユニバーサル符号化が提案されている。 ここで、本発明の分野は、文字コードの圧縮に限らず、
様々なデータに適用できるが、以下では、情報理論で用
いられている呼称を踏襲し、データの1ワ一ド単位を文
字と呼び、データが複数ワードッなかったものを文字列
と呼ぶことにする。 ユニバーサル符号の代表的な方法として、ジブーレンペ
ル(ziv−Lempel)符号がある(詳しくは、例
えば、宗像1” ziv−Lempelのデータ圧縮法
」、情報処理、Vol、26. No、 1.19f1
5年を参照のこと)。 ジフーレンペル符号では、 ■ユニバーサル型 ■増分分解型(Incremental parsin
g )の2っのアルゴリズムが提案されている。 更に、ユニバーサル型アルゴリズムの改良として、LZ
SS符号がある(T、 C,Be1l、  ”BeNe
r OPM/L Text Compression 
 、 IEEE Trans、 on Commun、
 、 VOl、 C0M−34,NO,12,I!EC
,1986参照)。 また、増分分解型アルゴリズムの改良としては、L Z
W (Lempel−2iv−Welch)符号がある
(T、 A、 WeIch、 ”A Techniqu
e tarHigh−Performance Dat
aComptession  、 Computer、
 June 1984参照)。 これらの符号の内、高速処理ができることと、アルゴリ
ズムの簡単さからLZW符号が記憶装置のファイル圧縮
などで使われるようになっている。
The present invention relates to a dictionary search method for a data compression device using LZW encoding as an improvement on the incremental decomposition type, which is a type of universal encoding. In recent years, computers have come to handle various types of data such as character codes, vector information, and images.
The amount of data handled is also rapidly increasing. When handling large amounts of data, by compressing the amount of data by eliminating redundant parts, you can reduce storage capacity and speed up transmission. Universal encoding has been proposed as a method that can compress such various data using one method. Here, the field of the present invention is not limited to character code compression.
Although it can be applied to a variety of data, in the following we will follow the nomenclature used in information theory, and refer to a single word unit of data as a character, and data that does not contain multiple words as a character string. . A typical universal code is the Ziv-Lempel code (for details, see Munakata 1 "Ziv-Lempel Data Compression Method", Information Processing, Vol. 26. No. 1.19f1)
(See Year 5). In Zifflempel codes, ■ Universal type ■ Incremental parsin type
Two algorithms have been proposed (g). Furthermore, as an improvement of the universal algorithm, LZ
There are SS codes (T, C, Be1l, “BeNe
r OPM/L Text Compression
, IEEE Trans.
, VOl, C0M-34, NO, 12, I! EC
, 1986). Moreover, as an improvement of the incremental decomposition type algorithm, L Z
There is a W (Lempel-2iv-Welch) code (T, A, WeIch, ``A Technique
e tarHigh-Performance Dat
aComputation, Computer,
(See June 1984). Among these codes, the LZW code has come to be used for file compression in storage devices because of its high-speed processing capability and simple algorithm.

【従来の技術】[Conventional technology]

従来のLZW符号による符号化処理フローを第7図に示
し、復号化処理フローを第8図に示す。 まずLZW符号化処理は、書き替え可能な辞書を持ち、
入力文字列の中を相異なる文字列(部分列)に分け、こ
の文字列を出現した順に参照番号を付けて辞書に登録す
ると共に、現在入力している文字列を、辞書に登録しで
ある最長−散文字列の参照番号で表して符号化するもの
である。 第9図にLZW符号化の説明図を示すと共に第10図に
LZW復号化の説明図を示し、更に第11図に復号化時
に作成される辞書構成例を示す。 尚、第9.10.11図では説明を簡単にするため、a
bcの3文字の組合せからなるデータを圧縮、復元する
場合の例を取り上げている。 第7図のLZW符号化処理では、まずステップ81、(
以下「ステップ」は省略)で予め辞書に全文字につき一
文字からなる文字列を初期値として登録してから符号化
を始める。 Slの符号化は入力した最初の文字Kにより辞書を検索
して参照番号ωを求め、これを語頭文字列とする。 次にS2で入力データの次の文字Kを読込み、S3で文
字入力が終了したか否かチエツクした後、S4に進んで
Slで求めた語頭文字列ωに82で読込んだ文字Kを加
えた拡張文字列(ωK)が辞書にあるか否か探す。 S4で文字列(ωK)が辞書になければ、S6に進んで
Slで求めた文字にの参照番号ωを符号語code (
ω)として出力し、また文字列(ωK)に新たな参照番
号を付加して辞書に登録し、更にS2の入力文字Kを参
照番号ωに置き換えると共に辞書アドレスnをインクリ
メントしてS2に戻って次の文字Kを読み込む。 一方、S4で文字列(ωK)が辞書にあればS5で文字
列(ωK)を参照番号ωに置き換え、再びS2に戻って
S4で文字列(ωK)が辞書から探せなくなるまで最大
一致長の検索を続ける。 第9,10図を参照してLZW符号化を具体的に説明す
ると次のようになる。 まず第9図の入力データ1nputは左から右へと読む
。最初の文字aを入力した時、辞書には文字aの他に一
致する文字列がないので、0UTPUT C0DEl(
参照番号ω)を符号語して出力する。そして文字aを語
頭文字列ωとする。 次に2番目の文字すを入力したとすると、この入力文字
を語頭文字列ωに加えた拡張文字列ωKabは辞書にな
いことから、文字すの0UTPUT C0DE 2を符
号語として出力する。そして、拡張文字列ωに=abに
参照番号4を付けて辞書に登録する。実際の辞書登録は
第10図の右側に示すように文字列1bとして登録され
る。そして文字すが語頭文字列ωとなる。 続いて3番目の文字aを入力したとすると、文字すに語
頭文字列ωを加えた拡張文字列ωに=ba=2aは辞書
にないことから、文字aの0UTPUTCOI)E 1
を符号語として出力した後、拡張文字列ωに=baを2
aで表わし、参照番号5を付けて辞書に登録する。そし
て文字aが新たな語頭文字列ωとなる。 4番目の入力文字すについては拡張文字列ωに=abは
1bの符号語4として既に辞書に登録されているので、
文字列ωKを新たな語頭文字列ωとし、5番目の文字C
を入力して拡張文字列ωに=4 c=a b cを作る
。この拡張文字列ωに=abcは辞書に登録されていな
いことから、文字列a b=1 bの0UTPUT C
0DE 4を符号語として出力し、拡張文字列ωに=a
bcを辞書に40の形で符号語6として登録する。以下
同様に、この処理を続ける。 第8図の復号化処理は第7図の符号化の逆の操作を行う
。 第8図のLZW復号化では、符号化時と同様に予め辞書
に全文字につき一文字からなる文字列を初期値として登
録してから復号化を始める。 まずSlで最初の符号(参照番号)を読込み、現在のC
0DEを0LDcodeとし、最初の符号は既に辞書に
登録された一文字の参照番号いずれかに該当することか
ら、入力符号C0DHに一致する文字code(K)を
探し出し、文字Kを出力する。 尚、出力した文字には後の例外処理のためFINcha
rにセットしておく。 次に82に進んで次の符号を読込んでC0DEにINc
odeとしてセットする。S3で新たな符号があるか否
か、即ち符号入力の終了の有無をチエツクしてS4に進
み、S3で入力された符号C0DEが辞書に定義(登録
)されているか否かチエツクする。 通常、入力した符号語は前回までの処理で辞書に登録さ
れているため、S5に進んで符号C0DHに対応する文
字列code (ωK)を辞書から読出し、S6で文字
Kを一時的にスタックし、参照番号C0DE(ω)を新
な符号C0DEとして再度S5に戻り、このS5.S6
の手順を再帰的に参照番号ωが一文字Kに至るまで繰り
返し、最後に87に進んでS6でスタックした文字をL
 I FO(Last In FartOuj)形式で
ポツプアップして出力する。同時に87において、前回
使った符号ωと今回復元した文字列の最初の1文字Kを
組(ωK)と表した文字列に、新たな参照番号を付加し
て辞書に登録する。 第11図を参照してLZW復号化処理を具体的に説明す
ると次のようになる。 まず第11図で最初の入力符号語(INPUT C0D
E)は1であり、−文字a、b、cについては既に参照
番号1. 2. 3として第10図に示すように辞書に
登録されているため、辞書の参照により符号語1に一致
する参照番号の文字列aに置き換えて出力する。 次の符号語2についても同様にして文字すに置き換えて
出力する。このとき前回処理した符号語1と今回復号し
た文字列の1番目の文字すとを組合わせた文字列ωに=
1bに新たな参照番号4を付加して辞書に登録する。 3番目の符号語4は辞書の検索により求めた文字列1b
から文字列abと置き換えて文字列abを出力する。同
時に前回処理した符号語2と今回復号した文字列の1番
目の文字aとの組合せた文字列ωに=2a (=ba)
に新たな参照番号5を付加して辞書に登録する。 以下同様に、この処理を繰り返す。 第11図のLZW復号化では次の例外処理がある。 この例外処理は、第6番目の入力符号語8の復号で生ず
る。符号語8は復号時に辞書に定義されておらず、復号
できない。この場合には、前回処理した符号語5に前回
復号した文字列baの最初の一文字すを加えた文字列5
bを求め、更に5 b=2 a b=b a b と置き換えて出力する例外処理を行う。そして、文字列
の出力後に前回の符号語5に今回復号した文字列の1番
目の文字すを加えた文字列5bに参照番号8を付加して
辞書に登録する。 この例外処理は、第6図の復号化処理フローの84、S
8の処理を通じて行われ、最終的に87で文字列の出力
と新たな文字列に参照番号を付加した辞書への登録が8
7で行われる。 尚、第8.11図のLZW復号化は、復号側で符号を解
読しながら辞書をリアルタイムで作り出す場合を説明し
たが、符号化の際に作られた辞書をそのまま復号化側に
コピーとして使用することで符号化しても良い。この場
合に復号化側での例外処理は不要になる。 このように第7図の処理フロー図に示す手順でLZW符
号化を行うと、1つの文字列を辞書検索するたびに、最
悪、辞書全体をサーチしなければならならず、辞書検索
に時間がかかる問題があった。 そこで従来の辞書検索方式にあっては、外部/1ツシユ
法(open hashing  又は chaini
ng)を用いて処理速度を上げている。 まず−膜内なハツシュ法による辞書検索にあっては、複
数の文字列からなる集合Sを考えたとき、集合Sの文字
列Xの格納位置を、文字列Xそのものから格納位置を示
すアドレスを直接計算できる仕組みになっており、高速
の辞書検索ができる。 文字列の記憶場所、即ちハツシュ表に0から田−1まで
のアドレスが付されているとすると、ハツシュ法では、
関数 h:s→(0,1,・・・、 m−1)を一つ定めて、
集合Sの文字列Xのアドレスをh(x)として求める。 この関数りをハツシュ関数、値h (x)を文字列Xの
ハツシュアドレスという。 ハツシュ法は、通常、集合Sの大きさがアドレス数mに
比べてはるかに大きい場合に用いられる。 しかしながら、ハツシュ関数りをどのように選んだとし
ても、集合Sの相異なる文字列xi、x2に対して h  (xi)=h  (x2) ハツシュアドレスが一致してしまう場合が起こり得る。 これを衝突と呼び、衝突に対する対策の一つとして外部
ハツシュ法(open hashing、  またはc
haining)が用いられる。 外部ハツシュ法は第12図に示すように、索引(ディレ
クトリ)で示されるハツシュアドレスi毎に連結リスト
を用意し、衝突を起こしたハツシュアドレスh(x)=
iの文字列Xは、連結リストの先頭から順番に格納する
。同じハツシュアドレスh (x)をもつそれぞれの連
結リストはパケット(bucket)と呼ばれる。 辞書検索に外部ハツシュ法のリスト構造を利用したLZ
W符号化の処理フロー図を第13図に示す。また第14
図は外部ハツシュ法に従った辞書メモリの構成を示した
もので、第15図に示す符号化文字列のツリー構造を例
にとってLZW符号化の検索手順と登録手順を具体的に
示している。 まず第14図において、辞書メモリは、ファーストメモ
リ(First Memory) 100、ネクストメ
モリ (Next Memos) 200及びネクスト
メモリ200の拡張メモリ(Extenlion Me
mory) 300で構成される。ここでファーストメ
モリ100が第12図に示した外部ハツシュ法の索引(
ディレクトリ)に対応し、ネクストメモリ200が第1
2図の連結リストのrnextjに対応し、更に拡張メ
モリ300が第12図のrnameJに対応する。 また第15図のツリー構造は、文字に、。、 K2.。 K2゜2、・・・、に4.が既に登録され、破線で示す
に42は新たに登録される場合を示している。このツリ
ー構造における階層は、第13図の処理において、iカ
ウンタで示され、同じ階層における文字の数はjカウン
タで表される。 従って、各文字の登録アドレスはω、とじて表わされる
。 いま第15図の登録済みのツリー構造に含まれる文字列 「K10・K22. K32・K42」が入力した時の
第13図の処理フローに従った辞書検索によるLZW符
号化及び登録を説明すると次のようになる。 第13図において、まずSlで次の初期化処理を行う。 ■第1番目の文字を含むように辞書を初期化する。 例えばアルファベット26文字であれば、文字コードを
そのままハツシュアドレスとして第14図のファースト
メモリに登録する。第15図の場合、ツリートップにあ
る文字KIOがアドレスω、0に登録された状態を意味
する。 ■辞書への現在文字登録数nを前記■で登録した文字数
にセットする。アルファベット26文字の場合には、n
=26となる。 ■入力した最初の文字Kを語頭文字列iとする。 第15図の場合、最初の入力文字はに、。であることか
ら語頭文字列i=1とする。尚、以下の処理フロー中で
は語頭文字列iをjカウンタとして説明する。 ■辞書検索用配列を0に初期化する。即ち、ファースト
、ネクスト及び拡張のメモリの検索用配列はIi+sl
[1,Nmax]、next [1,Nmax] 、E
XT  [1,Nmax]で表わされるので、これを0
に初期化する。 Slの初期化処理が済んだならば、S2に進んで次の文
字「K2□」を読込む。次に83で未処理の文字がある
か否かチエツクする。全ての処理が終ればS16に進ん
で符号語code (ω)を出力して処理を終了する。 このとき未処理文字があるので85〜S9に示す辞書検
索ステップに進む。 辞書検索ステップは、まずS5でアドレスω。 にそのときの語頭文字列i=1の値をセットし、且つj
カウンタをj=0にセットする。これによりファースト
メモリのアドレスω1.=ω、0が生成される。 次に86でファーストメモリ100のアドレスω、。の
内容を読むとアドレスω1.=ω21が得られるので、
iカウンタをi=2にセットする。 続いてS7に進み、i=0か否かチエツクし、このとき
i=2であることがらS8に進み、S6のファーストメ
モリ100から得られたアドレスω2.の拡張メモリ3
00を参照して文字rK2+Jを読出し、S2で得てい
る入力文字「K22」との一致を判別する。この場合、
両者は不一致であることから89に進み、このときのi
カウンタの値i=2をjカウンタにセットしてj=2と
し、またネクストメモリ200のアドレスω2.に格納
されているアドレスω、=ω2□のjをjカウンタにi
=2としてセットする。このため新たなアドレスω、=
ω2□が作り出される。 続いてS7に戻り、i=0をチエツクし、このときi=
2であることから再びS8に進んでアドレスω2□の拡
張メモリ300の登録文字「K2□」を読出して入力文
字「K22」との一致を判別する。 このとき両者は一致することから82に戻り、次の文字
「K3□」を読込む。以下同様にして85〜S9の処理
の繰り返しにより、第14図の実線の矢印で示す順番に
辞書検索が行なわれ、既に登録済みの文字rK4+Jま
での検索処理が行われる。 登録文字「K4□」の検索が終了してS8で最後の入力
文字1に4□」で不一致が判別された場合には、S9で
i=2にセットすると共に、アドレスω4.のネクスト
メモリ200の内容が0であることから、i=0にセッ
トする。このためS7に戻った時にi=0が判別され、
辞書検索ステップを抜は出してSIOに進み、それまで
の文字列「K、。、に2□、に3゜Jを示すアドレスω
3□を符号語C0de (ω)として出力し、SL1〜
14の辞書登録ステップに進む。 辞書登録ステップにあっては、まずSllで現在登録文
字列nをn=i、即ちn=4にセットし、更にnを1つ
インクリメントする。そして文字「K4□」を拡張メモ
リ300のアドレスω、=ω42に登録する。 次に812でj=0か否かをチエツクし、このときj=
2であることから814に進み、ネクストメモリ200
のアドレスω4.に文字「K42」を登録したアドレス
ω4□を書込む。一方、S12でj=0であれば、即ち
、ファーストメモリ100への登録に移行した状態であ
れば、第14図のファーストメモリ100のアドレスω
01.ω2□、ω32に示すように、拡張メモリ300
の文字登録アドレスを格納する。 この文字登録ステップにおける文字「K42」の登録に
より、第14図のネクストメモリ200及び拡張メモリ
300は、下部に破線で仕切って示すアドレスω41.
ω42の登録状態となり、第15図に示すツリー構造に
新たな文字「K42」のアドレスω42が追加されたこ
とになる。尚、第14図では、アドレスω4.について
は説明の都合上、検索と登録で重複して示している。 SLl〜S14の辞書登録ステップが終了すると、S1
5で登録した文字「K4□」を新たな語頭文字列11即
ち、iカウンタの値にセットし、再びS2に戻って文字
rK、s2Jをツリートップとして、その後に続く文字
列の辞書検索に移行する。
FIG. 7 shows an encoding processing flow using a conventional LZW code, and FIG. 8 shows a decoding processing flow. First, LZW encoding processing has a rewritable dictionary,
Divide the input character string into different character strings (substrings) and register these character strings in the dictionary with reference numbers in the order in which they appear, and also register the currently input character string in the dictionary. The longest-dispersed character string is represented by a reference number and encoded. FIG. 9 shows an explanatory diagram of LZW encoding, FIG. 10 shows an explanatory diagram of LZW decoding, and FIG. 11 shows an example of a dictionary structure created during decoding. In addition, in Figure 9.10.11, to simplify the explanation, a
An example of compressing and restoring data consisting of a combination of three characters bc is taken up. In the LZW encoding process in FIG. 7, first step 81, (
(hereinafter, "step" is omitted), a character string consisting of one character for each character is registered in the dictionary as an initial value, and then encoding is started. To encode Sl, a dictionary is searched using the input first character K to obtain a reference number ω, and this is used as the initial character string. Next, in S2, the next character K of the input data is read, and after checking whether character input is completed in S3, the process proceeds to S4, and the character K read in in 82 is added to the initial character string ω obtained in Sl. Search whether the added extended character string (ωK) exists in the dictionary. If the character string (ωK) is not in the dictionary in S4, proceed to S6 and use the code word code (
ω), add a new reference number to the character string (ωK), register it in the dictionary, replace the input character K in S2 with the reference number ω, increment the dictionary address n, and return to S2. Read the next character K. On the other hand, if the character string (ωK) is in the dictionary in S4, the character string (ωK) is replaced with the reference number ω in S5, the process returns to S2, and the maximum match length is increased in S4 until the character string (ωK) cannot be found in the dictionary. Continue searching. LZW encoding will be specifically explained as follows with reference to FIGS. 9 and 10. First, the input data 1nput in FIG. 9 is read from left to right. When you enter the first letter a, there are no matching strings in the dictionary other than the letter a, so 0UTPUT C0DEl(
The reference number ω) is output as a code word. Then, let the character a be the initial character string ω. Next, if the second character S is input, the extended character string ωKab obtained by adding this input character to the initial character string ω is not found in the dictionary, so the character S 0UTPUT C0DE 2 is output as a code word. Then, the extended character string ω is added with reference number 4 to =ab and registered in the dictionary. In actual dictionary registration, the character string 1b is registered as shown on the right side of FIG. Then, the character S becomes the word-initial character string ω. If you then input the third character a, the expanded character string ω, which is the initial character string ω added to the character S, =ba=2a is not in the dictionary, so the character a is 0UTPUTCOI)E 1
After outputting as a code word, =ba is added to the extended string ω by 2
It is represented by a and is registered in the dictionary with the reference number 5. Then, the letter a becomes a new initial character string ω. For the fourth input character, the extended character string ω = ab is already registered in the dictionary as code word 4 of 1b, so
Let the character string ωK be a new initial character string ω, and the fifth character C
Input and create the expanded character string ω =4 c=a b c. Since =abc is not registered in the dictionary for this extended character string ω, 0UTPUT C of character string a b = 1 b
Output 0DE 4 as a code word, and add =a to the extended character string ω
bc is registered in the dictionary as code word 6 in the form of 40. This process continues in the same manner. The decoding process shown in FIG. 8 performs the reverse operation of the encoding process shown in FIG. 7. In the LZW decoding shown in FIG. 8, decoding is started after a character string consisting of one character for every character is registered in the dictionary as an initial value in the same way as during encoding. First, read the first code (reference number) with Sl, and
Since 0DE is set as 0LDcode and the first code corresponds to one of the reference numbers of one character already registered in the dictionary, the character code (K) matching the input code C0DH is searched and the character K is output. Note that the output characters are FINcha for later exception handling.
Set it to r. Next, go to 82, read the next code, and set it to C0DE.INc
Set as ode. In S3, it is checked whether there is a new code, that is, whether the code input has ended, and the process proceeds to S4, where it is checked whether the code C0DE inputted in S3 is defined (registered) in the dictionary. Normally, the input code word has been registered in the dictionary in the previous processing, so the process advances to S5 and the character string code (ωK) corresponding to the code C0DH is read from the dictionary, and the character K is temporarily stacked in S6. , the reference number C0DE(ω) is changed to a new code C0DE, and the process returns to S5 again. S6
Repeat the steps recursively until the reference number ω reaches one character K, and finally proceed to 87 and change the stacked character to L in S6.
Pop up and output in IFO (Last In FartOuj) format. At the same time, at 87, a new reference number is added to the character string representing the set (ωK) consisting of the previously used code ω and the first character K of the character string restored this time, and the character string is registered in the dictionary. The LZW decoding process will be specifically explained as follows with reference to FIG. First, in Figure 11, the first input code word (INPUT C0D
E) is 1, - for the letters a, b, c already the reference number 1. 2. 3 is registered in the dictionary as shown in FIG. 10, so by referring to the dictionary, the character string a having the reference number matching code word 1 is replaced and output. Similarly, the next code word 2 is replaced with the character S and output. At this time, the character string ω that is a combination of the code word 1 processed last time and the first character of the character string just decoded is =
Add a new reference number 4 to 1b and register it in the dictionary. The third code word 4 is the character string 1b found by dictionary search.
is replaced with the character string ab and the character string ab is output. At the same time, the character string ω that is the combination of code word 2 processed last time and the first character a of the character string just decoded is = 2a (=ba)
is added with a new reference number 5 and registered in the dictionary. This process is repeated in the same manner. The LZW decoding shown in FIG. 11 involves the following exception handling. This exception handling occurs in the decoding of the sixth input codeword 8. Code word 8 is not defined in the dictionary at the time of decoding and cannot be decoded. In this case, the character string 5 is obtained by adding the first character of the previously decoded character string ba to the previously processed code word 5.
Exception processing is performed to find b and then replace it with 5 b=2 a b=b a b and output it. After outputting the character string, a reference number 8 is added to a character string 5b obtained by adding the first character of the currently decoded character string to the previous code word 5, and the result is registered in the dictionary. This exception handling is performed at 84 and S in the decoding process flow in FIG.
Finally, in step 87, the character string is output and the new character string is registered in the dictionary with a reference number added.
It will be held at 7. In addition, in the LZW decoding shown in Figure 8.11, we have explained the case where the dictionary is created in real time while decoding the code on the decoding side, but the dictionary created during encoding can be used as a copy on the decoding side as is. It may be encoded by doing this. In this case, exception handling on the decoding side becomes unnecessary. If LZW encoding is performed according to the procedure shown in the processing flow diagram in Figure 7, in the worst case, the entire dictionary will have to be searched every time a dictionary is searched for one character string, and the dictionary search will take time. There was such a problem. Therefore, in conventional dictionary search methods, open hashing or chain
ng) to increase processing speed. First, in a dictionary search using the intra-membrane hash method, when considering a set S consisting of multiple character strings, the storage position of the character string X in the set S can be determined from the address of the character string X itself. It has a mechanism that allows direct calculation, and allows for high-speed dictionary searches. Assuming that the storage location of the character string, that is, the hash table, is assigned addresses from 0 to -1, in the hash method,
Define one function h: s → (0, 1, ..., m-1),
Find the address of character string X in set S as h(x). This function is called a hash function, and the value h (x) is called a hash address of the character string X. The hash method is normally used when the size of the set S is much larger than the number m of addresses. However, no matter how the hash function is selected, a case may occur in which the hash addresses for different character strings xi and x2 of the set S match h (xi)=h (x2). This is called a collision, and one of the countermeasures against collision is the external hashing method (open hashing, or c
haining) is used. As shown in Figure 12, in the external hash method, a linked list is prepared for each hash address i indicated by an index (directory), and the hash address h(x) =
The character strings X of i are stored in order from the beginning of the linked list. Each linked list with the same hash address h(x) is called a packet. LZ using list structure of external hash method for dictionary search
A processing flow diagram of W encoding is shown in FIG. Also the 14th
The figure shows the structure of a dictionary memory according to the external hash method, and specifically shows the search procedure and registration procedure of LZW encoding using the tree structure of the encoded character string shown in FIG. 15 as an example. First, in FIG. 14, the dictionary memories include a first memory 100, a next memory 200, and an extension memory of the next memory 200.
mory) Consists of 300. Here, the first memory 100 has an index of the external hash method shown in FIG.
directory), and the next memory 200 is the first
This corresponds to rnextj in the linked list in FIG. 2, and the extended memory 300 corresponds to rnameJ in FIG. Also, the tree structure in Figure 15 is for characters. , K2. . K2゜2,..., 4. has already been registered, and the broken line 42 indicates a case where it is newly registered. In the process of FIG. 13, the hierarchy in this tree structure is represented by an i counter, and the number of characters in the same hierarchy is represented by a j counter. Therefore, the registered address of each character is expressed as ω. Now, the LZW encoding and registration by dictionary search according to the processing flow in Figure 13 when the character string "K10/K22. K32/K42" included in the registered tree structure in Figure 15 is input will be explained as follows. become that way. In FIG. 13, first, the following initialization process is performed in Sl. ■ Initialize the dictionary to include the first character. For example, if there are 26 alphabetic characters, the character code is directly registered as a hash address in the first memory shown in FIG. 14. In the case of FIG. 15, it means that the character KIO at the top of the tree is registered at address ω,0. (2) Set the current number of characters registered in the dictionary n to the number of characters registered in (2) above. In the case of 26 alphabetic characters, n
=26. ■Let the first character K input be the initial character string i. In the case of Figure 15, the first input character is . Therefore, the word initial character string i=1. In the following processing flow, the initial character string i will be described as a j counter. ■Initialize the dictionary search array to 0. That is, the search array for first, next, and extended memories is Ii+sl.
[1, Nmax], next [1, Nmax], E
Since it is expressed as XT [1, Nmax], set it to 0
Initialize to . When the initialization process of Sl is completed, the process advances to S2 and the next character "K2□" is read. Next, at 83, a check is made to see if there are any unprocessed characters. When all the processing is completed, the process proceeds to S16, where the code word code (ω) is output, and the processing ends. At this time, since there are unprocessed characters, the process proceeds to dictionary search steps 85 to S9. The dictionary search step begins with address ω in S5. Set the value of the initial word string i=1 at that time, and j
Set the counter to j=0. As a result, the first memory address ω1. =ω, 0 is generated. Next, at 86, the address ω of the first memory 100 is determined. If you read the contents of the address ω1. = ω21 is obtained, so
Set the i counter to i=2. Next, the process proceeds to S7, where it is checked whether or not i=0, and since i=2 at this time, the process proceeds to S8, where the address ω2. extended memory 3
00, the character rK2+J is read out, and it is determined whether it matches the input character "K22" obtained in S2. in this case,
Since the two do not match, proceed to 89, and at this time i
The counter value i=2 is set in the j counter to make j=2, and the address ω2. of the next memory 200 is set. j of address ω, = ω2□ stored in j counter i
=2. Therefore, the new address ω,=
ω2□ is created. Next, return to S7, check i=0, and at this time i=
2, the process goes to S8 again to read the registered character "K2□" from the extended memory 300 at the address ω2□ and determine whether it matches the input character "K22". At this time, since the two match, the process returns to 82 and the next character "K3□" is read. Thereafter, by repeating the processes 85 to S9 in the same manner, dictionary searches are performed in the order shown by the solid arrows in FIG. 14, and the search processing up to the already registered characters rK4+J is performed. When the search for the registered character "K4□" is completed and it is determined in S8 that there is a mismatch between the last input character 1 and 4□, i=2 is set in S9, and the address ω4. Since the content of the next memory 200 is 0, i=0 is set. Therefore, when returning to S7, it is determined that i=0,
Skip the dictionary search step and proceed to SIO, and retrieve the address ω indicating the character string ``K, ., 2□, 3゜J''.
3□ is output as the code word C0de (ω), and SL1~
Proceed to step 14 of dictionary registration. In the dictionary registration step, first, the currently registered character string n is set to n=i, that is, n=4, and n is further incremented by one. Then, the character "K4□" is registered at the address ω,=ω42 of the extended memory 300. Next, in 812, it is checked whether j=0 or not, and at this time, j=
Since it is 2, proceed to 814 and next memory 200
address ω4. Write the address ω4□ in which the characters "K42" are registered. On the other hand, if j=0 in S12, that is, if the state has shifted to registration in the first memory 100, the address ω of the first memory 100 in FIG.
01. As shown in ω2□ and ω32, the extended memory 300
Stores the character registration address. By registering the character "K42" in this character registration step, the next memory 200 and expansion memory 300 in FIG. 14 are stored at the address ω41.
ω42 is now in the registered state, and the address ω42 of the new character “K42” has been added to the tree structure shown in FIG. In addition, in FIG. 14, the address ω4. For convenience of explanation, these are shown redundantly for search and registration. When the dictionary registration steps SL1 to S14 are completed, S1
Set the character "K4□" registered in step 5 to the new initial character string 11, that is, the value of the i counter, and return to S2 again and use the characters rK and s2J as the top of the tree to perform a dictionary search for subsequent character strings. Transition.

【発明が解決しようとする課題】[Problem to be solved by the invention]

このように従来のLZW符号化にあっては、ソフトウェ
アにより第7図に示した処理フローを実行して符号化す
る場合、辞書検索処理に多くの時間を要するとこから、
外部ハツシュ法を利用して第13図の処理フローにより
辞書検索の高速化を図っている。 しかしながら、外部ハツシュ法を利用した辞書検索にあ
っては、候補文字の続出、候補文字と入力文字との照合
、一致不一致の判定がシーケルシャルに行なわれるため
に、辞書検索時間が全体時間の約80%を占め、より一
層の高速化が必要とされている。 また、候補文字の読出しに外部ハツシュ法を利用したリ
スト構造を採用しているため、現在の候補文字の格納ア
ドレスと次の候補文字の格納アドレスとの間にはあまり
関連性がなく、随時読み出すしかなく、アドレスの先だ
しが出来ず、辞書メモリを構成する素子の性能を最大限
に活かすことができなかった。 例えば、辞書メモリとしてDRAMを用いる場合、アド
レスに連続性が無いため、例えば列アドレス(Row 
Adress)を固定して行アドレス((Cotum 
AdressJのみを変化させるページモード等の高速
読出が困難であった。 例えば第14図の場合では、ネクストメモリ200のア
ドレスω3□、ω33にはアドレスの連続性が無いので
、第16図に示すように列アドレスと行アドレスを個別
にその都度指定する普通のり一ドモードとなり、高速化
が図れない問題があった。 本発明は、このような従来の問題点に鑑みてなされたも
ので、外部ハツシュ法のリスト構造を利用した辞書メモ
リの高速読出を可能にして辞書検索時間を短縮できるデ
ータ圧縮装置の辞書検索方式を提供することを目的とす
る。
As described above, in conventional LZW encoding, when encoding is performed by software by executing the processing flow shown in FIG. 7, dictionary search processing takes a lot of time.
The processing flow shown in FIG. 13 uses the external hash method to speed up the dictionary search. However, in dictionary searches using the external hash method, candidate characters are generated one after another, candidate characters are compared with input characters, and matches and mismatches are determined in a sequential manner. This accounts for 80% of the time, and there is a need for even higher speeds. In addition, since a list structure using an external hash method is used to read out candidate characters, there is little correlation between the storage address of the current candidate character and the storage address of the next candidate character, and they can be read out at any time. Therefore, it was not possible to read addresses first, and it was not possible to make the most of the performance of the elements that made up the dictionary memory. For example, when using DRAM as a dictionary memory, there is no continuity in addresses, so for example, column addresses (Row
Fix the row address ((Cotum
It has been difficult to perform high-speed reading such as in a page mode in which only AddressJ is changed. For example, in the case of Fig. 14, there is no continuity of addresses in the addresses ω3□ and ω33 of the next memory 200, so as shown in Fig. 16, the normal glued mode in which the column address and row address are specified individually each time is used. Therefore, there was a problem that speeding up could not be achieved. The present invention has been made in view of such conventional problems, and provides a dictionary search method for a data compression device that can shorten dictionary search time by enabling high-speed reading of dictionary memory using the list structure of the external hash method. The purpose is to provide

【課題を解決するための手段] 第1図は本発明の原理説明図である。 まず本発明は、符号化済みデータを相異なる部分列に分
けて各部分列毎に異なる参照番号を付加して辞書に登録
しておき、入力データを該辞書中の部分列の内、最大長
一致する部分列の参照番号で指定して符号化するデータ
圧縮装置、例えばLzW符号化を行なうデータ圧縮装置
を対象とする。 このようなデータ圧縮装置の辞書検索方式として本発明
にあっては、外部ハツシュ法のリスト構造に従ったファ
ーストメモリ100及び拡張メモリ300を有するネク
ストメモリ200を備え、入力データに基づく外部ハツ
シュアドレスの連結アドレスを、部分的にネクストメモ
リ200の連続アドレスで構成した辞書メモリ20と、
入力データに基づいてネクストメモリ200のアドレス
を連続的に発生して入力データに一致する拡張メモリ3
00の候補データを検索する辞書検索手段16と設けた
ことを特徴とする。 ここで辞書検索手段16は、入力データと候補データの
一致検査、候補データの有無、次の候補データの読出し
を平行して行うパイプライン制御手段26を備える。ま
た辞書メモリ20のアクセスモードとして高速ページモ
ードを使用する。 【作用】 このような構成を備えた本発明によるデータ圧縮装置の
辞書検索方式によれば、LZW符号化の辞書検索におい
て外部ハツシュ法に基づくリスト構造をもつ辞書メモリ
の索引アドレスを連続アドレスで構成することで、1つ
のハツシュアドレスが決まれば次のアドレスが予測でき
るので、候補文字の検索アクセスをより高速化し、辞書
メモリの高速読出による符号化ができ、符号化処理時間
を短縮することができる。
[Means for Solving the Problem] FIG. 1 is a diagram illustrating the principle of the present invention. First, the present invention divides encoded data into different subsequences, adds a different reference number to each subsequence, and registers it in a dictionary. The present invention is directed to a data compression apparatus that specifies and encodes matching subsequences using reference numbers, such as a data compression apparatus that performs LzW encoding. As a dictionary search method for such a data compression device, the present invention includes a first memory 100 according to the list structure of the external hash method and a next memory 200 having an extended memory 300, and stores an external hash address based on input data. a dictionary memory 20 whose concatenated addresses are partially composed of consecutive addresses of the next memory 200;
Expansion memory 3 that continuously generates addresses of the next memory 200 based on input data to match the input data.
The present invention is characterized in that it is provided with a dictionary search means 16 for searching candidate data of 00. Here, the dictionary search means 16 includes a pipeline control means 26 that performs a match check between input data and candidate data, presence or absence of candidate data, and reading of the next candidate data in parallel. Furthermore, the high speed page mode is used as the access mode for the dictionary memory 20. [Operation] According to the dictionary search method of the data compression device according to the present invention having such a configuration, in the dictionary search of LZW encoding, the index address of the dictionary memory having a list structure based on the external hash method is composed of continuous addresses. By doing this, once one hash address is determined, the next address can be predicted, which speeds up search access for candidate characters, enables encoding by high-speed reading of dictionary memory, and reduces encoding processing time. can.

【実施例】【Example】

第2図の本発明の辞書検索方式を備えたデータフ圧縮装
置(符号化装置)の一実施例を示した実施例構成図であ
る。 第2図において、処理対象となる原データ10はDMA
 (Direct Memor7 Access)制御
回路12を介して入力される。制御手段としてのMPU
I4は入力された原データ10を、1−文字と今までの
文字列の参照番号を辞書検索回路16の複数文字読込み
回路18にセットした後、辞書検索回路16を起動する
。 辞書検索回路16は以後、辞書メモリ20より1文字伸
ばした文字列の候補文字を読込み、一致検査回路22で
入力文字と候補文字との一致検査(照合)を行ない、連
結検出回路24で候補文字の有無の検出を行なう。 パイプライン制御回路26は、一致検査回路22による
入力文字と候補文字の照合と連結検出回路24による候
補文字の有無の検出とに並行して辞書メモリ20に次の
候補文字の読出しをかける。 このようにパイプライン制御回路26でパイプライン処
理を行なうことで、候補文字の複数個ごとの探索と照合
処理が辞書メモリ20のサイクル・タイムで実行するこ
とができる。 更に辞書検索回路16には連続アドレス回路28が設け
られ、連続アドレス回路28は連続アドレスを発生し、
複数文字読込み回路18に辞書メモリ20の連続アドレ
スに登録されているノ1ツシュアドレス及び候補文字を
読出すようにする。 LZW符号の符号化では、辞書メモリ20中の最大長一
致する文字列を求める。従って、入力文字を付加して文
字列を逐次−文字ずつ伸ばしていき、候補文字がなくな
ったところで最大一致長の文字列であることが分かる。 このとき、最大一致長文字列まではアドレスωを使用し
た参照番号で表わされており、その参照番号ωを入出力
ボート30から外部に圧縮された符号語code (ω
)として出力する。 第3図は第2図に示した本発明の辞書検索回路16の詳
細な構成を辞書メモリ20と共に示した実施例構成図で
ある。 第3図において、アドレスレジスタ18−1゜レジスタ
18−2及びレジスタ18−3が第2図の複数文字読込
み回路18に対応し、レジスタ22−1.比較器22−
2が第2図の一致検査回路22に対応し、NOR回路2
4−1が第2図の連結検出回路24に対応し、更にカウ
ンタ28−1が第2図の連続アドレス回路28に対応す
る。 次に第3図の実施例による辞書検索を、第4図の検索手
順と登録手順の説明図及び第5図の辞書メモリ20の登
録状態を示すツリー構造説明図をを参照して説明する。 尚、以下の説明でメモリアドレスωは、上位アドレス1
1下位アドレスjによりω1.として表されるものとす
る。 いま原データ10として第5図のツリー構造に含まれる
文字列 「K、。、に2゜、  K32. K4□」が入力した
とする。 まずMPU14は最初に入力した文字列の1番目の文字
に1oの1文字分の参照番号ω1oを上位アドレスを指
定するアドレスレジスタ18−1にセットすると共に、
入力した2番目の文字に2゜をレジスタ18−2にセッ
トする。 次にパイプライン制御回路26に辞書検索回路16の起
動を指令する。パイプライン制御回路26は、まず連続
アドレスを発生するカウンタ28−1を0にセットして
から辞書メモリ20に続出をかける。カウンタ28−1
の内容は辞書メモリ20のアドレスの最下位2ビツト(
L S B)を指定する。従って、アドレスレジスタ1
8−1の内容ω1.−ω1oによるが辞書メモリ20の
上位アドレスの指定と、カウンタ28−1の内容j=0
による辞書メモリ20の下位アドレスの指定でなるアド
レス(ω+o+0)により第4図のファーストメモリ1
00をアクセスしてω21を読出し、アドレスレジスタ
18−1にセットする。 次にアドレスレジスタ18−1の内容ω2.を上位アド
レス、カウンタ28−1の内容を下位アドレスとしたア
ドレス(ω21十〇)により辞書メモリ20のネクスト
メモリ200及び拡張メモリ300をアクセスし、第1
番目の候補文字に21及び第2番目の候補文字に22の
連結アドレスω2□を読出す。読出した第1番目の候補
文字に2+はレジスタ18−2にセットし、第2番目の
候補文字に22の連結アドレスω2□はレジスタ18−
3にセットする。そして、レジスタ22−1にセットさ
れている入力文字に2□とレジスタ18−2にセットさ
れた第1番目の候補文字に21を比較器22−2で比較
して一致、不一致の判定を行なう。 両者は一致しないことから、不一致の判定が出され、次
の候補文字に2□を読出すが、このときカウンタ28−
1の値を1つインクリメントして辞書メモリ20の下位
アドレスのみを変えたネクストメモリ200のアドレス
(ω21+1)を発生し、ネクストメモリ200のアク
セスで次の候補文字に22をレジスタ18−2に読出す
。このとき上位アドレスを指定しているアドレスレジス
タ181の内容ω2□はそのままである。 以下同様に、この動作を繰りの返すが、カウンタ28−
1を使用して無闇に連続アドレスを発生させることは、
辞書メモリ20を大きくするので、この実施例にあって
は、4回の連続アドレスを発生させることを考えている
。例えば文字コードが8ビツトの場合、9ビツトを越え
るアドレスは意味がないからである。 従って、検索の4回に1回はネクストメモリ200の連
続アドレスではなく、ファーストメモリ100のアクセ
スで得られた連結アドレスω11を使用する。即ち、上
位アドレスを固定したままカンウタ28−1で連続する
下位アドレス「00゜01.10.IIJを4回発生す
ると、次の連続アドレス「00」への切替えと同時に、
レジスタ18−3に4回目のアクセスでレジスタス18
−3で格納されているファーストメモリ100の連結ア
ドレスをアドレスレジスタ18−1にセットする。 例えば第4図のネクストメモリ200の上位アドレスω
9.を例にとると、カウンタ28−1による下位アドレ
スのインクリメントで、 ω31十〇(=ω3.) ω31+1 (=ω3□) ω31+2(=ω33) ω31+3(=ω34) が連続アドレスとして発生され、5回目はネクストメモ
リ200に格納された次の連続アドレスへの連結アドレ
スω3.を続出して上位アドレスとして再び連続アドレ
スの発生を最初から繰り返す。 このような辞書検索により比較器22−2で入力文字と
候補文字の照合が一致したときは、同時にNOR回路2
4−1でレジスタ18−3の内容(ネクストメモリ20
0の連結アドレス)がオル0であるか否かを検査し、オ
ールOとなるまで辞書検索を繰り返す。もしレジスタ1
8−3がオール0であれば、検索すべき候補文字がなく
なったことが検出される。この場合には、MPU14及
びパイプライン制御回路26は、辞書検索回路16の検
索処理を終了させ、それまでの辞書検索により最後に一
致した候補文字のアドレスを符号語code (ω)と
して出力する。 第4図の場合、入力文字rK4+jでネクストメモリ2
00の内容がオール0となることから、この段階で辞書
検索を終了し、最後に一致した候補文字rK4+Jのア
ドレス(ω41+0)を符号語C0de(ω)として出
力する。 続いてMPU14は、最後に残った入力文字「K4□」
につきアドレス(ω4゜+1)の拡張メモリ300への
登録と、ネクストメモリ200のアドレス(ω41+0
)への連結アドレスω4□の登録を行った後、入力文字
rK42Jを語頭文字列iとして新たな辞書検索に移行
する。 このように本発明では、連続的にアドレスを発生して候
補文字及び連結アドレスを検索できるので、辞書メモリ
20として第6図に示すような列アドレスを固定した状
態で行アドレスをのみを変化させる連続アドレスによる
高速ページモードが使用でき、候補文字及びその連結ア
ドレスが高速で読出せるので、辞書探索の高速実行が実
現できる。
FIG. 3 is an embodiment configuration diagram showing an embodiment of a data compression device (encoding device) equipped with the dictionary search method of the present invention shown in FIG. 2; In FIG. 2, the original data 10 to be processed is a DMA
(Direct Memor7 Access) Input via the control circuit 12. MPU as a control means
I4 sets the input original data 10, the 1-character and the reference number of the previous character string in the multiple character reading circuit 18 of the dictionary search circuit 16, and then activates the dictionary search circuit 16. Thereafter, the dictionary search circuit 16 reads the candidate character of the character string extended by one character from the dictionary memory 20, the match check circuit 22 performs a match check (verification) between the input character and the candidate character, and the concatenation detection circuit 24 reads the candidate character. Detects the presence or absence of. The pipeline control circuit 26 reads the next candidate character from the dictionary memory 20 in parallel with the match checking circuit 22 collating the input character with the candidate character and the connection detection circuit 24 detecting the presence or absence of the candidate character. By performing pipeline processing in the pipeline control circuit 26 in this manner, search and collation processing for each of a plurality of candidate characters can be executed within the cycle time of the dictionary memory 20. Furthermore, the dictionary search circuit 16 is provided with a continuous address circuit 28, which generates continuous addresses.
A plurality of character reading circuit 18 is made to read out one-touch addresses and candidate characters registered at consecutive addresses in a dictionary memory 20. In encoding with the LZW code, a character string in the dictionary memory 20 that matches the maximum length is obtained. Therefore, by adding input characters, the character string is successively extended by one character, and when there are no more candidate characters, it is known that the character string has the maximum matching length. At this time, the character string up to the maximum match length is represented by a reference number using the address ω, and that reference number ω is transferred from the input/output boat 30 to the external compressed code word code (ω
). FIG. 3 is an embodiment configuration diagram showing the detailed configuration of the dictionary search circuit 16 of the present invention shown in FIG. 2 together with the dictionary memory 20. In FIG. 3, address register 18-1, register 18-2, and register 18-3 correspond to the multiple character reading circuit 18 of FIG. 2, and registers 22-1, . Comparator 22-
2 corresponds to the coincidence check circuit 22 in FIG.
4-1 corresponds to the connection detection circuit 24 of FIG. 2, and counter 28-1 corresponds to the continuous address circuit 28 of FIG. Next, dictionary search according to the embodiment of FIG. 3 will be explained with reference to FIG. 4, which is an explanatory diagram of the search procedure and registration procedure, and FIG. 5, which is an explanatory diagram of the tree structure showing the registration state of the dictionary memory 20. In the following explanation, memory address ω is the upper address 1.
ω1 by the 1st lower address j. shall be expressed as . Assume that the character string "K, ., 2°, K32. K4□" included in the tree structure of FIG. 5 is input as the original data 10. First, the MPU 14 sets the reference number ω1o corresponding to one character of 1o to the first character of the first input character string in the address register 18-1 that specifies the upper address.
Set 2° to the second input character in register 18-2. Next, the pipeline control circuit 26 is instructed to start up the dictionary search circuit 16. The pipeline control circuit 26 first sets the counter 28-1, which generates consecutive addresses, to 0, and then writes the consecutive addresses to the dictionary memory 20. counter 28-1
The content of is the lowest two bits of the address of the dictionary memory 20 (
Specify LSB). Therefore, address register 1
Contents of 8-1 ω1. - Due to ω1o, the upper address of the dictionary memory 20 is specified and the content of the counter 28-1 j=0
The address (ω+o+0) specified by the lower address of the dictionary memory 20 by
00 to read out ω21 and set it in the address register 18-1. Next, the contents ω2 of address register 18-1. The next memory 200 and expansion memory 300 of the dictionary memory 20 are accessed by the address (ω2100) with the upper address being the upper address and the contents of the counter 28-1 being the lower address, and the first
The concatenated address ω2□ of 21 for the th candidate character and 22 for the second candidate character is read out. 2+ is set in the register 18-2 for the first candidate character read, and the concatenated address ω2□ of 22 is set in the register 18-2 for the second candidate character.
Set to 3. Then, the comparator 22-2 compares the input character set in the register 22-1 with 2□ and the first candidate character set in the register 18-2 with 21 to determine whether they match or do not match. . Since the two do not match, it is determined that they do not match, and 2□ is read out as the next candidate character, but at this time the counter 28-
The address (ω21+1) of the next memory 200 is generated by incrementing the value of 1 by 1 to change only the lower address of the dictionary memory 20, and when the next memory 200 is accessed, 22 is read into the register 18-2 as the next candidate character. put out. At this time, the contents ω2□ of the address register 181 specifying the upper address remain unchanged. This operation is repeated in the same way, but the counter 28-
1 to generate consecutive addresses blindly,
Since the dictionary memory 20 is to be enlarged, this embodiment is designed to generate four consecutive addresses. For example, if the character code is 8 bits, an address exceeding 9 bits has no meaning. Therefore, once in four searches, the concatenated address ω11 obtained by accessing the first memory 100 is used instead of the continuous address of the next memory 200. That is, when the counter 28-1 generates the consecutive lower address "00°01.10.IIJ" four times while the upper address is fixed, it simultaneously switches to the next consecutive address "00".
Register 18 on the fourth access to register 18-3
-3 is stored in the first memory 100 is set in the address register 18-1. For example, the upper address ω of the next memory 200 in FIG.
9. For example, when the lower address is incremented by the counter 28-1, ω3110 (=ω3.) ω31+1 (=ω3□) ω31+2 (=ω33) ω31+3 (=ω34) are generated as consecutive addresses, and the fifth address is is the link address ω3. to the next consecutive address stored in the next memory 200. are successively generated, and the generation of consecutive addresses is repeated from the beginning as the upper address. When the input character and the candidate character match in the comparator 22-2 through such a dictionary search, the NOR circuit 2 simultaneously
4-1, the contents of register 18-3 (next memory 20
0's concatenated address) is all 0's, and the dictionary search is repeated until all 0's are found. If register 1
If 8-3 is all 0, it is detected that there are no more candidate characters to search for. In this case, the MPU 14 and the pipeline control circuit 26 terminate the search process of the dictionary search circuit 16, and output the address of the last matching candidate character in the dictionary search so far as the code word code (ω). In the case of Figure 4, input character rK4+j moves to next memory 2.
Since the contents of 00 are all 0, the dictionary search is ended at this stage, and the address (ω41+0) of the last matched candidate character rK4+J is output as the code word C0de(ω). Next, the MPU 14 inputs the last remaining input character "K4□"
The address (ω4°+1) is registered in the extended memory 300, and the address (ω41+0) of the next memory 200 is registered in the extended memory 300.
) After registering the connected address ω4□, a new dictionary search is performed using the input character rK42J as the initial character string i. In this way, in the present invention, candidate characters and concatenated addresses can be retrieved by continuously generating addresses, so that only the row address can be changed while the column address is fixed as shown in FIG. 6 as the dictionary memory 20. A high-speed page mode using continuous addresses can be used, and candidate characters and their concatenated addresses can be read out at high speed, so dictionary searches can be performed at high speed.

【発明の効果】【Effect of the invention】

以上説明したように本発明によれば、LZW符号化の辞
書探索において外部ハツシュ法を利用した連結リストを
連続アドレスで構成したため、1つのアドレスが決まれ
ばアドレスの予測による先だしができ、辞書メモリとし
て例えばDRAMを使用した際の高速ページモードの実
現によりメモリ素子の性能をフルに発揮して辞書検索の
高速化を図ることができる。
As explained above, according to the present invention, a linked list using the external hash method is constructed of consecutive addresses in a dictionary search for LZW encoding, so that once one address is determined, it is possible to start by predicting the address, and the dictionary memory For example, by realizing a high-speed page mode when using a DRAM, the performance of the memory element can be fully utilized and dictionary searches can be performed at high speed.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の原理説明図; 第2図は本発明の実施例構成図; 第3図は本発明の辞書検索回路の詳細を示た実施例構成
説明図; 第4図は本発明のLZW符号の検索手順と登録手順の説
明図; 第5図は本発明の辞書登録内容を示すツリー構造図;第
6図は本発明の高速ページモードを使用した場合のDR
AMリードモードのタイミングチャート; 第7図は従来のLZW符号化処理フロー図;第8図は従
来のLZW復号化処理フロー図;第9図はLZW符号化
説明図; 第10図は辞書構成例の説明図; 第11図はLZW符号化説明図; 第12図は外部ハツシュ法のリスト構造説明図;第13
図は外部ハツシュ法を利用した従来のLZW符号化処理
フロー図; 第14図は第13図のLZW符号の検索手順と登録手順
の説明図; 第15図は第14図の辞書登録内容を示たツリー構造図
; 第16図は高速ページモードが使用出来ないDRAMリ
ードモードのタイミングチャートである。 図中、 10:原データ 12 : DMA制御回路 14:MPU 16:辞書検索手段(辞書検索回路) 18:複数文字読込み回路 18−1:アドレスレバスタ 18−2.18−3:レジスタ 20:辞書メモリ 22ニ一致検査回路 22−1 :レジスタ 22−2:比較器 24:連結検出回路 24−1:NOR回路 26:パイプライン制御回路 28:連続アドレス回路 28−1 :カウンタ 30:入出力回路 100・ファーストメモリ 200ネクストメモリ 300;拡張メモリ
FIG. 1 is a diagram explaining the principle of the present invention; FIG. 2 is a configuration diagram of an embodiment of the invention; FIG. 3 is a diagram illustrating the configuration of an embodiment showing details of the dictionary search circuit of the invention; FIG. An explanatory diagram of the LZW code search procedure and registration procedure; Figure 5 is a tree structure diagram showing the dictionary registration contents of the present invention; Figure 6 is the DR when using the high-speed page mode of the present invention.
Timing chart of AM read mode; Figure 7 is a conventional LZW encoding process flow diagram; Figure 8 is a conventional LZW decoding process flow diagram; Figure 9 is an explanatory diagram of LZW encoding; Figure 10 is a dictionary configuration example Fig. 11 is an explanatory diagram of LZW encoding; Fig. 12 is an explanatory diagram of the list structure of the external hash method;
The figure is a flowchart of conventional LZW encoding processing using the external hash method; Figure 14 is an explanatory diagram of the LZW code search procedure and registration procedure of Figure 13; Figure 15 shows the dictionary registration contents of Figure 14. Figure 16 is a timing chart of the DRAM read mode in which the high-speed page mode cannot be used. In the figure, 10: Original data 12: DMA control circuit 14: MPU 16: Dictionary search means (dictionary search circuit) 18: Multiple character reading circuit 18-1: Address register 18-2.18-3: Register 20: Dictionary Memory 22: Coincidence check circuit 22-1: Register 22-2: Comparator 24: Connection detection circuit 24-1: NOR circuit 26: Pipeline control circuit 28: Continuous address circuit 28-1: Counter 30: Input/output circuit 100・First memory 200 Next memory 300; Expansion memory

Claims (3)

【特許請求の範囲】[Claims] (1)符号化済みデータを相異なる部分列に分けて各部
分列毎に異なる参照番号を付加して辞書に登録しておき
、入力データを該辞書中の部分列の内、最大長一致する
部分列の参照番号で指定して符号化するデータ圧縮装置
に於いて、 外部ハッシュ法のリスト構造に従ったファーストメモリ
((100)及び拡張メモリ(300)を有するネクス
トメモリ(200)を備え、入力データに基づく外部ハ
ッシュアドレスの連結アドレスを、部分的に前記ネクス
トメモリ(200)の連続アドレスで構成した辞書メモ
リ(20)と; 前記入力データに基づいて前記ネクストメモリ(200
)のアドレスを連続的に発生して入力データに一致する
前記拡張メモリ(300)の候補データを検索する辞書
検索手段(16)と; を備えたことを特徴とするデータ圧縮装置の辞書検索方
式。
(1) Divide the encoded data into different subsequences, add a different reference number to each subsequence, and register it in a dictionary, and match the input data with the maximum length among the subsequences in the dictionary. A data compression device that specifies and encodes a subsequence using a reference number, comprising a next memory (200) having a first memory (100) and an extended memory (300) according to a list structure of an external hash method, a dictionary memory (20) in which concatenated addresses of external hash addresses based on the input data are partially composed of consecutive addresses of the next memory (200);
) for searching candidate data in the extended memory (300) that matches input data; .
(2)請求項1記載のデータ圧縮装置の辞書検索方式に
於いて、 前記辞書検索手段(16)は、入力データと候補データ
の一致検査、候補データの有無、次の候補データの読出
しを平行して行うパイプライン制御手段(26)を備え
たことを特徴とするデータ圧縮装置の辞書検索方式。
(2) In the dictionary search method of the data compression device according to claim 1, the dictionary search means (16) performs a match check between the input data and candidate data, the presence or absence of candidate data, and the reading of the next candidate data in parallel. A dictionary search method for a data compression device, characterized in that it is equipped with a pipeline control means (26) for performing the following operations.
(3)請求項1記載のデータ圧縮装置の辞書検索方式に
於いて、 前記辞書メモリ(20)のアクセスモードとして高速ペ
ージモードを使用することを特徴とするデータ圧縮装置
の辞書検索方式。
(3) A dictionary search method for a data compression device according to claim 1, wherein a high-speed page mode is used as an access mode for the dictionary memory (20).
JP2251499A 1990-09-20 1990-09-20 Dictionary search method for data compression equipment Expired - Fee Related JP3038234B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2251499A JP3038234B2 (en) 1990-09-20 1990-09-20 Dictionary search method for data compression equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2251499A JP3038234B2 (en) 1990-09-20 1990-09-20 Dictionary search method for data compression equipment

Publications (2)

Publication Number Publication Date
JPH04129429A true JPH04129429A (en) 1992-04-30
JP3038234B2 JP3038234B2 (en) 2000-05-08

Family

ID=17223718

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2251499A Expired - Fee Related JP3038234B2 (en) 1990-09-20 1990-09-20 Dictionary search method for data compression equipment

Country Status (1)

Country Link
JP (1) JP3038234B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006332982A (en) * 2005-05-25 2006-12-07 Sony Corp Decoder circuit and decoding method
WO2014106782A1 (en) * 2013-01-03 2014-07-10 International Business Machines Corporation High bandwidth compression to encoded data streams

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006332982A (en) * 2005-05-25 2006-12-07 Sony Corp Decoder circuit and decoding method
JP4586633B2 (en) * 2005-05-25 2010-11-24 ソニー株式会社 Decoder circuit, decoding method, and data recording apparatus
WO2014106782A1 (en) * 2013-01-03 2014-07-10 International Business Machines Corporation High bandwidth compression to encoded data streams
GB2521082A (en) * 2013-01-03 2015-06-10 Ibm High bandwidth compression to encoded data streams
JP2016506197A (en) * 2013-01-03 2016-02-25 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Method for pipelined compression of multi-byte frames, apparatus for high bandwidth compression into an encoded data stream, and computer program product

Also Published As

Publication number Publication date
JP3038234B2 (en) 2000-05-08

Similar Documents

Publication Publication Date Title
US5150430A (en) Lossless data compression circuit and method
JP3225638B2 (en) Apparatus and method for compressing data and data processing system
JP3303225B2 (en) Data compression device using Lempel-Ziv type algorithm
JPH07200247A (en) Equipment and method for data compression
JPH04129429A (en) Dictionary retrieval system for data compressor
JP3038233B2 (en) Data compression and decompression device
JP2952067B2 (en) Data compression method
JP2952068B2 (en) Data compression and decompression method
JPH05152971A (en) Data compressing/restoring method
JP2774350B2 (en) Data compression method and data restoration method of compressed data
JP3236747B2 (en) Data decompression method
US20240106459A1 (en) Compression device and compression method
JP3115066B2 (en) Dictionary search method
JP3103172B2 (en) Dictionary search method
JP3555506B2 (en) Character string data compression encoding device, character string data decompression device, and character string data arithmetic processing device
JPH04167821A (en) Data coding and decoding method
JP3105330B2 (en) Image data compression / decompression method
JPH09232967A (en) Data compressing device and restoring device
JPH04145726A (en) Data compression and restoring system
JP3058711B2 (en) Data compression and decompression method
JP3186530B2 (en) How to compress and expand computer data
JP2825960B2 (en) Data compression method and decompression method
JPH03270416A (en) Data compressing and decoding system
JPH05252049A (en) Data compression processing system and data decoding processing system
JP3083329B2 (en) Data compression / decompression method

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees