JP3835489B2 - Data compression apparatus and decompression apparatus dictionary search registration method - Google Patents

Data compression apparatus and decompression apparatus dictionary search registration method Download PDF

Info

Publication number
JP3835489B2
JP3835489B2 JP02506696A JP2506696A JP3835489B2 JP 3835489 B2 JP3835489 B2 JP 3835489B2 JP 02506696 A JP02506696 A JP 02506696A JP 2506696 A JP2506696 A JP 2506696A JP 3835489 B2 JP3835489 B2 JP 3835489B2
Authority
JP
Japan
Prior art keywords
dictionary
search
input
characters
hash value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP02506696A
Other languages
Japanese (ja)
Other versions
JPH09218877A (en
Inventor
佳之 岡田
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 JP02506696A priority Critical patent/JP3835489B2/en
Publication of JPH09218877A publication Critical patent/JPH09218877A/en
Application granted granted Critical
Publication of JP3835489B2 publication Critical patent/JP3835489B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、入力文字列と辞書に既に登録した文字部分列との最長一致検索により符号化を行うデータ圧縮装置及び復元装置の辞書検索登録方法に関し、特に複数の入力文字と登録済文字列から内部ハッシュによりインデックスを生成して辞書を検索登録するデータ圧縮装置および復元装置の辞書検索登録方法に関する。
【0002】
【従来の技術】
近年、文字コード、ベクトル情報、画像など様々な種類のデータがコンピュータで扱われるようになっており、扱われるデータ量も急速に増加してきている。大量のデータを扱うときは、データの中の冗長な部分を省いてデータ量を圧縮することで、記憶容量を減らしたり、速く伝送したりできるようになる。
【0003】
様々なデータを1つの手順でデータ圧縮できる方法としてユニバーサル符号化が提案されている。ここで、本発明の分野は、文字コードの圧縮に限らず、様々なデータに適用できるが、以下では、情報理論で用いられている呼称を踏襲し、データの1ワード単位を文字と呼び、データが任意の複数ワードにつながったものを文字列と呼ぶことにする。
【0004】
ユニバーサル符号の代表的な方法として、ジブ・レンペル(Ziv-Lempel)符号がある(詳しくは、例えば、宗像「Ziv-Lempelのデータ圧縮法」、情報処理、Vol.26,No.1,1985年を参照のこと)。
ジブ・レンペル符号には、スライド辞書法と、動的辞書法(Incremental
parsing)の2つのアルゴリズムが提案されている。さらに、スライド辞書型アルゴリズムの改良として、LZSS符号がある(T.C. Bell,"Better OPM/L TextCompression",IEEE Trans. on Commun., Vol.COM-34,No.12, Dec. 1986参照)。
【0005】
また動的辞書型アルゴリズムの改良としては、LZW(Lempel-Ziv-Welch)符号がある(T.A. Welch,"A Technique for High-Performance Data Compression",Computer, June 1984参照)。これらの符号のうち、高速処理ができることと、アルゴリズムの簡単さからLZW符号が記憶装置のファイル圧縮などで使われるようになっている。
【0006】
図23にLZW符号における辞書の木構成を示し、図24にLZW符号における文字列の符号化を示す。LZW符号化は、書き替え可能な辞書を持ち、入力文字列(ソースデータ)中を相異なる文字列に分け、この文字列を出現した順に番号をつけて辞書に登録すると共に、現在入力している文字列を辞書に登録してある最長一致文字列の番号で表して、符号化するものである。
【0007】
図25はLZW符号化処理の具体例であり、説明を簡単にするため、a,b,cの3文字の場合を例にとっている。このため符号化に使用する図26の辞書には、文字a,b,cの各々が初期登録されている。
図25において、入力データは左から右へ読み込む。最初の文字aを入力したとき、辞書には文字aの他に一致する文字列がないので、参照番号(インデックス)を符号語として出力する。そして、拡張した文字列abに参照番号4をつけて辞書に登録する。実際の登録は文字列(1b)の形となる。
【0008】
続いて2番目の文字bが文字列の先頭になる。辞書には文字bの他に一致する文字列がないので、参照番号2を符号語として出力し、拡張した文字列baを実際には2aの形で参照番号5をつけて辞書に登録する。3番目の文字aが次の文字列の先頭になる。以下、同様にこの処理を続ける。
図27のフローチャートは、LZW符号化のアルゴリズムである。まずステップS1で予め全文字につき1文字からなる文字列を初期値として辞書に登録してから符号化を始める。ステップS2では入力した最初の文字Kを辞書検索の参照番号(インデックス)ωとし、これを語頭文字列(prefix string )とする。次にステップS3で入力データの次の文字Kを読み込み、ステップS4ではステップS2で求めた語頭文字列ωにステップS3で読み込んだ文字Kを加えた文字列(ωK)が現在の辞書にあるか否か検索する。
【0009】
ステップS4で文字列(ωK)が辞書にあれば、ステップS5で文字列(ωK)を参照番号ωに置き換え、ステップS5で入力データが終了かどうかを判断した後、再びステップS3に戻って文字列(ωK)が辞書から探せなくなるまで最大一致長の検索を続ける。
次にステップS4で文字列(ωK)が辞書になければ、ステップS7に進んで、ステップS2で求めた文字Kの参照番号ωを符号語code(ω)として出力し、また文字列(ωK)に新たな参照番号を付加して辞書に登録し、さらにステップS2の入力文字Kを参照番号ωに置き換えるとともに、辞書アドレスNをインクリメントして、ステップS5のチェックを受けた後、ステップS2に戻って次の文字Kを読み込む。
【0010】
図28はLZW復号化処理の具体例であり、説明を簡単にするため、a,b,cの3文字の組み合わせを例にとっている。まず最初の入力符号は1であり、1文字a,b,cについては、図26のように既に参照番号1,2,3として辞書に登録されているため、辞書の参照により符号1に一致する参照番号の文字列aに置き換えて出力する。
【0011】
次の符号2についても同様にして文字bに置き換えて出力する。このとき前回処理した符号1と今回復号した最初の1文字bとを組み合わせた(1b)に新たな参照番号4を付加して辞書に登録する。3番目の符号4は辞書の探索により1bからabと置き換えて文字列abを出力する。同時に前回処理した符号2と今回復号した文字列の1番目の文字aとの組み合わせ文字列2a(=ba)を新たな参照番号5を付加して辞書に登録する。以下同様に、この処理を繰り返す。
【0012】
ここで、図28の復号化には次の例外処理がある。この例外処理は、第6番目の入力符号8の復号で生ずる。符号8は復号時に辞書に定義されておらず、復号できない。この場合には、前回処理した符号5に前回復号した文字列baの最初の一文字bを加えた文字列5bを求め、更に2ab,babと置き換えられて出力される。そして、文字列の出力語に前回の符号語5に今回復号した文字列の文字bを加えた文字列5bに参照番号8を付加して辞書に登録する。
【0013】
この例外処理は図29の復号化処理フローのステップS4,ステップS9の処理を通じて行われ、最終的にステップS7で文字列の出力と新たな文字列に参照番号を付加した辞書への登録が行われる。
図29のフローチャートは、LZW復号化のアルゴリズムであり、図27の符号化の逆の操作を行う。まずステップS1において符号化と同様に予め辞書に全文字につき1文字からなる文字列を初期値として登録してから復号を始める。ステップS2で最初の符号(参照番号)を読み込み、現在のCODEをOLDcode とし、最初の符号は既に辞書に登録された一文字の参照番号いずれかに該当することから、入力符号CODEに一致する文字code(K)を探し出し、文字Kを出力する。尚、出力した文字(K)は後の例外処理のためcharにセットしておく。
【0014】
次にステップS3に進んで次の符号を読み込んでCODEにNEWcode としてセットする。次にステップS4に進み、ステップS3で入力された符号CODEが辞書に定義(登録)されているか否かチェックする。通常、入力した符号語は前回までの処理で辞書に登録されているため、ステップS5に進んで符号CODEに対応する文字列code(ωK)を辞書から読み出し、ステップS6で文字列Kを一時的にスタックし、参照番号code(ω)を新たなCODEとして再度ステップS5に戻し、このステップS5,ステップS6の手順を再帰的に参照番号ωが一文字に至るまで繰り返す。
【0015】
最後にステップS7に進んで、ステップS6でスタックした文字をLILO (Last In Fast Out)形式でポップアップして出力する。同時にステップS7において、前回使った符号ωと今回復元した文字列の最初の一文字Kを組(ω,K)と表した文字列に新たな参照番号を付加して辞書に登録する。
尚、ステップS4において登録されていない符号であった(符号化において直前の参照番号を参照する場合におきる)場合、ステップS9にて、OLDcode を CODEに、code(OLDcode,char)をNEWcode に戻した後にステップS5へ進むようにする。また図28の第6番目の入力符号8の復号を生ずる例外処理は、ステップS4,ステップS9の処理を通じて行われ、最終的にステップS7で文字列の出力と新たな文字列に参照番号を付加した辞書への登録が行われる。
【0016】
【発明が解決しようとする課題】
しかしながら、このような従来のLZW符号等を用いたデータ圧縮及び復元の処理にあっては、辞書に対する文字登録が1バイト単位に行われており、このため符号化又は復号化における辞書検索が1バイトずつしか行うことができず、辞書の検索及び登録に時間がかかる問題があった。
【0017】
この問題を具体的に説明すると次のようになる。図30は、従来のデータ圧縮処理における辞書の検索登録のブロックであり、複数入力部100、単数入力一致検出部102、単数入力登録部104及び辞書メモリ106で構成されている。
図31は図30における辞書検索処理である。いま第1番目の文字K1を入力すると、辞書メモリ106の登録で実現されている木構造の接点アドレスを示すインデックスωと入力文字K1をステップS1で組み合せ、ステップS2で内部ハッシュによってハッシュ値H(ω,K1)を求め、ステップS3でハッシュ値H(ω,K1)をインデックスとして辞書メモリ106の検索を行う。
【0018】
この辞書検索によって辞書メモリ106から読み出したインデックスω’と文字K1’が、ハッシュ値の生成に使用したインデックスωと文字K1に各々一致するかどうかをステップS5で比較する。両者の一致を検出すると、ステップS1に戻って新たなインデックスと次の文字で新ハッシュ値を作り、辞書検索を繰り返す。
【0019】
一致しない場合は、ステップS6でリハッシュ関数の定義に従ってリハッシュ値を求めて、インデックスωと文字K1に各々一致するまで辞書検索を繰り返す。最初のハッシュ値による検索で辞書登録がなかったり、又はリハッシュ値による検索で辞書登録がなかった場合には、ステップS4で符号化及び辞書の登録を行う。
【0020】
このような従来の辞書検索は、入力した文字の1バイト単位にハッシュ処理及びリハッシュ処理を伴う辞書の検索処理と登録処理を行わなければならないため、辞書の検索登録に時間がかかる問題があった。
本発明は、このような従来の問題点に鑑みてなされたもので、辞書の検索と登録を高速化して処理時間を短縮できるようにしたデータ圧縮装置及び復元復元の辞書検索登録方法を提供することを目的とする。
【0021】
【課題を解決するための手段】
図1は本発明の原理説明図である。データ圧縮装置を例にとると、本発明は、図1(A)のように、入力される文字列と辞書16に既に登録した文字部分列との最長一致検索により符号化を行うデータ圧縮復元に用いる辞書検索登録方法として、複数入力検索手段10で、予め定めた数の複数の入力文字(K1,K2,・・・Kn)と既に検索された辞書に登録済文字列を示すインデックス(ω)から内部ハッシュによってハッシュ値H(ω,K1,K2,・・・Kn)を生成し、次に複数入力一致検出手段12でハッシュ値をインデックスとして複数の入力文字(K1,K2,・・・Kn)を対象に辞書16の検索を行う。この検索により文字列の登録が無ければ、複数入力登録手段14で文字列(ω,K1,K2,・・・Kn)の辞書16への登録を行う。
【0022】
ここで、複数の入力文字の数をnとした場合、インデックスで表わされた既に検索済みの文字列ωに続く文字数毎に設けたn個の辞書、即ち(ω、K1)、 (ω,k1,K2)、・・・(ω,K1,K2,・・Kn)毎に設けたn個の辞書を、内部ハッシュにより生成した文字数毎のハッシュ値H(ω、K1)、H (ω,k1,K2)、・・・H(ω,K1,K2,・・Kn)により、同時に辞書検索する。
【0023】
また内部ハッシュのハッシュ関数として、複数の入力文字と既に検索された辞書に登録済文字列のインデックスの排他的論理和をとる。この場合、ハッシュ値の各ビットが均等且つ対称となるように、複数の入力文字と辞書のインデックスとの排他的論理和を求める。ここで、複数の入力文字と辞書のインデックスとのビット数が相違して排他的論理和を求める各ビットが均等且つ対称とならない場合には、上位ビット側で排他的論理和を求めるようにビット配置する。
【0024】
また本発明は、入力される文字列Kと、辞書に既に登録した文字部分列との最長一致検索により符号化を行うデータ圧縮装置の辞書検索登録方法について、図1(B)のように、ハッシュ値発生手段20によって、予め定めた数の複数の入力文字(K1,K2,・・・Kn)と既に検索された辞書に登録済文字列を示すインデックス(ω)から内部ハッシュによってハッシュ値H(ω,K1,K2,・・・Kn)を生成し、次に辞書検索手段22によって、複数入力一致検出手段12でハッシュ値をインデックスとして複数の入力文字(K1,K2,・・・Kn)を対象に辞書16の検索を行い、更に、一致/不一致検出手段24によって辞書検索で不一致を検出した際に、リハッシュ手段26で生成するリハッシュ値として、最初のハッシュ値に対応した乱数列を順に発生して再度辞書を検索する。
【0025】
このリハッシュ値としては、最初のハッシュ値を拡大ガロア体GF(2m )上の1つの元(αi )とし、この元(αi )に同じ拡大ガロア体GF(2m )上の全ての元(α1 ,α2 ,・・・・α2**m-1)とから拡大ガロア体上での排他的論理和により乱数列を順に発生させる。
具体的には、拡大ガロア体GF(2m )上の全ての元(α1 ,α2 ,・・・・α2**m-1)を、1つ前に生成した元(αi-1 )と原始元(α1 )との拡大ガロア体上での累積乗算により順に発生させる。
【0026】
更に、2m 個の状態に対応して2m 個が連なる相異なる乱数列を、2m 個の状態を拡大ガロア体GF(2m )上の元(α)として捉え、この元(α)の値と原始元(α1 )の拡大ガロア体上の累積乗算により順に発生させる。
更に本発明はデータ復元装置の辞書検索登録方法を提供する。データ復元装置は、予め定めた複数文字を入力する毎に、インデックスで表わされた既に検索済みの文字列に続く複数の入力文字から内部ハッシュによってハッシュ値を生成し、このハッシュ値により前記複数の入力文字を対象に前記辞書の検索及び登録を行って得られた圧縮データから文字列を復元する。
【0027】
このようなデータ復元装置につき本発明の辞書検索登録方法は、入力された符号から辞書の検索により文字列を復元する毎に、入力符号に続くすでに復元された複数の入力文字から内部ハッシュによってハッシュ値を生成し、このハッシュ値により、複数の復元文字を対象に辞書の登録を行う。
またデータ復元時のリハッシュによる辞書の再登録として、本発明の辞書検索登録方法は、入力された符号から辞書の検索により文字列を復元する毎に、入力符号に続くすでに復元された複数の入力文字から内部ハッシュによってハッシュ値を生成し、このハッシュ値により、複数の復元文字を対象に辞書の登録を行った際に、既に同じハッシュ値を使用した辞書の登録済みを検出した場合に、最初のハッシュ値に対応した乱数列を順に発生して再度辞書に登録する。
【0028】
このように本発明は、複数文字(複数バイト分の文字)を一括した辞書の検索と登録ができることで、データ圧縮及び復元における辞書の検索登録時間が短くて済み処理時間を短縮できる。特に、本発明の内部ハッシュでは、複数文字(K1 〜Kn )を同時検索することで処理時間を短縮する。具体的には、1バイトからnバイトの各バイト数単位毎に入力検索手段10及び一致検出手段12を設けて並列的に同時動作させることで、高速化を図る。
【0029】
また本発明によれば、内部ハッシュのデータ構造を用いることで、辞書メモリの高速検索と登録を可能とする。更に、リハッシュ値として拡大ガロア体の元を用いることで、最初のハッシュ値に対応して全く異なるリハッシュ値を発生させることができ、内部ハッシュの衝突を極力避ける効果がある。
【0030】
【発明の実施の形態】
図2は本発明の辞書検索登録方法の基本概念を示すブロック図であり、データ圧縮装置を例にとっている。本発明の辞書検索登録方法を採用したデータ圧縮装置は、予め定めた複数の入力文字を検索する複数入力検出部10、複数の入力文字と検索された複数文字の一致検出を行う複数入力一致検出部12、複数の入力文字を一度に登録する複数入力登録部14、及び複数文字の検索と登録が可能な辞書メモリ16で構成される。このように複数文字を一括して検索及び登録することで、処理時間を短縮することができる。
【0031】
図3は、図2のデータ圧縮装置における複数文字を一括して行う辞書の検索と登録の処理である。まず複数入力検索部10にあっては、ステップS1に示すように、予め定めたn個の文字K1,K2,・・・Knと既に登録済みの文字列を示す木構造の節点アドレス(インデックス)ωの組合わせ(ω,K1,K2,・・・Kn)を複数入力文字として、ステップS2のように内部ハッシュ構造によって所定のハッシュ関数に従ったハッシュ値H(ω,K1,K2,・・・,Kn)を作成する。
【0032】
このように作成したハッシュ値を使用して辞書メモリ16の辞書検索を行い、辞書メモリ16の検索で得られた(ω´,K1´,K2´,・・・Kn´)がステップS1の複数入力文字における(ω,K1,K2,・・・Kn)のそれぞれと一致するか否か、ステップS3で比較する。即ち、複数入力一致検出部12で一致検出を行う。
【0033】
ここで辞書検索内容と複数入力文字が全て一致していた場合には、ステップS4で一致検出を判別して、新たに得られた辞書の節点アドレス(インデックス)と次のn個の入力文字を複数入力文字として同様な辞書検索を行う。
一方、ステップS3の辞書検索結果の一致検出で不一致となった場合には、ステップS4からステップS5に進み、予め定めたハッシュ関数定義に従ってリハッシュ値を作成し、ステップS2でリハッシュ値を用いた辞書検索を行う。
【0034】
最初の複数入力文字によるハッシュ値あるいはリハッシュ値による辞書検索により、ステップS3でハッシュ値に対応する登録内容が辞書から検索できなかった場合、即ち辞書メモリ16にハッシュ値に対応する登録が存在しなかった場合には、検出無しとしてステップS6に進み、このときのハッシュ値またはリハッシュ値をインデックスとして複数文字の辞書メモリ16に対する一括登録を行う。
【0035】
図4は1バイト構成のn個の文字を複数入力する場合の図2の複数入力検索部10、複数入力一致検出部12の並列処理構成のブロック図である。即ち、複数入力検索部10は、1バイト検索部10−1、2バイト検索部10−2、・・・,nバイト検索部10−nの並列構成となる。また複数入力一致検出部12は、一致/不一致検出部12−1,12−2,・・・,12−nの並列構成となる。そして、総合一致/不一致判断部30により各バイトごとの一致/不一致検出部12−1の検出結果の総合的な一致または不一致の判断を行う。
【0036】
図5は、LZW符号の木構造から見た本発明の複数文字を一括して辞書の検索と登録を行う場合の辞書の検索及び登録範囲を示している。この木構造にあっては、3バイト分の複数文字を検索登録する場合であり、先頭の1文字目を木構造の節点アドレス(インデックス)ωとすると、木構造の2文字目は辞書16−1に登録され、3文字目までは辞書16−2に登録され、4文字目までは辞書16−3に登録され、それぞれの辞書16−1,16−2,16−3から先頭1文字目の節点アドレス(インデックス)ωに続くそれぞれの複数文字を検索する。
【0037】
更に、木構造の5文字目は辞書16−1に登録され、図示していないが木構造の6文字目までは辞書16−2に登録され、更に7文字目までは辞書16−3に登録されるという形で繰り返される。
この図5のような例えば3バイトまでの複数文字を検索登録するための辞書構造について、図4に示した並列処理のハードウェアを使用することで、各辞書16−1,16−2,16−3の辞書検索を同時に効率的に行うことができる。またソフトウェアにあっては逐次処理となるが、この場合には文字数の多い辞書16−3,16−2,16−1の順に辞書検索を進めることで、より効率的な辞書検索が実現できる。
【0038】
図6は図5の3バイト分の複数文字の検索と登録を内部ハッシュにより行う場合のブロック図である。まず1バイト入力検索部10−1は、ハッシュ値発生部11−1と1バイト目までの1文字を登録した辞書メモリ16−1から構成される。この1バイト入力検索部10−1における1バイト検索では、検索したいインデックスω1と入力した1文字K1からハッシュ関数H(ω1,K1)に基づいてハッシュ値を作成し、ハッシュ値として作成されたアドレスにより辞書メモリ16−1を検索する。
【0039】
辞書メモリ16−1には登録の有無を示すフラグFが設けられ、フラグFがセット状態にあるときにはインデックスωと文字Kが登録されている。この場合、ハッシュ関数H(ω1,K1)によるハッシュ値をアドレスとして辞書メモリ16−1を検索することで、フラグFのセットで登録の存在を検出し、同時にインデックスω1´と1文字K1´が読み出される。
【0040】
1バイト入力一致検出部12−1は比較部13−11を有し、辞書メモリ16−1から読み出したフラグFがリセット即ちF=0であるか否か検出し、検出無判断部15−11から検出無しの出力▲1▼を生ずる。また比較部13−12で入力したインデックスω1と辞書から読み出したインデックスω1´を比較し、同時に比較部13−13で入力した1文字K1と辞書から読み出した1文字K1´を比較する。
【0041】
この比較結果は一致/不一致判断部15−12に与えられ、不一致であればリハッシュ値を生成して再度、辞書メモリ16−1の検索を行う。一致していれば一致出力▲4▼を下側に示す総合一致/不一致判断部17−2に出力する。
次の2バイト入力検索部10−2は、ハッシュ値発生部11−2で検索したいインデックスω1と2バイト目までの2文字K1,K2からハッシュ値H(ω1,K1,K2)を作成し、そのアドレスで辞書メモリ16−2を検索する。この辞書検索により得られたフラグF、インデックスω1´、文字K1´,K2´のそれぞれを、2バイト一致検出部12−2に設けた比較部13−21,13−22,13−23,13−24で比較する。
【0042】
このときフラグFがF=0であれば、検出無判断部15−21より下側の総合検出無判断部17−1に対し検出無しの出力▲2▼を出す。また比較部13−22〜13−24で読み出した(ω1´,K1´,K2´)を、入力した(ω1,K1,K2)とそれぞれ比較し、一致/不一致判断部15−22で判断し、不一致であればリハッシュ値を生成して辞書メモリ16−2の再検索を行い、一致していれば下側の総合一致/不一致判断部17−2に対し一致出力▲5▼を生ずる。
【0043】
更に3バイト入力検索部10−3にあっては、ハッシュ値発生部11−3で検索したいインデックスω1と3バイト目までの3文字(K1,K2,K3)からハッシュ値H(ω1,K1,K2,K3)を作り、そのアドレスで辞書メモリ16−3を検索する。この場合、3バイト目の辞書には図5の木構造から明らかなように、登録の存在の有無を示すと同時に次に続くインデックスω4が登録されている。
【0044】
これを3バイト一致検出部12−3の比較部13−31に入力して、もしω4=0であれば検出無判断部15−31でアドレスに対応する登録無しとして、下側の総合検出無判断部17−1に検出無しの出力▲3▼を生ずる。ω4が0以外の有効値、即ち適宜の後続するインデックスの値をとっている場合には、辞書メモリ16−3よりインデックスω1´、文字K1´,K2´,K3´がそれぞれ得られ、ハッシュ値の作成に使用したインデックスω1及び入力文字K1,K2,K3のそれぞれとの比較が行われ、比較結果に基づき一致/不一致判断部15−32が出力▲6▼を下側の総合一致/不一致判断部17−2に出力する。
【0045】
総合検出無判断部17−1及び総合一致/不一致判断部17−2は、3つの辞書メモリ16−1〜16−3からの検出の有無及び一致/不一致の判断結果から、辞書検索を中止するか継続するかを決める。即ち、全ての辞書メモリ16−1〜16−3に検出有りで且つ辞書検索結果が一致と判断した場合には、辞書検索を継続するためインデックスω1をω4に置き換えて、検索続行のフィードバックとして各バイトのハッシュ値発生部11−1,11−2,11−3に供給し、同様の動作を行う。
【0046】
この検索続行条件が満たされなかった場合には、辞書メモリ16−1〜16−3の辞書登録を行う。即ち、全ての辞書メモリ16−1〜16−3で検出無しの場合は、辞書メモリ16−1に対する1文字の登録を行う。また辞書メモリ16−1で検出有り、辞書メモリ16−2,16−3で検出無しの場合には、辞書メモリ16−2,16−3に対する2文字目の登録を行う。更に辞書メモリ16−1,16−2で検出有り、辞書メモリ16−3で検出無しの場合には、辞書メモリ16−3に3文字目の登録を行う。
【0047】
図7,図8,図9は、図6の1〜3バイトごとのハッシュ値発生部11−1〜11−3における複数バイト検索でのハッシュ値の発生法の実施形態である。この実施形態にあっては、インデックスωを16ビット、各文字K1,K2,K3を各々8ビット、ハッシュ値Hを16ビットとした場合を例にとっている。
図7は1バイト検索の場合であり、レジスタ32の文字Kの8ビットとレジスタ34のインデックスω1の16ビットの内の上位8ビットとの排他的論理和EXORをとって16ビットのハッシュ値Hの上位8ビットとし、下位8ビットはレジスタ34のインデックスω1の下位8ビットをそのまま使う形をとっている。
【0048】
図8の2バイト検索の場合のハッシュ値の発生は、レジスタ32−1,32−2の2文字K1,K2の各8ビットとレジスタ34のインデックスω1の16ビットの各ビットごとの排他的論理和EXORをとって、16ビットのハッシュ値H(ω1,K1,K2)を作り出している。
更に図9の3バイト検索に使用するハッシュ値の発生は、レジスタ32,36による2文字K1,K2の各8ビットに対するレジスタ40のインデックスω1の16ビットとの排他的論理和EXORをまずとっている。ここでレジスタ40におけるインデックスω1の16ビットのビット配置は、中央に第10〜15の6ビットを位置させ、残り第0〜第9ビットを両側に分けて配置している。
【0049】
更にレジスタ38に3番目の文字K3の8ビットをセットし、レジスタ40の中間の8ビットとの排他的論理和EXORを更にとることで、16ビットのハッシュ値H(ω1,K1,K2,K3)を作り出している。このような3バイト検索の場合のハッシュ値の作成は、生成されるハッシュ値の各ビットが均等且つ対称となるようにインデックスω1、文字K1,K2,K3のビットを配置している。
【0050】
しかし、図9の3バイト検索の場合には、3番目の文字K3が8ビットでインデックスω1が16ビットとビット値が異なることから、この場合には排他的論理和の対称となるビットが16ビットのハッシュ値の上位ビットに反映するようにビット配置を行っている。このようなビット配置により、作成されるハッシュ値の衝突を極力回避することができる。
【0051】
図10,図11,図12は、図7,図8,図9と同様に、1バイト検索,2バイト検索,3バイト検索のそれぞれについて12ビットのハッシュ値を作成する場合を例にとっている。即ち、この場合にはインデックスωが12ビットであり、各文字8ビットから16ビットのハッシュ値を作成している。
この12ビットのハッシュ値にあっては、図10,図11の1バイト検索,2バイト検索については文字とインデックスのビット数に差があるが、図12の3バイト検索については3文字K1,K2,K3の組合せで12ビットのインデックスについて全て3つの排他的論理和EXORとすることができ、12ビットのハッシュ値の各ビットの均等の対称性を完全に保つことができる。
【0052】
具体的には、レジスタ40,46に文字K1,K2を格納すると同時に、文字K3を上下4ビットずつ分けてレジスタ44,46に格納し、各レジスタ44,46を12ビット構成とし、レジスタ48の12ビットのインデックスω1にビット数を一致させている。この結果、インデックスと文字K1,K2,K3から3つのビットを対象に、均等且つ対称に配置した12ビットのハッシュ値H(ω,K1,K2,K3)を作ることができる。
【0053】
図13は、本発明の辞書検索登録方法におけるリハッシュ値の発生方法を実現するブロック図である。即ち、図4及び図5に示したように、本発明の内部ハッシュによる辞書の検索登録にあっては、一致/不一致検出によって不一致が検出された場合にリハッシュ値を発生させて再度、検索を行う。このリハッシュ値を発生させる機能は、図13に示すハッシュ値発生部20、辞書検索部22、一致/不一致検出部24及びリハッシュ部26で構成される内部ハッシュ機構で実現される。
【0054】
図14は、図13における内部ハッシュ法によるリハッシュ値の発生処理の概念であり、1バイト検索を例にとっている。即ち、ハッシュ値発生部20においてインデックスω1と文字K1からハッシュ関数H(ω1,K1)によりハッシュ値を求め、辞書検索部22で辞書メモリ16−1を検索し、存在の有無を示すフラグF及びインデックスω1´と文字K1´を読み出す。
【0055】
続いて一致/不一致検出部24において、比較部13−11でフラグF=0でなく、比較部13−12,13−13によるインデックスと文字の比較で一致/不一致判断部15−12が両者の一致を判断すると、リハッシュ部26を起動してリハッシュ値RHを生成する。このリハッシュ値RHの生成は、一般形としてはリハッシュ関数RHm(H(ω1,K1)),m=1,2,・・・NMAXで決まる乱数列からリハッシュアドレスを順に発生する。
【0056】
図15は図14のリハッシュ部26の具体例であり、ハッシュ値入力部50、演算部52及び排他的論理和回路54で構成される。このリハッシュ部26の構成にあっては、まず最初のハッシュ値をハッシュ値入力部50において拡大ガロア体GF(2**m)の元αと見做す。一方、演算部52にあっては、予め用意した拡大ガロア体GF(2**m)の元α1 ,α2 ,α3 ,・・・αmax (但しmax=2m −1)を生成する。尚、2**mは、2のm乗を示す。
【0057】
そして排他的論理和回路54において、ハッシュ値入力部50より出力されるガロア体上の元αと演算部52より順々に発生される拡大ガロア体上の元αの排他的論理和、即ち拡大ガロア体上での和をとって、これをリハッシュ値とする。もちろん、演算部52における拡大ガロア体上の元の順次発生は、排他的論理和回路52で作成されたリハッシュ値による辞書の検索で、不一致検出となった場合に繰り返される。
【0058】
図16は図15の演算部52の具体例である。演算部52は、拡大ガロア体上の元を順々に発生するもので、拡大ガロア体GF(2m )の原始元αを設定するレジスタ56、拡大ガロア体乗算回路60、拡大ガロア体の単位元αm-1 を初期値として選択し、その後は拡大ガロア体乗算回路60の出力を選択する選択回路58で構成される。
【0059】
ここで拡大ガロア体としてm=4の4次元の2元ベクトルをもつ場合を例にとると、この場合、拡大ガロア体はGF(24 )で表わすことができる。これらの元はαのべき乗で表現される。この場合の元αの数は24 個=16個であり、元は0,α0 =1,α1 ,α1 ,・・・α14,α15となる。この元αは原始多項式と呼ばれる式の根から求めることができ、原始元と呼ばれる。
【0060】
即ち、ガロア体GF(24 )の原始多項式は、
f(x)=x4 +x+1
で表現することができる。
図17は、ガロア体GF(24 )におけるi=0〜15個の元に対する4次元のベクトル表現(X3 ,X2 ,X2 ,X0 )とべき乗表現0,α1 〜α5 の関係を表わしている。i=0は零元と呼ばれ、i=1〜14がそれぞれ原始元となり、これはべき乗表現でα1 〜α14で表わされる。更にi=15は単位元と呼ばれ、べき乗表現でα15となり、これはα0 に等しい。
【0061】
図15のハッシュ値入力部50にあっては、例えばハッシュ値入力が1バイト構成で8ビットであったとすると、4バイト単位に分けたハッシュ値X3 〜X0 について、iで表現される元の値を、ハッシュ値を拡大ガロア体上の元として出力する。また図16のレジスタ56にあっては、拡大ガロア体GF(24 )の開始元α1 をPとして拡大ガロア体乗算回路60にセットする。また選択回路58は、初期値として拡大ガロア体GF2m の単位元α15を選択してPQとして、拡大ガロア体乗算回路60に出力している。
【0062】
拡大ガロア体乗算回路60は図18に示す論理回路である。即ち、レジスタ56からの開始元α1 としての入力Pと選択回路58で選択された入力Qの各4ビットについて図示の論理演算を行い、最終的にEXORにおいて原始多項式f (x)=x4 +x+1の剰余を求めて、これを拡大ガロア体上の元を表わす値Rとして順々に出力する。
【0063】
m=4としたときの拡大ガロア体GF(24 )で発生できるリハッシュ値の最大アドレスは、オールビットが1となったときの原始多項式より
f(2)=24 +2+1=19
となる。
更に図18の拡大ガロア体乗算回路60及び図15に示した排他的論理和で実現される拡大ガロア体上での加算は、図19の和の結合表に従って行われる。また図18の拡大ガロア体乗算回路60におけるAND回路による乗算は、図20の積の結合表に従って行われる。
【0064】
本発明におけるリハッシュ値を生成するための拡大ガロア体としては、m=4以外に更に大きな値をとることができる。図21は、m=12とした拡大ガロア体GF(212)における元とリハッシュ値の関係を一部について表わしている。拡大ガロア体GF(212)の原始多項式は、
f(x)=x12+x6 +x4 +x+1
で与えられる。この場合のオールビット1となるときのリハッシュ値の最大アドレスは4179である。また図21のリハッシュ値にあっては、0,1,2,・・・,8,9,a,b,・・・,e,fの16進表示としている。
【0065】
図22は、m=16とした場合の拡大ガロア体GF(216)における元とリハッシュ値の関係を一部について示している。拡大ガロア体GF(216)における原始多項式は、
f(x)=x16+x6 +x4 +x+1
で与えられる。このときオールビット1となるリハッシュ値の最大アドレスは65619となる。
【0066】
以上の実施例は、データ圧縮装置での辞書検索登録方法を例にとるものであったが、このデータ圧縮装置で得られた圧縮データから元の文字列を復元するデータ復元装置についても、同じ辞書の登録方法が適用される。
即ち、本発明の辞書検索登録方法を採用するデータ復元装置は、予め定めた複数文字を入力する毎に、インデックスで表わされた既に検索済みの文字列に続く複数の入力文字から内部ハッシュによってハッシュ値を生成し、このハッシュ値により前記複数の入力文字を対象に前記辞書の検索及び登録を行って得られた圧縮データから文字列を復元する。
【0067】
このようなデータ復元装置につき本発明の辞書検索登録方法は、入力された符号ωから辞書メモリの検索により文字列を復元する毎に、入力符号ωに続くすでに復元された複数の文字(K1,K2,K3,・・・Kn)から内部ハッシュによってハッシュ値H(ω,K1,K2,K3,・・・Kn)を生成し、このハッシュ値により、複数の復元文字(ω,K1,K2,K3,・・・Kn)を対象に辞書の登録を行う。
【0068】
この複数文字単位の復元については、図2〜図12の圧縮時と同じ辞書の登録方法がそのまま適用される。
またデータ復元時のリハッシュによる辞書の再登録として、本発明の辞書検索登録方法は、入力された符号ωから辞書の検索により文字列を復元する毎に、入力符号に続くすでに復元された複数の文字(K1,K2,K3,・・・Kn)から内部ハッシュによってハッシュ値H(ω,K1,K2,K3,・・・Kn)を生成し、このハッシュ値により、複数の復元文字を対象に辞書の登録を行った際に、既に同じハッシュ値を使用した辞書の登録済みを検出した場合に、最初のハッシュ値に対応した乱数列を順に発生して再度辞書に登録する。
【0069】
このリハッシュ処理についても、図13〜図22の圧縮時と同じ辞書の登録方法がそのまま適用される。
尚、上記の実施例は、辞書検索の具体的方法として内部ハッシュによるデータ構造を例にとるものであったが、本発明はこれに限定されず、外部ハッシュによるリスト構造についても適用することができる。
【0070】
【発明の効果】
以上説明してきたように本発明によれば、LZW等のデータ圧縮装置及び復元装置における辞書の検索と登録において、複数文字を一度に検索し登録できるので、圧縮及び復元処理をより一層高速化することができる。
また辞書検索結果が不一致の場合のリハッシュ値の発生に拡大ガロア体の元を用いることで、最初のハッシュ値に対し全く異なるリハッシュ値を発生することができ、これによって内部ハッシュの衝突を可能な限り回避することができる。
【図面の簡単な説明】
【図1】本発明の原理説明図
【図2】本発明の辞書検索登録方法を実現するデータ圧縮装置のブロック図
【図3】図2の内部ハッシュ法による辞書検索登録の処理説明図
【図4】文字数nにおける内部ハッシュ法による辞書検索登録の並列処理のブロック図
【図5】本発明によるLZW符号の検索と登録の辞書範囲を示す木構造の説明図
【図6】内部ハッシュ法により3バイト一括検索を行う本発明の辞書検索登録のブロック図
【図7】1バイト検索の16ビットハッシュ値を作るハッシュ値生成部のブロック図
【図8】2バイト検索の16ビットハッシュ値を作るハッシュ値生成部のブロック図
【図9】3バイト検索の16ビットハッシュ値を作るハッシュ値生成部のブロック図
【図10】1バイト検索の12ビットハッシュ値を作るハッシュ値生成部のブロック図
【図11】2バイト検索の12ビットハッシュ値を作るハッシュ値生成部のブロック図
【図12】3バイト検索の12ビットハッシュ値を作るハッシュ値生成部のブロック図
【図13】リハッシュ部を備えた本発明の辞書検索登録方法を実現するデータ圧縮装置のブロック図
【図14】図13のリハッシュ値の発生処理の説明図
【図15】図13のリハッシュ部の具体的なブロック図
【図16】拡大ガロア体の元を順々に発生する図15の演算部のブロック図
【図17】拡大ガロア体GF(24 )の元とリハッシュ値の対応関係の説明図
【図18】図16の拡大ガロア体乗算回路の論理回路図
【図19】拡大ガロア体GF(24 )の加算で使用する和の結合表の説明図
【図20】拡大ガロア体GF(24 )の乗算で使用する積の結合表の説明図
【図21】拡大ガロア体GF(212)の元とリハッシュ値の対応関係の説明図
【図22】拡大ガロア体GF(216)の元とリハッシュ値の対応関係の説明図
【図23】従来のLZW符号における辞書の木構造の説明図
【図24】LZW符号における文字列の符号化の説明図
【図25】LZW符号化の具体例の説明図
【図26】図25の符号化で使用する辞書の説明図
【図27】LZW符号化アルゴリズムのフローチャート
【図28】LZW復号化の具体例の説明図
【図29】LZW復号化アルゴリズムのフローチャート
【図30】従来の内部ハッシュ法による辞書検索と登録のブロック図
【図31】従来の内部ハッシュ法による辞書検索と登録の処理説明図
【符号の説明】
10:複数入力検索部
10−1〜10−n:1〜nバイト検索部
11−1〜11−3:ハッシュ値発生部
13−11〜13−34:比較部
12−1〜12−n:一致/不一致検出部
12:複数入力一致検出部
14:複数入力登録部
15−11,15−21,15−31:検出無判断部
16,16−1〜16−3:辞書メモリ(辞書)
17−1:総合検出無判断部
17−2,30:総合一致/不一致判断部
20:ハッシュ値発生部
22:辞書検索部
24:一致/不一致検出部
26:リハッシュ部
30:総合一致/不一致判断部
32,32-1,32-2,34,36,38,40,42,44,46,48:レジスタ
50:ハッシュ値入力部
52:乱数列発生部
54:排他的論理和回路
56:レジスタ
58:選択回路
60:拡大ガロア体乗算回路
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a data compression apparatus that performs encoding by a longest match search between an input character string and a character substring already registered in a dictionary, and a dictionary search registration method for a decompression apparatus, and more particularly, from a plurality of input characters and registered character strings. The present invention relates to a data compression device that generates an index using an internal hash and searches and registers a dictionary, and a dictionary search and registration method for a decompression device.
[0002]
[Prior art]
In recent years, various types of data such as character codes, vector information, and images have been handled by computers, and the amount of data handled has been rapidly increasing. When handling a large amount of data, it is possible to reduce the storage capacity or to transmit the data faster by omitting redundant portions of the data and compressing the data amount.
[0003]
Universal coding has been proposed as a method for compressing various data in one procedure. Here, the field of the present invention is not limited to compression of character codes, but can be applied to various data. In the following, the term used in information theory is followed, and one word unit of data is called a character, A string in which data is connected to a plurality of arbitrary words is called a character string.
[0004]
As a typical method of universal codes, there is a Ziv-Lempel code (for example, Munakata “Ziv-Lempel data compression method”, Information processing, Vol. 26, No. 1, 1985). checking).
For the Jib-Lempel code, the slide dictionary method and the dynamic dictionary method (Incremental
Two algorithms have been proposed. Furthermore, as an improvement of the slide dictionary type algorithm, there is an LZSS code (see TC Bell, “Better OPM / L Text Compression”, IEEE Trans. On Commun., Vol. COM-34, No. 12, Dec. 1986).
[0005]
As an improvement of the dynamic dictionary type algorithm, there is an LZW (Lempel-Ziv-Welch) code (see TA Welch, “A Technique for High-Performance Data Compression”, Computer, June 1984). Among these codes, LZW codes are used for file compression of storage devices because of high-speed processing and simplicity of algorithms.
[0006]
FIG. 23 shows a tree structure of a dictionary in the LZW code, and FIG. 24 shows character string encoding in the LZW code. LZW encoding has a rewritable dictionary, divides the input character string (source data) into different character strings, registers the numbers in the order in which these character strings appear, registers them in the dictionary, and inputs them now Is represented by the number of the longest matching character string registered in the dictionary and encoded.
[0007]
FIG. 25 shows a specific example of the LZW encoding process. In order to simplify the description, the case of three characters a, b, and c is taken as an example. For this reason, each of the characters a, b, and c is initially registered in the dictionary of FIG. 26 used for encoding.
In FIG. 25, input data is read from left to right. When the first character a is input, since there is no matching character string in the dictionary other than the character a, a reference number (index) is output as a code word. Then, the expanded character string ab is assigned a reference number 4 and registered in the dictionary. Actual registration takes the form of a character string (1b).
[0008]
Subsequently, the second character b becomes the head of the character string. Since there is no matching character string other than the character b in the dictionary, the reference number 2 is output as a code word, and the expanded character string ba is actually registered in the dictionary with the reference number 5 in the form of 2a. The third character a is the head of the next character string. Thereafter, this process is similarly continued.
The flowchart in FIG. 27 is an LZW encoding algorithm. First, in step S1, a character string consisting of one character for all characters is registered in the dictionary as an initial value, and then encoding is started. In step S2, the input first character K is set as a dictionary search reference number (index) ω, which is used as a prefix string. Next, in step S3, the next character K of the input data is read. In step S4, the current dictionary has a character string (ωK) obtained by adding the character K read in step S3 to the initial character string ω obtained in step S2. Search whether or not.
[0009]
If the character string (ωK) is found in the dictionary in step S4, the character string (ωK) is replaced with the reference number ω in step S5, and it is determined whether or not the input data is completed in step S5. The search for the maximum matching length is continued until the column (ωK) cannot be searched from the dictionary.
Next, if the character string (ωK) is not in the dictionary in step S4, the process proceeds to step S7, where the reference number ω of the character K obtained in step S2 is output as the code word code (ω), and the character string (ωK) A new reference number is added to and registered in the dictionary, and the input character K in step S2 is replaced with the reference number ω, the dictionary address N is incremented, and after checking in step S5, the process returns to step S2. The next character K is read.
[0010]
FIG. 28 is a specific example of the LZW decoding process, and a combination of three characters a, b, and c is taken as an example to simplify the description. The first input code is 1, and the characters a, b, and c are already registered in the dictionary as reference numbers 1, 2, and 3 as shown in FIG. Is replaced with the character string a of the reference number to be output.
[0011]
Similarly, the next code 2 is replaced with the character b and output. At this time, a new reference number 4 is added to (1b), which is a combination of the previously processed code 1 and the first character b decoded this time, and is registered in the dictionary. The third code 4 replaces 1b with ab by searching the dictionary and outputs a character string ab. At the same time, the combination character string 2a (= ba) of the previously processed code 2 and the first character a of the character string decoded this time is added to the dictionary with a new reference number 5 added thereto. Similarly, this process is repeated.
[0012]
Here, the decoding of FIG. 28 includes the following exception processing. This exception processing occurs when the sixth input code 8 is decoded. Code 8 is not defined in the dictionary at the time of decoding and cannot be decoded. In this case, a character string 5b obtained by adding the first character b of the previously decoded character string ba to the previously processed code 5 is obtained, and further replaced with 2ab and bab and output. Then, the reference number 8 is added to the character string 5b obtained by adding the character b of the character string decoded this time to the previous code word 5 to the output word of the character string, and the result is registered in the dictionary.
[0013]
This exception process is performed through steps S4 and S9 in the decoding process flow of FIG. 29. Finally, in step S7, a character string is output and registered in a dictionary in which a reference number is added to the new character string. Is called.
The flowchart of FIG. 29 is an LZW decoding algorithm, and performs the reverse operation of the encoding of FIG. First, in step S1, similarly to encoding, a character string consisting of one character for all characters is registered as an initial value in the dictionary in advance, and then decoding is started. In step S2, the first code (reference number) is read, the current CODE is set to OLDcode, and the first code corresponds to one of the reference numbers of one character already registered in the dictionary. Find (K) and output the letter K. The output character (K) is set to char for later exception processing.
[0014]
In step S3, the next code is read and set as NEWcode in CODE. In step S4, it is checked whether the code CODE input in step S3 is defined (registered) in the dictionary. Usually, since the input code word is registered in the dictionary in the process up to the previous time, the process proceeds to step S5 to read the character string code (ωK) corresponding to the code CODE from the dictionary, and temporarily stores the character string K in step S6. The reference number code (ω) is set as a new CODE, and the process returns to step S5 again. The procedure of steps S5 and S6 is recursively repeated until the reference number ω reaches one character.
[0015]
Finally, proceeding to step S7, the characters stacked in step S6 are popped up and output in the LILO (Last In Fast Out) format. At the same time, in step S7, a new reference number is added to the character string representing the pair (ω, K) of the previously used code ω and the first character K of the character string restored this time, and registered in the dictionary.
If the code is not registered in step S4 (this occurs when the previous reference number is referred to in encoding), in step S9, OLDcode is returned to CODE and code (OLDcode, char) is returned to NEWcode. After that, the process proceeds to step S5. Also, the exceptional processing that causes the decoding of the sixth input code 8 in FIG. 28 is performed through the processing of step S4 and step S9, and finally the output of the character string and the reference number are added to the new character string in step S7. Registration in the dictionary is performed.
[0016]
[Problems to be solved by the invention]
However, in such data compression and decompression processing using the conventional LZW code or the like, character registration with respect to the dictionary is performed in units of 1 byte, so that dictionary search in encoding or decoding is 1 There is a problem that it can only be performed byte by byte, and it takes time to search and register the dictionary.
[0017]
This problem will be specifically described as follows. FIG. 30 is a dictionary search / registration block in a conventional data compression process, and includes a plurality of input units 100, a single input match detection unit 102, a single input registration unit 104, and a dictionary memory 106.
FIG. 31 shows the dictionary search process in FIG. Now, when the first character K1 is input, the index ω indicating the contact address of the tree structure realized by registration in the dictionary memory 106 and the input character K1 are combined in step S1, and in step S2, the hash value H ( ω, K1) is obtained, and the dictionary memory 106 is searched using the hash value H (ω, K1) as an index in step S3.
[0018]
In step S5, it is compared in step S5 whether or not the index ω ′ and the character K1 ′ read from the dictionary memory 106 by the dictionary search match the index ω and the character K1 used for generating the hash value. If a match between the two is detected, the process returns to step S1 to create a new hash value with a new index and the next character, and the dictionary search is repeated.
[0019]
If they do not match, a rehash value is obtained in accordance with the definition of the rehash function in step S6, and the dictionary search is repeated until the index ω and the character K1 respectively match. If the dictionary is not registered in the search using the first hash value, or the dictionary is not registered in the search using the rehash value, encoding and dictionary registration are performed in step S4.
[0020]
Such a conventional dictionary search has a problem that it takes time to search and register a dictionary because a dictionary search process and a registration process involving a hash process and a rehash process must be performed for each byte of input characters. .
The present invention has been made in view of the above-described conventional problems, and provides a data compression apparatus and a restoration / restoration dictionary search / registration method capable of reducing the processing time by speeding up dictionary search and registration. For the purpose.
[0021]
[Means for Solving the Problems]
FIG. 1 is a diagram illustrating the principle of the present invention. Taking a data compression apparatus as an example, as shown in FIG. 1A, the present invention is a data compression / decompression that performs encoding by a longest match search between an input character string and a character substring already registered in the dictionary 16. As a dictionary search / registration method used for the above, an index (ω) indicating a predetermined number of input characters (K1, K2,... Kn) and a registered character string in a dictionary already searched by the multiple input search means 10. ) To generate a hash value H (ω, K1, K2,... Kn) using an internal hash, and then a plurality of input characters (K1, K2,... The dictionary 16 is searched for Kn). If there is no registration of the character string by this search, the multi-input registration means 14 registers the character string (ω, K1, K2,... Kn) in the dictionary 16.
[0022]
Here, when the number of input characters is n, n dictionaries provided for each number of characters following the already searched character string ω represented by the index, that is, (ω, K1), (ω, k1, K2),... (ω, K1, K2,... Kn) n dictionaries provided by hashing H (ω, K1), H (ω, k1, K2),... H (ω, K1, K2,.
[0023]
Also, as the hash function of the internal hash, an exclusive OR of a plurality of input characters and the index of the character string registered in the already searched dictionary is taken. In this case, an exclusive OR of a plurality of input characters and a dictionary index is obtained so that each bit of the hash value is equal and symmetric. Here, when the number of bits of a plurality of input characters and the index of the dictionary are different and each bit for obtaining the exclusive OR is not equal and symmetric, the bit is used to obtain the exclusive OR on the upper bit side. Deploy.
[0024]
Further, the present invention relates to a dictionary search registration method of a data compression apparatus that performs encoding by longest match search between an input character string K and a character substring already registered in the dictionary, as shown in FIG. A hash value H is generated by an internal hash from a predetermined number of input characters (K1, K2,... Kn) and an index (ω) indicating a registered character string in a dictionary already searched by the hash value generation means 20. (Ω, K1, K2,... Kn), and then the dictionary search means 22 uses the multiple input match detection means 12 as a hash value as an index to input a plurality of input characters (K1, K2,... Kn). The first hash is used as a rehash value to be generated by the rehashing unit 26 when the dictionary 16 is searched for the target, and when the mismatch is detected by the dictionary search by the match / mismatch detection unit 24. A random number sequence corresponding to the value is sequentially generated and the dictionary is searched again.
[0025]
As this rehash value, the first hash value is expanded Galois field GF (2 m ) One element (α i ) And this element (α i ) The same expanded Galois field GF (2 m ) All the elements above (α 1 , Α 2 , ... α 2 ** m-1 ) And a random number sequence are generated in order by exclusive OR on the expanded Galois field.
Specifically, the expanded Galois field GF (2 m ) All the elements above (α 1 , Α 2 , ... α 2 ** m-1 ) To the element (α i-1 ) And primitive elements (α 1 ) And the cumulative multiplication on the expanded Galois field.
[0026]
In addition, 2 m 2 for each state m 2 different random numbers in a series m Expanded state of Galois field GF (2 m ) As the element (α) above, and the value of this element (α) and the primitive element (α 1 ) In order by accumulative multiplication on the expanded Galois field.
Furthermore, the present invention provides a dictionary search and registration method for a data restoration apparatus. Each time a plurality of predetermined characters are input, the data restoration device generates a hash value by an internal hash from a plurality of input characters following the already searched character string represented by the index, The character string is restored from the compressed data obtained by searching and registering the dictionary for the input character.
[0027]
The dictionary search / registration method according to the present invention for such a data restoration apparatus has a hash by an internal hash from a plurality of already restored input characters following the input code every time a character string is restored by searching the dictionary from the inputted code. A value is generated, and a dictionary is registered for a plurality of restored characters based on the hash value.
In addition, as a re-registration of the dictionary by rehashing at the time of data restoration, the dictionary search registration method of the present invention performs a plurality of input restored after the input code every time the character string is restored by searching the dictionary from the inputted code. When a hash value is generated from a character using an internal hash and a dictionary is registered for multiple restored characters using this hash value, if a registered dictionary that already uses the same hash value is detected, Random number sequences corresponding to the hash values are sequentially generated and registered again in the dictionary.
[0028]
As described above, the present invention can search and register a dictionary in which a plurality of characters (characters of a plurality of bytes) are batched, thereby shortening the dictionary registration / registration time in data compression and decompression and shortening the processing time. In particular, in the internal hash of the present invention, the processing time is shortened by simultaneously searching a plurality of characters (K1 to Kn). Specifically, the input search means 10 and the coincidence detection means 12 are provided for each byte number unit from 1 byte to n bytes, and are operated simultaneously in parallel, thereby increasing the speed.
[0029]
Further, according to the present invention, it is possible to search and register the dictionary memory at high speed by using the data structure of the internal hash. Furthermore, by using an element of an extended Galois field as a rehash value, a completely different rehash value can be generated corresponding to the first hash value, and there is an effect of avoiding internal hash collisions as much as possible.
[0030]
DETAILED DESCRIPTION OF THE INVENTION
FIG. 2 is a block diagram showing the basic concept of the dictionary search and registration method of the present invention, taking a data compression apparatus as an example. A data compression apparatus employing the dictionary search / registration method of the present invention includes a multiple input detection unit 10 for searching for a plurality of predetermined input characters, and a multiple input match detection for detecting a match between a plurality of input characters and a plurality of searched characters. Unit 12, a plurality of input registration unit 14 for registering a plurality of input characters at once, and a dictionary memory 16 capable of searching and registering a plurality of characters. Thus, the processing time can be shortened by collectively searching and registering a plurality of characters.
[0031]
FIG. 3 is a dictionary search and registration process for collectively performing a plurality of characters in the data compression apparatus of FIG. First, in the multi-input search unit 10, as shown in step S1, a tree-structured node address (index) indicating predetermined n characters K1, K2,... Kn and already registered character strings. Using a combination of ω (ω, K1, K2,... Kn) as a plurality of input characters, a hash value H (ω, K1, K2,... according to a predetermined hash function by an internal hash structure as in step S2. ., Kn).
[0032]
A dictionary search of the dictionary memory 16 is performed using the hash value created as described above, and (ω ′, K1 ′, K2 ′,... Kn ′) obtained by the search of the dictionary memory 16 are plural in step S1. In step S3, it is compared whether or not each of the input characters matches (ω, K1, K2,... Kn). That is, the multi-input coincidence detection unit 12 performs coincidence detection.
[0033]
If the dictionary search contents and the plurality of input characters all match, it is determined in step S4 that the match is detected, and the node address (index) of the newly obtained dictionary and the next n input characters are determined. Perform similar dictionary search for multiple input characters.
On the other hand, if no match is found in the match detection of the dictionary search result in step S3, the process proceeds from step S4 to step S5, a rehash value is created according to a predetermined hash function definition, and the dictionary using the rehash value in step S2 Perform a search.
[0034]
If the registered content corresponding to the hash value cannot be searched from the dictionary in step S3 by the dictionary search using the hash value or the re-hash value by the first plural input characters, that is, there is no registration corresponding to the hash value in the dictionary memory 16. If not, the process proceeds to step S6 with no detection, and batch registration is performed in the dictionary memory 16 of a plurality of characters using the hash value or rehash value at this time as an index.
[0035]
FIG. 4 is a block diagram of a parallel processing configuration of the multiple input search unit 10 and the multiple input match detection unit 12 of FIG. 2 when a plurality of 1-byte n characters are input. That is, the multi-input search unit 10 has a parallel configuration of a 1-byte search unit 10-1, a 2-byte search unit 10-2,..., An n-byte search unit 10-n. The multiple input coincidence detector 12 has a parallel configuration of coincidence / mismatch detectors 12-1, 12-2,..., 12-n. Then, the total match / mismatch determination unit 30 determines the total match or mismatch of the detection results of the match / mismatch detection unit 12-1 for each byte.
[0036]
FIG. 5 shows a dictionary search and registration range when searching and registering a dictionary of a plurality of characters according to the present invention as seen from the tree structure of the LZW code. In this tree structure, a plurality of characters of 3 bytes are searched and registered. If the first character is the node address (index) ω of the tree structure, the second character of the tree structure is the dictionary 16-. 1 and the third character is registered in the dictionary 16-2, and the fourth character is registered in the dictionary 16-3. The first character from each dictionary 16-1, 16-2, 16-3 is registered. Each of the plurality of characters following the node address (index) ω is searched.
[0037]
Further, the fifth character of the tree structure is registered in the dictionary 16-1, and although not shown, the sixth character of the tree structure is registered in the dictionary 16-2, and the seventh character is registered in the dictionary 16-3. Repeated in the form of being.
For the dictionary structure for searching and registering a plurality of characters up to, for example, 3 bytes as shown in FIG. 5, by using the parallel processing hardware shown in FIG. 4, each dictionary 16-1, 16-2, 16 -3 dictionary search can be performed efficiently at the same time. In software, sequential processing is performed. In this case, more efficient dictionary search can be realized by performing dictionary search in the order of the dictionary 16-3, 16-2, 16-1 having a larger number of characters.
[0038]
FIG. 6 is a block diagram when searching and registering a plurality of characters of 3 bytes in FIG. 5 using an internal hash. First, the 1-byte input search unit 10-1 includes a hash value generation unit 11-1 and a dictionary memory 16-1 in which one character up to the first byte is registered. In the 1-byte search in the 1-byte input search unit 10-1, a hash value is generated from the index ω1 to be searched and the input one character K1 based on the hash function H (ω1, K1), and the address generated as the hash value Thus, the dictionary memory 16-1 is searched.
[0039]
The dictionary memory 16-1 is provided with a flag F indicating the presence or absence of registration. When the flag F is in the set state, the index ω and the character K are registered. In this case, by searching the dictionary memory 16-1 using the hash value by the hash function H (ω1, K1) as an address, the presence of registration is detected by the set of the flag F, and at the same time, the index ω1 ′ and one character K1 ′ are detected. Read out.
[0040]
The 1-byte input match detection unit 12-1 has a comparison unit 13-11, detects whether or not the flag F read from the dictionary memory 16-1 is reset, that is, F = 0, and detects no determination unit 15-11. Produces an output (1) without detection. Further, the index ω1 input by the comparison unit 13-12 is compared with the index ω1 ′ read from the dictionary, and at the same time, one character K1 input by the comparison unit 13-13 and one character K1 ′ read from the dictionary are compared.
[0041]
This comparison result is given to the coincidence / non-coincidence determining unit 15-12, and if it does not coincide, a rehash value is generated and the dictionary memory 16-1 is searched again. If they match, a match output (4) is output to the overall match / mismatch determination unit 17-2 shown on the lower side.
The next 2-byte input search unit 10-2 creates a hash value H (ω1, K1, K2) from the index ω1 to be searched by the hash value generation unit 11-2 and the two characters K1, K2 up to the second byte. The dictionary memory 16-2 is searched with the address. The comparison units 13-21, 13-22, 13-23, and 13 provided in the 2-byte match detection unit 12-2 for the flag F, the index ω1 ′, and the characters K1 ′ and K2 ′ obtained by the dictionary search, respectively. Compare at -24.
[0042]
At this time, if the flag F is F = 0, an undetected output {circle around (2)} is output to the comprehensive non-detection unit 17-1 below the non-detection unit 15-21. Further, (ω1 ′, K1 ′, K2 ′) read by the comparison units 13-22 to 13-24 are respectively compared with the input (ω1, K1, K2), and determined by the match / mismatch determination unit 15-22. If there is a mismatch, a rehash value is generated and the dictionary memory 16-2 is searched again. If there is a match, a match output (5) is generated for the lower total match / mismatch determination unit 17-2.
[0043]
Further, in the 3-byte input search unit 10-3, the hash value H (ω1, K1, K1) is calculated from the index ω1 to be searched by the hash value generation unit 11-3 and the three characters (K1, K2, K3) up to the third byte. K2, K3) are created, and the dictionary memory 16-3 is searched with the address. In this case, as is apparent from the tree structure of FIG. 5, the next index ω4 is registered in the third byte dictionary as well as the presence / absence of registration.
[0044]
This is input to the comparison unit 13-31 of the 3-byte coincidence detection unit 12-3. If ω4 = 0, the detection non-determination unit 15-31 determines that there is no registration corresponding to the address, and the lower comprehensive detection is not performed. An undetected output {circle over (3)} is generated in the determination unit 17-1. When ω4 takes a valid value other than 0, that is, an appropriate value of the subsequent index, the index ω1 ′, characters K1 ′, K2 ′, and K3 ′ are obtained from the dictionary memory 16-3, respectively, and the hash value Is compared with each of the index ω1 and the input characters K1, K2, and K3 used to create the input, and based on the comparison result, the match / mismatch judgment unit 15-32 determines the output (6) as the lower overall match / mismatch judgment. To the unit 17-2.
[0045]
The total detection non-determination unit 17-1 and the total match / mismatch determination unit 17-2 cancel the dictionary search based on the presence / absence of detection from the three dictionary memories 16-1 to 16-3 and the match / mismatch determination result. Or decide to continue. That is, if all the dictionary memories 16-1 to 16-3 are detected and the dictionary search results are determined to match, the index ω1 is replaced with ω4 in order to continue the dictionary search, and each search is continued as feedback. The byte hash value generators 11-1, 11-2, and 11-3 are supplied to perform the same operation.
[0046]
If this search continuation condition is not satisfied, dictionary registration in the dictionary memories 16-1 to 16-3 is performed. That is, if no detection is made in all dictionary memories 16-1 to 16-3, one character is registered in the dictionary memory 16-1. If the dictionary memory 16-1 is detected and the dictionary memories 16-2 and 16-3 are not detected, the second character is registered in the dictionary memories 16-2 and 16-3. Further, if there is detection in the dictionary memories 16-1 and 16-2 and no detection in the dictionary memory 16-3, the third character is registered in the dictionary memory 16-3.
[0047]
7, 8, and 9 are embodiments of the hash value generation method in the multibyte search in the 1 to 3 byte hash value generation units 11-1 to 11-3 in FIG. 6. In this embodiment, the index ω is 16 bits, each character K1, K2, K3 is 8 bits each, and the hash value H is 16 bits.
FIG. 7 shows a case of 1-byte search. The exclusive OR EXOR of the 8 bits of the character K in the register 32 and the upper 8 bits of the 16 bits of the index ω1 of the register 34 is taken to obtain a 16-bit hash value H. The lower 8 bits are in the form of using the lower 8 bits of the index ω1 of the register 34 as they are.
[0048]
The generation of the hash value in the case of the 2-byte search of FIG. 8 is the exclusive logic for each of the 8 bits of the 2 characters K1 and K2 of the registers 32-1 and 32-2 and the 16 bits of the index ω1 of the register 34. The sum EXOR is taken to produce a 16-bit hash value H (ω1, K1, K2).
Furthermore, the generation of the hash value used for the 3-byte search of FIG. 9 is performed by first taking an exclusive OR EXOR with the 16 bits of the index ω1 of the register 40 for each 8 bits of the two characters K1, K2 by the registers 32, 36. Yes. Here, in the bit arrangement of 16 bits of the index ω1 in the register 40, the 10th to 15th 6 bits are located in the center, and the remaining 0th to 9th bits are arranged separately on both sides.
[0049]
Further, 8 bits of the third character K3 are set in the register 38, and an exclusive OR EXOR with the intermediate 8 bits of the register 40 is further taken to obtain a 16-bit hash value H (ω1, K1, K2, K3 ). In the creation of the hash value in the case of such a 3-byte search, the bits of the index ω1, characters K1, K2, and K3 are arranged so that each bit of the generated hash value is equal and symmetric.
[0050]
However, in the case of the 3-byte search of FIG. 9, since the third character K3 is 8 bits and the index ω1 is 16 bits, the bit value is different. Bit arrangement is performed so that the higher-order bits of the bit hash value are reflected. By such bit arrangement, collision of hash values to be created can be avoided as much as possible.
[0051]
10, 11, and 12 exemplify the case of creating a 12-bit hash value for each of 1-byte search, 2-byte search, and 3-byte search, as in FIGS. 7, 8, and 9. That is, in this case, the index ω is 12 bits, and a 16-bit hash value is created from each character 8 bits.
In this 12-bit hash value, there is a difference in the number of bits of the character and the index for the 1-byte search and 2-byte search of FIGS. 10 and 11, but for the 3-byte search of FIG. With the combination of K2 and K3, it is possible to make all three exclusive ORs EXOR for the 12-bit index, and the equal symmetry of each bit of the 12-bit hash value can be kept perfectly.
[0052]
Specifically, the characters K1 and K2 are stored in the registers 40 and 46, and at the same time, the character K3 is divided into upper and lower 4 bits and stored in the registers 44 and 46. Each register 44 and 46 has a 12-bit configuration. The number of bits is matched with the 12-bit index ω1. As a result, a 12-bit hash value H (ω, K1, K2, K3) arranged uniformly and symmetrically for three bits from the index and the characters K1, K2, and K3 can be created.
[0053]
FIG. 13 is a block diagram for realizing a method for generating a rehash value in the dictionary search / registration method of the present invention. That is, as shown in FIGS. 4 and 5, in the dictionary search / registration using the internal hash of the present invention, when a mismatch is detected by the match / mismatch detection, a rehash value is generated and the search is performed again. Do. The function of generating the rehash value is realized by an internal hash mechanism including the hash value generation unit 20, the dictionary search unit 22, the match / mismatch detection unit 24, and the rehash unit 26 illustrated in FIG.
[0054]
FIG. 14 shows a concept of re-hash value generation processing by the internal hash method in FIG. 13, taking 1-byte search as an example. That is, the hash value generation unit 20 obtains a hash value from the index ω1 and the character K1 by the hash function H (ω1, K1), the dictionary search unit 22 searches the dictionary memory 16-1, and the flag F indicating presence / absence exists. The index ω1 ′ and the character K1 ′ are read out.
[0055]
Subsequently, in the match / mismatch detection unit 24, the comparison unit 13-11 does not set the flag F = 0, but the match / mismatch determination unit 15-12 compares the index and the character by the comparison units 13-12 and 13-13. When the match is determined, the rehash unit 26 is activated to generate a rehash value RH. In general, the rehash value RH is generated by sequentially generating rehash addresses from a random number sequence determined by a rehash function RHm (H (ω1, K1)), m = 1, 2,... NMAX.
[0056]
FIG. 15 is a specific example of the rehash unit 26 of FIG. 14 and includes a hash value input unit 50, a calculation unit 52, and an exclusive OR circuit 54. In the configuration of the rehash unit 26, first, the first hash value is input to the expanded Galois field GF in the hash value input unit 50. (2 ** m) Is considered to be the original alpha of On the other hand, in the calculation unit 52, an enlarged Galois field GF prepared in advance is provided. (2 ** m) Yuan α 1 , Α 2 , Α Three , ... α max (However, max = 2 m -1) is generated. 2 ** m indicates 2 to the power of m.
[0057]
Then, in the exclusive OR circuit 54, the element α on the Galois field output from the hash value input unit 50 and the element α on the expanded Galois field generated one after another by the arithmetic unit 52 i Is taken as the rehash value. Of course, the original sequential generation on the expanded Galois field in the arithmetic unit 52 is repeated when a mismatch is detected in the dictionary search by the rehash value created by the exclusive OR circuit 52.
[0058]
FIG. 16 is a specific example of the calculation unit 52 of FIG. The calculation unit 52 sequentially generates elements on the enlarged Galois field, and the enlarged Galois field GF (2 m ) Primitive element α, an enlarged Galois field multiplication circuit 60, an expanded Galois field unit element α m-1 Is selected as an initial value, and thereafter, the selection circuit 58 selects the output of the expanded Galois field multiplication circuit 60.
[0059]
Here, taking as an example the case of having a four-dimensional binary vector of m = 4 as an expanded Galois field, in this case, the expanded Galois field is GF (2 Four ). These elements are expressed as powers of α. In this case, the number of elements α is 2 Four Pieces = 16 pieces, the original is 0, α 0 = 1, α 1 , Α 1 , ... α 14 , Α 15 It becomes. This element α can be obtained from the root of an expression called a primitive polynomial, and is called a primitive element.
[0060]
That is, Galois field GF (2 Four ) Primitive polynomial is
f (x) = x Four + X + 1
Can be expressed as
FIG. 17 shows Galois field GF (2 Four ) In four-dimensional vector representation (X Three , X 2 , X 2 , X 0 ) And power expression 0, α 1 ~ Α Five Represents the relationship. i = 0 is called a zero element, and i = 1 to 14 are primitive elements. 1 ~ Α 14 It is represented by Furthermore, i = 15 is called a unit element, and α 15 This is α 0 be equivalent to.
[0061]
In the hash value input unit 50 of FIG. 15, for example, if the hash value input is 8 bits in a 1-byte configuration, the hash value X divided into 4-byte units Three ~ X 0 For, the original value represented by i is output as the hash value as an element on the expanded Galois field. In the register 56 of FIG. 16, the expanded Galois field GF (2 Four ) Origin α 1 Is set in the enlarged Galois field multiplication circuit 60 as P. The selection circuit 58 uses the enlarged Galois field GF2 as an initial value. m Unit element α 15 Is selected and output to the enlarged Galois field multiplication circuit 60 as PQ.
[0062]
The expanded Galois field multiplication circuit 60 is a logic circuit shown in FIG. That is, the start source α from the register 56 1 The logical operation shown in the figure is performed on each of the 4 bits of the input P and the input Q selected by the selection circuit 58, and finally the primitive polynomial f (x) = x in EXOR Four The remainder of + x + 1 is obtained and sequentially output as a value R representing an element on the expanded Galois field.
[0063]
Expanded Galois field GF (2 when m = 4 Four ) Is the maximum rehash value address that can be generated from the primitive polynomial when all bits are 1.
f (2) = 2 Four + 2 + 1 = 19
It becomes.
Further, addition on the enlarged Galois field multiplication circuit 60 shown in FIG. 18 and the expanded Galois field realized by the exclusive OR shown in FIG. 15 is performed according to the sum combination table shown in FIG. Further, the multiplication by the AND circuit in the enlarged Galois field multiplication circuit 60 of FIG. 18 is performed according to the product combination table of FIG.
[0064]
As an expanded Galois field for generating a rehash value in the present invention, a larger value than m = 4 can be taken. FIG. 21 shows an enlarged Galois field GF (2 12 The relationship between the element and the rehash value in FIG. Expanded Galois field GF (2 12 ) Primitive polynomial is
f (x) = x 12 + X 6 + X Four + X + 1
Given in. In this case, the maximum address of the rehash value when all bits are 1 is 4179. In the rehash value of FIG. 21, the hexadecimal display of 0, 1, 2,..., 8, 9, a, b,.
[0065]
FIG. 22 shows an enlarged Galois field GF (2 when m = 16. 16 The relationship between the element and the rehash value in FIG. Expanded Galois field GF (2 16 ) Primitive polynomial is
f (x) = x 16 + X 6 + X Four + X + 1
Given in. At this time, the maximum address of the rehash value which is all bits 1 is 65619.
[0066]
The above embodiment is an example of the dictionary search / registration method in the data compression device, but the same applies to the data restoration device that restores the original character string from the compressed data obtained by this data compression device. A dictionary registration method is applied.
That is, each time a plurality of predetermined characters are input, the data restoration apparatus adopting the dictionary search / registration method of the present invention uses an internal hash from a plurality of input characters following the already searched character string represented by the index. A hash value is generated, and a character string is restored from the compressed data obtained by searching and registering the dictionary for the plurality of input characters using the hash value.
[0067]
The dictionary search / registration method of the present invention with respect to such a data restoration device, each time a character string is restored by searching the dictionary memory from the inputted code ω, a plurality of characters (K1, K1) already restored following the input code ω. A hash value H (ω, K1, K2, K3,... Kn) is generated from K2, K3,... Kn by an internal hash, and a plurality of restored characters (ω, K1, K2, K2) are generated by the hash value. The dictionary is registered for K3,... Kn).
[0068]
For the restoration of multiple character units, the same dictionary registration method as that used for compression in FIGS. 2 to 12 is applied as it is.
In addition, as re-registration of the dictionary by rehashing at the time of data restoration, the dictionary search and registration method according to the present invention, each time a character string is restored by searching the dictionary from the input code ω, A hash value H (ω, K1, K2, K3,... Kn) is generated from characters (K1, K2, K3,... Kn) by an internal hash, and a plurality of restored characters are targeted by this hash value. When registration of a dictionary using the same hash value is already detected when the dictionary is registered, a random number sequence corresponding to the first hash value is sequentially generated and registered again in the dictionary.
[0069]
The same dictionary registration method as that used for compression in FIGS. 13 to 22 is also applied to this rehash processing.
In the above embodiment, the data structure based on the internal hash is taken as an example as a specific method of dictionary search. However, the present invention is not limited to this, and can be applied to the list structure based on the external hash. it can.
[0070]
【The invention's effect】
As described above, according to the present invention, it is possible to search and register a plurality of characters at a time in dictionary search and registration in a data compression apparatus and decompression apparatus such as LZW, thereby further speeding up the compression and decompression processing. be able to.
Also, by using an extended Galois field element to generate a rehash value when the dictionary search results do not match, it is possible to generate a completely different rehash value for the first hash value, which allows internal hash collisions As far as can be avoided.
[Brief description of the drawings]
FIG. 1 illustrates the principle of the present invention
FIG. 2 is a block diagram of a data compression apparatus for realizing the dictionary search / registration method of the present invention.
FIG. 3 is an explanatory diagram of dictionary search registration processing by the internal hash method of FIG.
FIG. 4 is a block diagram of parallel processing of dictionary search registration by the internal hash method for the number of characters n.
FIG. 5 is an explanatory diagram of a tree structure showing a dictionary range for searching and registering LZW codes according to the present invention.
FIG. 6 is a block diagram of dictionary search registration according to the present invention for performing a 3-byte batch search by an internal hash method.
FIG. 7 is a block diagram of a hash value generation unit that creates a 16-bit hash value for 1-byte search.
FIG. 8 is a block diagram of a hash value generation unit that creates a 16-bit hash value for 2-byte search.
FIG. 9 is a block diagram of a hash value generation unit that creates a 16-bit hash value for 3-byte search.
FIG. 10 is a block diagram of a hash value generation unit that creates a 12-bit hash value for 1-byte search.
FIG. 11 is a block diagram of a hash value generation unit that creates a 12-bit hash value for 2-byte search.
FIG. 12 is a block diagram of a hash value generation unit that creates a 12-bit hash value for 3-byte search.
FIG. 13 is a block diagram of a data compression apparatus that implements the dictionary search / registration method of the present invention including a rehash unit.
FIG. 14 is an explanatory diagram of generation processing of the rehash value of FIG.
15 is a specific block diagram of the rehash part of FIG.
16 is a block diagram of the arithmetic unit in FIG. 15 that sequentially generates elements of an enlarged Galois field.
FIG. 17: Expanded Galois field GF (2 Four ) Explanation of correspondence between elements and rehash values
18 is a logic circuit diagram of the expanded Galois field multiplier circuit of FIG.
FIG. 19: Expanded Galois field GF (2 Four ) Explanatory diagram of the sum join table used for addition
FIG. 20: Expanded Galois field GF (2 Four ) Explanatory drawing of product combination table used for multiplication
FIG. 21: Expanded Galois field GF (2 12 ) Explanation of correspondence between elements and rehash values
FIG. 22: Expanded Galois field GF (2 16 ) Explanation of correspondence between elements and rehash values
FIG. 23 is an explanatory diagram of a tree structure of a dictionary in a conventional LZW code.
FIG. 24 is an explanatory diagram of character string encoding in the LZW code.
FIG. 25 is an explanatory diagram of a specific example of LZW encoding.
26 is an explanatory diagram of a dictionary used in the encoding of FIG.
FIG. 27 is a flowchart of an LZW encoding algorithm.
FIG. 28 is an explanatory diagram of a specific example of LZW decoding.
FIG. 29 is a flowchart of an LZW decoding algorithm.
FIG. 30 is a block diagram of dictionary search and registration by a conventional internal hash method.
FIG. 31 is an explanatory diagram of dictionary search and registration processing by a conventional internal hash method.
[Explanation of symbols]
10: Multiple input search section
10-1 to 10-n: 1 to n bytes search part
11-1 to 11-3: Hash value generator
13-11 to 13-34: comparison unit
12-1 to 12-n: match / mismatch detection unit
12: Multiple input coincidence detector
14: Multiple input registration section
15-11, 15-21, 15-31: No detection judgment unit
16, 16-1 to 16-3: Dictionary memory (dictionary)
17-1: Comprehensive detection non-judgement
17-2, 30: Total match / mismatch determination unit
20: Hash value generator
22: Dictionary search part
24: Match / mismatch detector
26: Rehash part
30: Total match / mismatch determination section
32,32-1,32-2,34,36,38,40,42,44,46,48: Register
50: Hash value input part
52: Random number generator
54: Exclusive OR circuit
56: Register
58: Selection circuit
60: Expanded Galois field multiplication circuit

Claims (10)

入力される文字列と、辞書に既に登録した文字部分列との最長一致検索により符号化を行うデータ圧縮装置の辞書検索登録方法に於いて、
予め定めた数の複数文字を入力し、
前記複数文字を入力する毎に、インデックスで表わされた既に検索済みの文字列に続く前記複数の入力文字から内部ハッシュによってハッシュ値を生成し、
該ハッシュ値により、前記複数の入力文字を対象に前記辞書の検索及び登録を行い、
前記内部ハッシュのハッシュ関数として、複数の入力文字と既に検索された辞書に登録済み文字列のインデックスとの排他的論理和を求めることを特徴とするデータ圧縮装置の辞書検索登録方法。
In a dictionary search registration method of a data compression device that performs encoding by longest match search between an input character string and a character substring already registered in the dictionary,
Enter a predetermined number of multiple characters,
Each time the plurality of characters are input, a hash value is generated by an internal hash from the plurality of input characters following the already searched character string represented by the index,
By the hash value, it has row retrieval and registration of the dictionary target the plurality of input character,
A dictionary search / registration method of a data compression apparatus, wherein an exclusive OR of a plurality of input characters and an index of a character string already registered in a dictionary already searched is obtained as a hash function of the internal hash .
請求項1記載のデータ圧縮装置の辞書検索登録方法に於いて、
前記複数の入力文字の数をnとした場合、インデックスで表わされた既に検索済みの文字列に続く文字数毎に設けたn個の辞書を、内部ハッシュにより生成した文字数毎のハッシュ値により、同時に辞書検索することを特徴とするデータ圧縮装置の辞書検索登録方法。
In the dictionary search registration method of the data compression apparatus of Claim 1,
When the number of the plurality of input characters is n, n dictionaries provided for each number of characters following the already searched character string represented by the index are represented by a hash value for each number of characters generated by the internal hash. A dictionary search / registration method for a data compression apparatus, wherein a dictionary search is performed simultaneously.
請求項記載のデータ圧縮装置の辞書検索登録方法に於いて、前記ハッシュ値の各ビットが均等且つ対称となるように、前記複数の入力文字と前記辞書のインデックスとの排他的論理和を求めることを特徴とするデータ圧縮装置の辞書検索登録方法。2. The dictionary search / registration method of the data compression apparatus according to claim 1 , wherein an exclusive OR of the plurality of input characters and the index of the dictionary is obtained so that each bit of the hash value is equal and symmetric. A dictionary search / registration method for a data compression apparatus. 請求項記載のデータ圧縮装置の辞書検索登録方法に於いて、前記複数の入力文字と前記辞書のインデックスとのビット数が相違して排他的論理和を求める各ビットが均等且つ対称とならない場合には、上位ビット側で排他的論理和を求めるようにビット配置することを特徴とするデータ圧縮装置の辞書検索登録方法。4. The dictionary search / registration method of the data compression apparatus according to claim 3 , wherein the number of bits of the plurality of input characters and the index of the dictionary are different and each bit for obtaining an exclusive OR is not equal and symmetric. Includes a bit arrangement so as to obtain an exclusive OR on the high-order bit side, and a dictionary search and registration method for a data compression apparatus. 入力される文字列Kと、辞書に既に登録した文字部分列との最長一致検索により符号化を行うデータ圧縮装置の辞書検索登録方法に於いて、
予め定めた数の複数文字を入力し、
前記複数文字を入力する毎に、インデックスで表わされた既に検索済みの文字列に続く前記複数の入力文字から内部ハッシュによってハッシュ値を生成し、
該ハッシュ値により、前記複数の入力文字を対象に前記辞書の検索を行い、
該辞書検索で不一致を検出した際に生成するリハッシュ値として、最初のハッシュ値に対応した乱数列を順に発生して再度辞書を検索し、
前記内部ハッシュのハッシュ関数として、複数の入力文字と既に検索された辞書に登録済み文字列のインデックスとの排他的論理和を求めることを特徴とするデータ圧縮装置の辞書検索登録方法。
In a dictionary search / registration method of a data compression apparatus that performs encoding by a longest match search between an input character string K and a character substring already registered in the dictionary,
Enter a predetermined number of multiple characters,
Each time the plurality of characters are input, a hash value is generated by an internal hash from the plurality of input characters following the already searched character string represented by the index,
The hash value is used to search the dictionary for the plurality of input characters,
As a rehash value generated when a mismatch is detected in the dictionary search, a random number sequence corresponding to the first hash value is generated in order, and the dictionary is searched again.
A dictionary search / registration method of a data compression apparatus, wherein an exclusive OR of a plurality of input characters and an index of a character string already registered in a dictionary already searched is obtained as a hash function of the internal hash .
請求項記載のデータ圧縮装置の辞書検索登録方法に於いて、前記リハッシュ値として、最初のハッシュ値を拡大ガロア体GF(2m )上の1つの元(αi )とし、該元(αi )に同じ拡大ガロア体GF(2m )上の全ての元(α1 ,α2 ,・・・・α2**m-1)とから拡大ガロア体上での排他的論理和により乱数列を順に発生させることを特徴とするデータ圧縮装置の辞書検索登録方法。6. The dictionary search / registration method of the data compression apparatus according to claim 5 , wherein the first hash value is set as one element (α i ) on the expanded Galois field GF (2 m ) as the rehash value, and the element (α i ) and all elements (α 1 , α 2 ,... α 2 ** m-1 ) on the same expanded Galois field GF (2 m ) and random numbers by exclusive OR on the expanded Galois field A dictionary search / registration method for a data compression apparatus, wherein a sequence is generated in order. 請求項記載のデータ圧縮装置の辞書検索登録方法に於いて、
前記拡大ガロア体上の全ての元(α1 ,α2 ,・・・・α2**m-1)を、1つ前に生成した元(αi-1 )と原始元(α1 )との拡大ガロア体上での累積乗算により順に発生させることを特徴とするデータ圧縮装置の辞書検索登録方法。
In the dictionary search registration method of the data compression apparatus of Claim 6 ,
All the elements (α 1 , α 2 ,... Α 2 ** m-1 ) on the expanded Galois field are generated the last time (α i-1 ) and primitive element (α 1 ). And a dictionary search / registration method for a data compression apparatus, which are generated in order by cumulative multiplication on an expanded Galois field.
請求項記載のデータ圧縮装置の辞書検索登録方法に於いて、2m 個の状態に対応して2m 個が連なる相異なる前記乱数列を、2m 個の状態を拡大ガロア体GF(2m )上の元(α)として捉え、該元(α)の値と原始元(α1 )の拡大ガロア体上の累積乗算により順に発生させるデータ圧縮装置の辞書検索登録方法。In dictionary retrieval method of registering data compression apparatus according to claim 5, different said random number sequence 2 m pieces corresponds to 2 m pieces of state continuous, 2 m pieces of state to expand Galois field GF (2 m ) A dictionary search / registration method of a data compression apparatus which is regarded as an element (α) on the above and is generated in order by cumulative multiplication of the value of the element (α) and the primitive element (α 1 ) on the expanded Galois field. 予め定めた複数文字を入力する毎に、インデックスで表わされた既に検索済みの文字列に続く前記複数の入力文字から内部ハッシュによってハッシュ値を生成し、該ハッシュ値により前記複数の入力文字を対象に前記辞書の検索及び登録を行って得られた圧縮データから文字列を復元するデータ復元装置の辞書検索登録方法に於いて、
入力された符号から辞書の検索により文字列を復元する毎に、入力符号に続くすでに復元された複数の入力文字から内部ハッシュによってハッシュ値を生成し、
該ハッシュ値により、前記複数の復元文字を対象に前記辞書の登録を行い、
前記内部ハッシュのハッシュ関数として、複数の入力文字と既に検索された辞書に登録済み文字列のインデックスとの排他的論理和を求めることを特徴とするデータ圧縮装置の辞書検索登録方法。
Each time a plurality of predetermined characters are input, a hash value is generated by an internal hash from the plurality of input characters following the already searched character string represented by the index, and the plurality of input characters are converted by the hash value. In a dictionary search / registration method of a data restoration device for restoring a character string from compressed data obtained by performing search and registration of the dictionary to an object,
Every time a character string is restored by searching the dictionary from the input code, a hash value is generated by an internal hash from a plurality of already restored input characters following the input code,
The hash value is used to register the dictionary for the plurality of restored characters,
A dictionary search / registration method of a data compression apparatus, wherein an exclusive OR of a plurality of input characters and an index of a character string already registered in a dictionary already searched is obtained as a hash function of the internal hash .
予め定めた複数文字を入力する毎に、インデックスで表わされた既に検索済みの文字列に続く前記複数の入力文字から内部ハッシュによってハッシュ値を生成し、該ハッシュ値により前記複数の入力文字を対象に前記辞書の検索及び登録を行って得られた圧縮データから文字列を復元するデータ復元装置の辞書検索登録方法に於いて、
入力された符号から辞書の検索により文字列を復元する毎に、入力符号に続くすでに復元された複数の入力文字から内部ハッシュによってハッシュ値を生成し、
該ハッシュ値により、前記複数の復元文字を対象に前記辞書の登録を行い、該辞書登録の際に、既に同じハッシュ値を使用した登録を検出した際に、最初のハッシュ値に対応した乱数列を順に発生して再度辞書に登録し、
前記内部ハッシュのハッシュ関数として、複数の入力文字と既に検索された辞書に登録済み文字列のインデックスとの排他的論理和を求めることを特徴とするデータ圧縮装置の辞書検索登録方法。
Each time a plurality of predetermined characters are input, a hash value is generated by an internal hash from the plurality of input characters following the already searched character string represented by the index, and the plurality of input characters are converted by the hash value. In a dictionary search / registration method of a data restoration device for restoring a character string from compressed data obtained by performing search and registration of the dictionary to an object,
Every time a character string is restored by searching the dictionary from the input code, a hash value is generated by an internal hash from a plurality of already restored input characters following the input code,
The hash value is used to register the dictionary for the plurality of restored characters, and when the registration using the same hash value is detected during the dictionary registration, a random number sequence corresponding to the first hash value In order and register it again in the dictionary,
A dictionary search / registration method of a data compression apparatus, wherein an exclusive OR of a plurality of input characters and an index of a character string already registered in a dictionary already searched is obtained as a hash function of the internal hash .
JP02506696A 1996-02-13 1996-02-13 Data compression apparatus and decompression apparatus dictionary search registration method Expired - Fee Related JP3835489B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP02506696A JP3835489B2 (en) 1996-02-13 1996-02-13 Data compression apparatus and decompression apparatus dictionary search registration method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP02506696A JP3835489B2 (en) 1996-02-13 1996-02-13 Data compression apparatus and decompression apparatus dictionary search registration method

Publications (2)

Publication Number Publication Date
JPH09218877A JPH09218877A (en) 1997-08-19
JP3835489B2 true JP3835489B2 (en) 2006-10-18

Family

ID=12155561

Family Applications (1)

Application Number Title Priority Date Filing Date
JP02506696A Expired - Fee Related JP3835489B2 (en) 1996-02-13 1996-02-13 Data compression apparatus and decompression apparatus dictionary search registration method

Country Status (1)

Country Link
JP (1) JP3835489B2 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4472808B2 (en) * 1999-08-19 2010-06-02 ネッツエスアイ東洋株式会社 Multiply-accumulate device and encryption / decryption device using the same
JP4484002B2 (en) * 1999-10-04 2010-06-16 ネッツエスアイ東洋株式会社 Arithmetic processor
JP4288486B2 (en) 2003-11-17 2009-07-01 日本電気株式会社 Disk array device, RAID parity data generation circuit, and Galois field multiplication circuit
JP4768009B2 (en) * 2005-03-11 2011-09-07 ロックソフト リミテッド How to store less redundant data using a data cluster
JP5831298B2 (en) 2012-03-06 2015-12-09 富士通株式会社 Program, information processing apparatus, and index generation method
JP6028567B2 (en) 2012-12-28 2016-11-16 富士通株式会社 Data storage program, data search program, data storage device, data search device, data storage method, and data search method
JP6834327B2 (en) * 2016-10-06 2021-02-24 富士通株式会社 Coding program, coding device and coding method

Also Published As

Publication number Publication date
JPH09218877A (en) 1997-08-19

Similar Documents

Publication Publication Date Title
US5485526A (en) Memory circuit for lossless data compression/decompression dictionary storage
JP3835489B2 (en) Data compression apparatus and decompression apparatus dictionary search registration method
JP3241788B2 (en) Data compression method
JP3038233B2 (en) Data compression and decompression device
JP3105598B2 (en) Data compression method using universal code
JP2952067B2 (en) Data compression method
JP3038234B2 (en) Dictionary search method for data compression equipment
JPH05241775A (en) Data compression system
JP2952068B2 (en) Data compression and decompression method
JP3555506B2 (en) Character string data compression encoding device, character string data decompression device, and character string data arithmetic processing device
JP3132774B2 (en) Data compression / decompression device
JPH0683574A (en) Data compression and restoring system
JP3015483B2 (en) Data compression and decompression method
JP2999561B2 (en) Data compression and decompression device
JPH06161705A (en) Data encoding system and data decoding system
JP3012679B2 (en) Data compression method
JP3384844B2 (en) Data compression method and apparatus and data decompression method and apparatus
JP2999587B2 (en) Data compression and decompression method
JP3051501B2 (en) Data compression method
JPH05241778A (en) Data compression and restoration system
JP2772124B2 (en) Dictionary search method
JPH05252049A (en) Data compression processing system and data decoding processing system
JPH04145726A (en) Data compression and restoring system
JP2802135B2 (en) Image data compression method
JPH05341952A (en) Method and device for restoring data

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060207

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060407

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20060627

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20060718

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20090804

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20100804

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20110804

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20120804

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120804

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20130804

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees