JPH04100322A - Data compression and decoding system - Google Patents

Data compression and decoding system

Info

Publication number
JPH04100322A
JPH04100322A JP2066303A JP6630390A JPH04100322A JP H04100322 A JPH04100322 A JP H04100322A JP 2066303 A JP2066303 A JP 2066303A JP 6630390 A JP6630390 A JP 6630390A JP H04100322 A JPH04100322 A JP H04100322A
Authority
JP
Japan
Prior art keywords
dictionary
divided
index
character
registered
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2066303A
Other languages
Japanese (ja)
Inventor
Shigeru Yoshida
茂 吉田
Yasuhiko Nakano
泰彦 中野
Yoshiyuki Okada
佳之 岡田
Hirotaka Chiba
広隆 千葉
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 JP2066303A priority Critical patent/JPH04100322A/en
Publication of JPH04100322A publication Critical patent/JPH04100322A/en
Pending legal-status Critical Current

Links

Landscapes

  • Document Processing Apparatus (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

PURPOSE:To reduce the redundancy between character strings and to obtain a high compression rate by representing an index representing a registration position as the entire dictionary with an index in numbers arranged in the order of appearance of each division dictionary. CONSTITUTION:A registration dictionary is split into some division dictionaries DD1-DD5, and an index representing a registration position of the entire dictionary is indicated by an index in a split dictionary group when the division dictionaries DD1-DD5 are arranged in the order of high appearance rate. For example, when a character string of an index T in the division dictionary DD4 is registered, a coded index is indicated and coded by representing the index as a sum 25 between an index 7 in the registered division dictionary DD4 and a total sum (n1+n2+n3=18) of the character strings in preceding division dictionaries DD1-DD3 to the registered division dictionary DD4. Thus, the relation of subordinate between coded character strings is fetched at index coding, the redundancy between character strings is reduced and a high compression rate is realized.

Description

【発明の詳細な説明】 [概要] ユニバーサル符号化の一種である増分分解型符号化の改
良としてのLZW符号化によるデータ圧縮及び復元方式
に関し、 文字列間の冗長性を削減して圧縮率を高めることを目的
とし、 登録辞書を幾つかに分割して持ち、新たな部分列を辞書
登録する際には、既に登録済みの部分列との従属関係に
より分類される分割辞書を指定して登録すると共に、辞
書全体としての登録位置を分割辞書群内での登録位置を
示す参照番号で表す、この参照番号を符号化する。また
復元時には、既に登録済みの部分列との従属関係により
分類される分割辞書を指定して登録すると共に、分割辞
書群内での登録位置を示す参照番号により指定される符
号を復元する。
[Detailed Description of the Invention] [Summary] Regarding a data compression and decompression method using LZW encoding as an improvement of incremental decomposition encoding, which is a type of universal encoding, the present invention aims to improve the compression rate by reducing redundancy between character strings. For the purpose of increasing the number of subsequences, the registered dictionary is divided into several parts, and when registering a new subsequence in the dictionary, specify and register the subsequence divided according to the dependency relationship with the already registered subsequence. At the same time, the registration position of the dictionary as a whole is represented by a reference number indicating the registration position within the divided dictionary group, and this reference number is encoded. Furthermore, at the time of restoration, divided dictionaries that are classified according to their subordination with already registered subsequences are designated and registered, and the code specified by the reference number indicating the registration position within the divided dictionary group is restored.

[産業上の利用分野コ 本発明は、ユニバーサル符号の一種である増分分解型の
改良として知られたLZW符号による画像データ圧縮方
式に関する。
[Industrial Application Field] The present invention relates to an image data compression method using an LZW code, which is known as an improved incremental decomposition type of universal code.

近年、文字コード、ベクトル情報、画像など様々な種類
のデータがコンピュータで扱われるようになっており、
扱われるデータ量も急速に増加してきている。大量のデ
ータを扱うときは、データの中の冗長な部分を省いてデ
ータ量を圧縮することで記憶容量を減らしたり、速く伝
送したりすることが望まれる。
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, it is desirable to reduce storage capacity and speed up transmission by eliminating redundant parts of the data and compressing the amount of data.

このように様々なデータを1つの方式でデータ圧縮でき
る方法としてユニバーサル符号化が提案されている。
Universal encoding has been proposed as a method that can compress various types of data using one method.

ここで、本発明の分野は、文字コードの圧縮に限らず、
様々なデータに適用できるが、以下では、情報理論で用
いられている呼称を踏襲し、データの1ワ一ド単位を文
字と呼び、データが複数ワープつながったものを文字列
と呼ぶことにする。
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 a string of data that is connected by multiple warps. .

ユニバーサル符号化の代表的な方法として、ジブーレン
ベル(2iマ−Lempel)符号がある(詳しくは、
例えば、宗像「2iv−Lempelのデータ圧縮法」
A representative method of universal encoding is the Jibo Lempel (2i-Lempel) code (for details, see
For example, Munakata "2iv-Lempel's data compression method"
.

情報処理、マ01.26. No、 1.1985年を
参照のこと)。
Information processing, Ma01.26. No. 1.1985).

2iv−Lempel符号では、 ■ユニバーサル型と、 ■増分分解型(Incremental parsin
g)の2つのアルゴリズムが提案されている。
2iv-Lempel code has two types: ■ Universal type and ■ Incremental parsin type.
Two algorithms have been proposed: g).

更に、ユニバーサル型アルゴリズムの改良として、LZ
SS符号がある(T、 C,Be1l、 ’ BeNe
r OPM/L Text Compression’
、 IEEE Trans、 on CommunVo
l、 C0M−34,NO,12,Dec、 1986
参照)。
Furthermore, as an improvement of the universal algorithm, LZ
There are SS codes (T, C, Be1l, ' BeNe
r OPM/L Text Compression'
, IEEE Trans, on CommonVo
l, C0M-34, NO, 12, Dec, 1986
reference).

また、増分分解型アルゴリズムの改良としては、L Z
 W (Lempel−2iy−Welch)符号があ
る(T、AWelch、’A Technique f
or High−Performance DataC
omptession’、 Computer、 Ju
ne 1984年参照)。
Moreover, as an improvement of the incremental decomposition type algorithm, L Z
There is a W (Lempel-2iy-Welch) code (T, A Welch, 'A Technique f
or High-Performance DataC
emptession', Computer, Ju
ne 1984).

これらの符号化方式の内、高速処理ができることと、ア
ルゴリズムの簡単さからLZW符号が記憶装置のファイ
ル圧縮などで使われるようになっている。
Among these encoding methods, the LZW code has come to be used for file compression in storage devices because of its ability to perform high-speed processing and its simple algorithm.

[従来の技術] 従来のLZW符号による符号化処理フローを第7図に示
し、復号化処理フローを第8図に示す。
[Prior Art] FIG. 7 shows an encoding processing flow using a conventional LZW code, and FIG. 8 shows a decoding processing flow.

まずLZW符号化処理は、書き替え可能な辞書を持ち、
入力文字列の中を相異なる文字列(部分列)に分け、こ
の文字列を出現した順に参照番号を付けて辞書に登録す
ると共に、現在入力している文字列を辞書に登録しであ
る最長−散文字列の参照番号で表して符号化するもので
ある。
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 and find the longest string. - It is represented and encoded by a reference number in a scattered character string.

第9図にLZW符号化の説明図を示すと共に第11図に
LZW復号化の説明図を示し、更に第10図に復号化と
復号化時に作成される辞書構成例を示す。
FIG. 9 shows an explanatory diagram of LZW encoding, FIG. 11 shows an explanatory diagram of LZW decoding, and FIG. 10 shows an example of decoding and a dictionary structure created during decoding.

尚、第9.10.11図では説明を簡単にするため、a
bcの3文字の組合せからなるデータを圧縮、復元する
場合の例を取り上げている。
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.

第9図のLZW符号化処理では、まずステップ81(以
下「ステップ」は省略)で予め辞書に全文字につき一文
字からなる文字列を初期値として登録してから符号化を
始める。またSlでの符号化は、入力した最初の文字K
により辞書を検索して参照番号ωを求め、これを語頭文
字列とする。
In the LZW encoding process shown in FIG. 9, first, in step 81 (hereinafter "step" will be 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. Also, the encoding in Sl is the first input character K
Search the dictionary to find the reference number ω, and use this as the initial character string.

次に82で入力データの次の文字Kを読込み、S3で全
ての文字入力が終了したか否かチエツクした後、S4に
進んでSlで求めた語頭文字列ωに82で読込んだも文
字Kを加えた文字列(ωK)が辞書にあるか否か探す。
Next, the next character K of the input data is read in step 82, and after checking whether all character input has been completed in step S3, the process proceeds to step S4, where the character K read in step 82 is added to the initial character string ω determined in step S1. A search is made to see if the character string (ωK) to which the letter K is added is found in the dictionary.

S4で文字列(ωK)が辞書になければ、S6に進んで
Slで求めた文字にの参照番号ωを符号語code (
ω)として出力し、また文字列(ωK)に新たな参照番
号を付加して辞書に登録し、更にS2の入力文字Kを参
照番号ωに置き換えると共に辞書アドレスnをインクリ
メントしてS2に戻って次の文字Kを読み込む。
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.

一方、S4で文字列(ωK)が辞書にあればS5で文字
列(ωK)を参照番号ωに置き換え、再びS2に戻って
S4で文字列(ω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 growth is continued until the character string (ωK) cannot be found in the dictionary in S4. Continue searching.

第9,10図を参照してLZW符号化を具体的に説明す
ると次のようになる。
LZW encoding will be specifically explained as follows with reference to FIGS. 9 and 10.

まず第9図の入力データ1nplは左から右へと読む。First, the input data 1npl in FIG. 9 is read from left to right.

最初の文字aを入力した時、辞書にはaの他に一致する
文字列がないので、0UTPUT C0DE 1(参照
番号ω)を符号語して出力する。そして、拡張した文字
列abに参照番号4を付けて辞書に登録する。実際の辞
書登録は第10図の右側(ALT−ERNATE TA
BLE)に示すように文字列1bとして登録される。
When the first character a is input, there is no matching character string in the dictionary other than a, so 0UTPUT C0DE 1 (reference number ω) is output as a code word. Then, reference number 4 is added to the expanded character string ab and it is registered in the dictionary. The actual dictionary registration is on the right side of Figure 10 (ALT-ERNATE TA
BLE) is registered as a character string 1b.

続いて2番目のbが文字列の先頭になる。辞書にはbの
他に一致する文字がないので参照番号2を符号語として
出力し、同時に、拡張した文字列baも辞書にないので
、文字列baを2aで表わし、参照番号5を付けて辞書
に登録する。3番目のaが次の文字列の先頭になる。以
下同様に、この処理を続ける。
Then the second b becomes the beginning of the string. Since there is no matching character other than b in the dictionary, the reference number 2 is output as a code word, and at the same time, the expanded string ba is also not in the dictionary, so the string ba is represented by 2a and the reference number 5 is added. Register in the dictionary. The third a becomes the beginning of the next string. This process continues in the same manner.

第8図の復号化処理は第7図の符号化の逆の操作を行う
The decoding process shown in FIG. 8 performs the reverse operation of the encoding process shown in FIG. 7.

第8図のLZW復号化では、符号化時と同様に予め辞書
に全文字につき一文字からなる文字列を初期値として登
録してから復号化を始める。
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.

まずSlで最初の符号(参照番号)を読込み、現在のC
0DEを0LDcodeとし、最初の符号は既に辞書に
登録された一文字の参照番号いずれかに該当することか
ら、入力符号C0DEに一致する文字code(K)を
探し出し、文字Kを出力する。
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 C0DE is searched and the character K is output.

尚、出力した文字には後の例外処理のためFINchi
rにセットしておく。
In addition, the output characters are written to FINchi for later exception handling.
Set it to r.

次に82に進んで次の符号を読込んでC0DEにINc
odeとしてセットする。S3で新たな符号があるか否
か、即ち符号入力の終了の有無をチエツクしてS4に進
み、S3で入力された符号C0DEが辞書に定義(登録
)されているか否かチエツクする。
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.

通常、入力した符号語は前回までの処理で辞書に登録さ
れているため、S5に進んで符号C0DHに対応する文
字列code (ωK)を辞書から読出し、S6で文字
Kを一時的にスタックし、参照番号C0DE(ω)を新
な符号C0DEとして再度S5に戻り、このS5.S6
の手順を再帰的に参照番号ωが一文字Kに至るまで繰り
返し、最後に87に進んでS6でスタックした文字をL
 I FO(Last in FastOul)形式で
ポツプアップして出力する。同時に87において、前回
使った符号ωと今回復元した文字列の最初の1文字Kを
組(ω、K)と表した文字列に、新たな参照番号を付加
して辞書に登録する。
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 FastOul) format. At the same time, at 87, a new reference number is added to a character string in which the previously used code ω and the first character K of the character string restored this time are expressed as a set (ω, K), and the result is registered in the dictionary.

第11図を参照してLZW復号化処理を具体的に説明す
ると次のようになる。
The LZW decoding process will be specifically explained as follows with reference to FIG.

まず第11図で最初の入力符号(1!IPUT C0D
E)は1であり、−文字a、  b、  cについては
既に参照番号1. 2. 3として第10図に示すよう
に辞書に登録されているため、辞書の参照により符号1
に一致する参照番号の文字列aに置き換えて出力する。
First, in Figure 11, the first input code (1! IPUT C0D
E) is 1, - for the letters a, b, c already the reference number 1. 2. Since it is registered in the dictionary as 3 as shown in Figure 10, the code 1 is registered by referring to the dictionary.
The character string a with the reference number that matches is replaced and output.

次の符号2についても同様にして文字すに置き換えて出
力する。このとき前回処理した符号1と今回復号した最
初の1文字すとを組合わせた文字列(1b)に新たな参
照番号4を付加して辞書に登録する。
Similarly, the next code 2 is replaced with a letter S and output. At this time, a new reference number 4 is added to the character string (1b), which is a combination of the previously processed code 1 and the first character decoded, and is registered in the dictionary.

3番目の符号4は辞書の検索により求めた文字列1bか
ら文字列abと置き換えて文字列abを出力する。同時
に前回処理した符号2と今回復号した文字列の1番目の
文字aとの組合せた文字列2a (=ba)に新たな参
照番号5を付加して辞書に登録する。
The third numeral 4 replaces the character string 1b found by searching the dictionary with the character string ab and outputs the character string ab. At the same time, a new reference number 5 is added to a character string 2a (=ba), which is a combination of the previously processed code 2 and the first character a of the currently decoded character string, and is registered in the dictionary.

以下同様に、この処理を繰り返す。This process is repeated in the same manner.

第11図のLZW復号化では次の例外処理がある。The LZW decoding shown in FIG. 11 involves the following exception handling.

この例外処理は、第6番目の入力符号8の復号で生ずる
。符号8は復号時に辞書に定義されておらず、復号でき
ない。この場合には、前回処理した符号5に前回復号し
た文字列baの最初の一文字すを加えた文字列5bを求
め、更に2 a b=babと置き換えて出力する例外
処理を行う。そして、文字列の出力後に前回の符号語5
に今回復号した文字列の1一番目の文字すを加えた文字
列5bに参照番号8を付加して辞書に登録する。
This exception handling occurs in the decoding of the sixth input code 8. Code 8 is not defined in the dictionary at the time of decoding and cannot be decoded. In this case, exceptional processing is performed in which a character string 5b is obtained by adding the first character ``s'' of the previously decoded character string ba to the previously processed code 5, and is further replaced with 2 a b = bab and output. Then, after outputting the string, the previous code word 5
The reference number 8 is added to the character string 5b obtained by adding the first character of the character string just decoded to the character string 5b, and the result is registered in the dictionary.

この例外処理は、第8図の復号化処理フローの84、S
8の処理を通じて行われ、最終的に87で文字列の出力
と新たな文字列に参照番号を付加した辞書への登録が8
7で行われる。
This exception handling is carried out 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.

尚、第8,11図のLZW復号化は、復号側で符号を解
読しながら辞書をリアルタイムで作り出す場合を説明し
たが、符号化の際に作られた辞書をそのまま復号化側に
コピーとして使用することで符号化しても良い。この場
合に復号化側での例外処理は不要になる。
In addition, in the LZW decoding shown in Figures 8 and 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 is used as a copy on the decoding side as it is. It may be encoded by doing this. In this case, exception handling on the decoding side becomes unnecessary.

[発明が解決しようとする課題] このように従来のLZW符号によるデータ圧縮にあって
は、符号化に使用する既に符号化済みの部分列を登録し
た辞書中のインデックス(参照番号)は、第12図に示
すように、辞書の文字列を登録した順番を示す番号で表
わしている。
[Problems to be Solved by the Invention] As described above, in data compression using the conventional LZW code, the index (reference number) in the dictionary in which already encoded subsequences used for encoding are registered is As shown in FIG. 12, the character strings in the dictionary are represented by numbers indicating the order in which they were registered.

従って、符号語として使用される辞書のインデックスは
、文字列が何番目に登録されたかを示すに止まり、イン
デックス間の相関関係は小さい上、各インデックスは符
号語として殆どランダムに使用されるため、インデック
スを固定長のビット数で表わさなければならず且つ辞書
サイズに応じたビット長となり、インデックスの効率の
良い符号化ができない問題があった。
Therefore, the dictionary index used as a codeword only indicates the number in which a character string is registered, and the correlation between the indexes is small, and each index is used almost randomly as a codeword. The index has to be expressed using a fixed number of bits, and the bit length depends on the dictionary size, which poses a problem in that the index cannot be encoded efficiently.

本発明は、このような従来の問題点に鑑みてなされたも
ので、文字列間の冗長性を削減して圧縮率を高めること
のできるデータ圧縮及び復元方式を提供することを目的
とする。
The present invention has been made in view of such conventional problems, and an object of the present invention is to provide a data compression and restoration method that can reduce redundancy between character strings and increase compression ratio.

[課題を解決するための手段] 第1図は本発明の原理説明図である。[Means to solve the problem] FIG. 1 is a diagram explaining the principle of the present invention.

本発明は第1図(a)に示すように、符号化済データを
相異なる部分列に分けて各部分列の毎に異なる参照番号
を付加して辞書TDに登録しておき、入力データを辞書
TDの部分列の内、最大炎一致する部分列の参照番号で
指定して符号化するデータ圧縮方式及び該データ圧縮方
式で得られた符号語から文字列を復元するデータ復元方
式を対象とする。
As shown in FIG. 1(a), the present invention divides encoded data into different subsequences, adds a different reference number to each subsequence, and registers it in a dictionary TD, and input data is divided into different subsequences. The target is a data compression method that encodes by specifying the reference number of the most matching subsequence among the subsequences of the dictionary TD, and a data restoration method that restores a character string from the code word obtained by the data compression method. do.

まず本発明のデータ圧縮方式は、第1図(b)に示すよ
うに、新たな符号化済み部分列を登録する際に、既に登
録済みの部分列との従属関係によって分類される分割辞
書DDiを指定して登録すると共に、辞書全体としての
登録位置を該登録符号化部分列の属する分割辞書より出
現確率の大きい分割辞書群DD1〜D D 、、群内の
部分列の総数nに、辞書全体としての登録位置を該符号
化部分列の属する分割辞書DDi内の参照番号を加えた
番号で指定し、この番号を符号化するように構成する。
First, in the data compression method of the present invention, as shown in FIG. At the same time, the registration position of the entire dictionary is set to the divided dictionary groups DD1 to DD, which have a higher probability of appearance than the divided dictionary to which the registered encoded partial sequence belongs, and the total number n of subsequences in the group. The entire registration position is designated by a number added to the reference number in the divided dictionary DDi to which the encoded subsequence belongs, and this number is configured to be encoded.

一方、本発明のデータ復号方式は、新たな復号化済み部
分列を辞書登録する際に、既に復号化済みの部分列との
従属関係によって分類される分割辞書DDiを指定して
登録すると共に、該復号化部分列の属する分割辞書DD
iより出現確率の大きい分割辞書群DD、〜DD14.
内の部分列の総数に、該復号化部分列の属する分割辞書
DDi内の参照番号を加えた番号で指定された符号を復
号化するように構成する。
On the other hand, in the data decoding method of the present invention, when registering a new decoded subsequence into a dictionary, a divided dictionary DDi classified according to the dependency relationship with already decoded subsequences is specified and registered, and Divided dictionary DD to which the decoded subsequence belongs
Divided dictionary groups DD, ~DD14. with higher appearance probability than i.
The code is configured to decode the code specified by the total number of subsequences in the subsequence plus the reference number in the divided dictionary DDi to which the decoded subsequence belongs.

[作用] このような構成を備えたLZW符号に従ったデータ圧縮
及び復元によれば次の作用が得られる。
[Operations] Data compression and decompression according to the LZW code with such a configuration provides the following effects.

即ち、従来のLZW符号では、入力文字列を相異なる文
字列に分けて符号化する時、現在符号化中の各文字列は
以前に符号化された文字列とは独立に出現するとして符
号化する形式を取っている。
That is, in conventional LZW codes, when an input character string is divided into different character strings and encoded, each character string currently being encoded is encoded as appearing independently of the previously encoded character string. It takes the form of

この方法は、無記憶情報源の符号化には問題ない。しか
し、実際の文章等、多くのデータは記憶情報源とみなす
ことができる。ところが従来のLZW符号では文字列が
出現する履歴を十分利用できておらず、データ圧縮後も
文字列が出現する際の従属性については冗長性が残って
いる。
This method has no problem in encoding memoryless information sources. However, many data such as actual sentences can be considered as memory information sources. However, in the conventional LZW code, the history of occurrences of character strings cannot be fully utilized, and even after data compression, redundancy remains in the dependencies when character strings appear.

第1図(a)は従来のLZW符号化による辞書全体を1
つとして扱う場合の辞書の探索木を示し、この場合、辞
書の探索木の根(root=インデックスO)は空であ
り、LZW符号では符号化中の文字列に対して以前に出
現した文字列の履歴は考えられていないことを示してい
る。
Figure 1(a) shows the entire dictionary by conventional LZW encoding.
In this case, the root of the dictionary search tree (root = index O) is empty, and in the LZW code, the history of strings that previously appeared for the string being encoded is shown. indicates that it has not been considered.

そこで本発明は、符号化文字列間の従属関係をインデッ
クス符号化時に取り込むことによって文字列間の冗長性
を削減して圧縮率を高めることができる点に着目し、第
1図(b)のように、登録辞書を幾つかの分割辞書DD
、〜DD、に分割して持ち、辞書の全体としての登録位
置を示すインデックスを各分割辞書DD、〜DD、を出
現確率の高い順に並べた時の分割辞書群中のインデック
スで表すことにより、圧縮率の向上を図る。
Therefore, the present invention focuses on the fact that the redundancy between character strings can be reduced and the compression rate can be increased by incorporating the dependency relationships between encoded character strings at the time of index encoding. In this way, the registered dictionary is divided into several divided dictionaries DD.
, ~DD, and the index indicating the registration position of the dictionary as a whole is expressed as an index in the divided dictionary group when each divided dictionary DD, ~DD is arranged in order of probability of appearance. Aim to improve compression ratio.

例えば図示のように出現確率の順番に配列された分割辞
書DD、〜DD5の内の分割辞書D D aに黒丸で示
すインデックス7の文字列を登録した場合、符号化され
るインデックスは、登録分割辞書DD4の1つ前までの
分割辞書DD、〜DD3内の文字列の総和 nl+n2+n3=18 に登録分割辞書DD、内のインデックス、例えば分割辞
書DD4のインデックス7を加えた値25で表して符号
化する。
For example, if a character string with index 7 indicated by a black circle is registered in the divided dictionary D D a of the divided dictionaries DD to DD5 arranged in the order of appearance probabilities as shown in the figure, the encoded index will be the registered divided The index in the registered divided dictionary DD, for example, the index 7 of the divided dictionary DD4, is added to the sum of character strings in the divided dictionaries DD, ~DD3 up to one before the dictionary DD4, nl+n2+n3=18, and is expressed as a value 25 and encoded. do.

[実施例] 第2図は本発明の一実施例を示した実施例構成図である
[Embodiment] FIG. 2 is a block diagram showing an embodiment of the present invention.

第2図において、10はCPUrあり、LZW符号に従
った本発明による文字列の符号化によるデータ圧縮及び
データ圧縮により得られた符号語からの文字列の復元処
理を行なう。
In FIG. 2, 10 is a CPUr, which performs data compression by encoding character strings according to the present invention according to the LZW code, and restores character strings from code words obtained by data compression.

CPUl0に対しては可変長符号器/復号器12が設け
られ、具体的には符号アルゴリズムに基づく符号化ソフ
ト及び復号アルゴリズムに基づく復号化ソフトで実現さ
れる。この可変長符号器/復号器12による符号化及び
復号化については、復元文字の順序変換用のスタックメ
モリ14が使用される。
A variable length encoder/decoder 12 is provided for the CPU10, and is specifically realized by encoding software based on a coding algorithm and decoding software based on a decoding algorithm. For encoding and decoding by the variable length encoder/decoder 12, a stack memory 14 for converting the order of restored characters is used.

更にCPUl0に対しては、全体辞書(TD)16、分
割辞書(DD)18及び分割辞書要素の出現順番り格納
メモリ20が設けられる。全体辞書16には従来のLZ
W符号化及び復号化と同様な辞書登録が行なわれる。分
割辞書18は本発明特有の辞書であり、予めN分割され
ており、例えば符号化を例にとると新たな符号化済み文
字列を辞書登録する際に既に登録済みの文字列との従属
関係によって分離される分割辞書DDiを指定して対応
する全体辞書16での登録位置を示すインデックス(ア
ドレス)を登録する。この分割辞書18の中の任意の分
割辞書を指定して文字列アドレスを登録する際に分割辞
書要素の出現順番りが出現順番り格納メモリ20に格納
される。出現順番り格納メモリ20に格納された分割辞
書の出現の順番は、分割辞書18に登録した文字列の辞
書全体としての位置を示す参照番号、即ち符号化しよう
とするインデックスを作成する際に使用される。
Furthermore, for the CPU 10, a total dictionary (TD) 16, a divided dictionary (DD) 18, and a memory 20 for storing divided dictionary elements in the order of their appearance are provided. The general dictionary 16 has the conventional LZ
Dictionary registration similar to W encoding and decoding is performed. The divided dictionary 18 is a dictionary unique to the present invention, and is divided into N parts in advance. Taking encoding as an example, when registering a new encoded character string in the dictionary, the subordination relationship with already registered character strings is determined. The divided dictionary DDi separated by is specified, and an index (address) indicating the registration position in the corresponding overall dictionary 16 is registered. When specifying an arbitrary divided dictionary in the divided dictionary 18 and registering a character string address, the order in which the divided dictionary elements appear is stored in the appearance order storage memory 20. The order of appearance of the divided dictionaries stored in the appearance order storage memory 20 is used to create a reference number indicating the position of the character string registered in the divided dictionary 18 in the entire dictionary, that is, an index to be encoded. be done.

次に本発明の原理を符号化処理を例にとって説明する。Next, the principle of the present invention will be explained using encoding processing as an example.

まず、符号化の過程で、例えば第3図に示すように参照
辞書をいくつかの部分集合、即ち分割辞書DDi  (
i=1〜N)に分割して作成する。そして新たな文字列
を登録する際には、既に登録済みの文字列との従属関係
から新たな文字列を登録する分割辞書を指定して登録す
る。
First, in the encoding process, the reference dictionary is divided into several subsets, that is, divided dictionaries DDi (
i=1 to N). When registering a new character string, the divided dictionary in which the new character string is to be registered is specified and registered based on the dependency relationship with the already registered character strings.

尚、分割辞書の登録データは全体辞書に登録した文字列
のアドレスとなる。
Note that the registered data of the divided dictionary is the address of the character string registered in the entire dictionary.

例えば、第3図に示すように、5つの分割辞書DD、〜
DD、に分割していた場合、新たに登録しようとする文
字列が既に登録済みの文字列との従属関係から分割辞書
DD4に分類され、且つ分割辞書DD4において第7番
目の登録であったとすると、分割辞書DD4内の黒丸で
示すインデックス7のように文字列の分割辞書登録(全
体辞書アドレス)が行なわれる。
For example, as shown in FIG. 3, five divided dictionaries DD, ~
DD, and the character string to be newly registered is classified into the divided dictionary DD4 due to its dependency with the already registered character strings, and is the seventh registration in the divided dictionary DD4. , character strings are registered in the divided dictionary (whole dictionary address) as indicated by index 7 indicated by a black circle in the divided dictionary DD4.

このような分割辞書登録が済んだならば、その時分割辞
書DD、〜DD、に属する文字列が出現しやすい順に分
割辞書を並べる。第3図の場合、出現しやすい順に分割
辞書DD、〜DD、を並べており、分割辞書DD+が最
も出現しやすく、分割辞書DD、が最も出現しにくく、
今回登録を行なった分割辞書DD4は4番目に出現しや
すい順番に位置している。
Once such divided dictionary registration is completed, the divided dictionaries are arranged in the order in which character strings belonging to the time-divided dictionaries DD, to DD are likely to appear. In the case of Fig. 3, the divided dictionaries DD, ~DD, are arranged in the order of ease of appearance, with the divided dictionary DD+ being the most likely to appear, and the divided dictionary DD being the least likely to appear.
The divided dictionary DD4, which has been registered this time, is located in the fourth most likely order of appearance.

このように分割辞書DD、〜DD、を分割辞書に属する
文字列が出現しやすい順に並べたならば、登録を行なっ
た分割辞書DD4の黒丸で示すインデックス7について
辞書全体としての登録位置をインデックスiとして求め
る。
If the divided dictionaries DD, ~DD are arranged in the order in which character strings belonging to the divided dictionaries are likely to appear, the registration position of the entire dictionary for index 7 indicated by the black circle of the registered divided dictionary DD4 is determined by index i. Find it as.

この辞書全体としての登録位置を示すインデックスiは
、例えば符号化中の注目文字列が分割辞書DDx に属
しており、分割辞書DDAのに番目に登録された文字列
であるとすると、辞書全体としての登録位置を示すイン
デックスiは次式で表わすことができる。
For example, if the character string of interest being encoded belongs to the divided dictionary DDx and is the character string registered in the divided dictionary DDA, the index i indicating the registration position in the dictionary as a whole is The index i indicating the registered position of can be expressed by the following equation.

i=   Σ  n  (D  +kj      ・
 ・ ・ (1−)P (11>P (11 但し、n (x)は分割辞書Xの節点数p (x)は分
割辞書Xの出現確率 例えば第3図の分割辞書DD4内のインデックス7の文
字列の登録を例にとって辞書全体としての登録位置を示
すインデックスiを計算すると次のようになる。まずΣ
n (j)は文字登録を行なった分割辞書DD4より1
つ前までの分割辞書DD1〜DD、のそれぞれに登録さ
れた文字列の節点数の総和を表わしていることから、 Σn (j) =nl+n2+n3=6+8+4=18
となる。またにノは文字列の登録を行なった分割辞書D
D4内の登録順番を示すインデックス=7となる。従っ
て辞書全体としてのインデックスiは、 1=18+7=25 として求めることができる。
i= Σ n (D + kj ・
・ ・ (1−)P (11>P (11) where n (x) is the number of nodes in the divided dictionary X p (x) is the appearance probability of the divided dictionary Taking the registration of a character string as an example, calculating the index i that indicates the registration position in the entire dictionary is as follows.First, Σ
n (j) is 1 from the divided dictionary DD4 in which character registration was performed.
Since it represents the total number of nodes of character strings registered in each of the previous divided dictionaries DD1 to DD, Σn (j) = nl + n2 + n3 = 6 + 8 + 4 = 18
becomes. In addition, D is a divided dictionary in which character strings are registered.
The index indicating the registration order in D4 is 7. Therefore, the index i of the entire dictionary can be determined as 1=18+7=25.

従来のLZW符号化方式では、辞書に登録した順番をイ
ンデックスとしているためインデックス間の相関は小さ
くなる。これに対し本発明にあっては、前記第(1)式
でインデックスを求めていることから、従来方式より小
さい番号のインデックスを割り当てることができる。そ
して前記第(1)式で与えられるインデックスは出現し
やすい文字列はど小さい値を持つことになり、インデッ
クスの符号化について固定長符号とせずにインデックス
のビット長より短くなるように符号化することによって
高い圧縮率を得ることができる。
In the conventional LZW encoding method, since the order registered in the dictionary is used as an index, the correlation between indexes becomes small. On the other hand, in the present invention, since the index is calculated using the above-mentioned equation (1), it is possible to allocate an index with a smaller number than in the conventional method. The index given by the above formula (1) will have the smallest value for character strings that are likely to appear, so instead of encoding the index as a fixed length code, encode it so that it is shorter than the bit length of the index. By doing this, a high compression ratio can be obtained.

ここで前記第(1)式で与えられるインデックスiは分
割辞書の累積出現確率の順番となり、この累積出現確率
については次の■、■のいずれかを用いて分割辞書の出
現しやすい順番を求める。
Here, the index i given by the above equation (1) is the order of the cumulative appearance probability of the divided dictionary, and for this cumulative appearance probability, use either of the following ■ or ■ to find the order in which the divided dictionary is likely to appear. .

■分割辞書の出現確率の順番; 各分割辞書のインデックスの個数をn (j)とすると
、j番目の分割辞書DDjの出現確率は、出現確率=n
(j)/n    ・・・ (2)で近似されるため、
分割辞書の出現確率の順番は各分割辞書におけるインデ
ックスの個数n (Dの大きさの順番で表わされる。た
だし前記第(2)式におけるnは、 n= Σn  (D 但し、Nは分割辞書数 で定義される辞書全体としてのインデックスの総数であ
る。
■Order of appearance probabilities of divided dictionaries; If the number of indexes of each divided dictionary is n (j), the appearance probability of the j-th divided dictionary DDj is as follows: Probability of appearance = n
(j)/n... Since it is approximated by (2),
The order of the appearance probabilities of divided dictionaries is expressed in the order of the number of indexes n (D) in each divided dictionary. However, n in the above formula (2) is n = Σn (D However, N is the number of divided dictionaries is the total number of indexes in the entire dictionary defined by .

■分割辞書の遷移確率の順番; 直前文字列の最終文字Kから今回符号化しようとする注
目文字列の属する分割辞書の文字列群jに遷移する確率
p(Klj)を注目文字列を符号化または復号化する毎
に更新しながら求めておき、分割辞書をp(Klj)の
大きさの順で表わす。
■Order of transition probabilities in divided dictionaries: Encode the target character string by determining the probability p (Klj) of transition from the last character K of the previous character string to the character string group j of the divided dictionary to which the target character string to be encoded this time belongs. Alternatively, the divided dictionaries are obtained while being updated each time they are decoded, and the divided dictionaries are expressed in the order of the size of p(Klj).

この分割辞書の遷移確率を用いることで文字列間の冗長
性を効率的に削減することができる。
By using the transition probabilities of this divided dictionary, redundancy between character strings can be efficiently reduced.

次に第4,5図の動作フロー図を参照して本発明による
符号化処理及び復号化処理を詳細に説明する。
Next, the encoding process and decoding process according to the present invention will be explained in detail with reference to the operational flow diagrams of FIGS. 4 and 5.

まず第4図の動作フロー図を参照して本発明の符号化処
理を説明すると次のようになる。尚、第4図において各
ステップにおいてアンダーラインの示した部分が第7図
に示した従来の符号化処理と異なる。
First, the encoding process of the present invention will be explained with reference to the operational flow diagram of FIG. 4 as follows. Note that the underlined portions in each step in FIG. 4 are different from the conventional encoding process shown in FIG. 7.

第4図において、まずSlで初期化処理を行なう。この
初期化処理は次の■〜■の内容をもつ。
In FIG. 4, initialization processing is first performed in Sl. This initialization process has the following contents.

■第1番目の文字を含むように全体辞書TDを初期化す
る。具体的にはアドレスn=0〜255は初期登録が行
なわれた第1番目の文字用に割り当てられることから、
全体辞書TDの先頭アドレスnをn=256とする。
(2) Initialize the entire dictionary TD to include the first character. Specifically, since addresses n=0 to 255 are assigned to the first character for which initial registration has been performed,
Let the starting address n of the entire dictionary TD be n=256.

■分割辞書の先頭アドレスn (i)を全てn(i)−
〇とする。但し、i=0〜分割数である。
■The first address n(i) of the divided dictionary is all n(i)−
Set it as 〇. However, i=0 to the number of divisions.

■最初の文字Kを入力し、これを語頭文字列ωとする。■Input the first letter K and use this as the initial letter string ω.

■入力文字Kが属する分割辞書番号f (K)をf(K
)=dとする。
■The divided dictionary number f (K) to which the input character K belongs is set to f (K
)=d.

以上のSlの初期化処理が済むと82に進み、次の入力
文字Kを読み込む。S3で全ての入力文字の読み込みが
終了したか否かチエツクし、終了していなければS4に
進み、Slでセットした語頭文字列ωに82で読み込ん
だ入力文字Kを加えた文字列(ωK)が全体辞書TDに
あるか否か検索する。文字列(ωK)が全体辞書TDに
あればS5に進んで全体辞書TDにおける文字列(ωK
)を格納しているインデックスωを次の語頭文字列ωと
してS2に戻り、次の入力文字Kを読み込む。
After the above initialization processing of Sl is completed, the process advances to 82 and the next input character K is read. In S3, it is checked whether reading of all input characters has been completed. If not, the process proceeds to S4, and a character string (ωK ) is found in the overall dictionary TD. If the character string (ωK) is in the overall dictionary TD, the process advances to S5 and the character string (ωK) in the overall dictionary TD is
) is stored as the next initial character string ω, the process returns to S2, and the next input character K is read.

82〜S5の繰り返しによりS4で文字列(ωK)が全
体辞書TDになかった場合にはS6に進む。
By repeating steps 82 to S5, if the character string (ωK) is not found in the overall dictionary TD in S4, the process advances to S6.

S6にあっては次の■〜■の処理を行なう。In S6, the following processes (1) to (2) are performed.

■前記第(1)式に基づいてインデックスiを算出し、
可変長符号化によるcode (g (ω))として出
力する。
■Calculate the index i based on the above formula (1),
It is output as code (g (ω)) by variable length encoding.

即ち、文字列(ωK)を登録しようとする分割辞書番号
がdであることから、全ての分割辞書の出現確率p (
x)を求め、現在登録を行なおうとするd番目の出現確
率p (x)より高い出現確率を持つ分割辞書の部分列
の総数を算出し、この総数に分割辞書番号dの分割辞書
内での登録順番を示すインデックスの値を加算した値と
してインデックスiを算出し、これをg(ω)として符
号化して出力する。またこのインデックスiの算出時に
得られた分割辞書の出現の順位h (x)は第2図に示
したように出現順番り格納メモリ20に格納される。
That is, since the divided dictionary number in which the character string (ωK) is to be registered is d, the appearance probability of all divided dictionaries p (
x), calculate the total number of subsequences of the divided dictionary that have a higher occurrence probability than the d-th occurrence probability p (x) that is currently being registered, and add the subsequences in the divided dictionary with the divided dictionary number d to this total number. An index i is calculated by adding the index value indicating the registration order of , and this is encoded and output as g(ω). Further, the appearance order h(x) of the divided dictionary obtained when calculating this index i is stored in the storage memory 20 in the order of appearance as shown in FIG.

■文字列(ωK)を全体辞書TDのアドレスnに登録す
る。
■Register the character string (ωK) at address n of the overall dictionary TD.

■文字列(ωK)を登録した全体辞書TDのアドレスn
を分割辞書番号dの分割辞書DDのアドレスn (d)
に登録する。
■Address n of the overall dictionary TD where the character string (ωK) is registered
The address n of the divided dictionary DD with the divided dictionary number d (d)
Register.

■文字列(ωK)の最後の一文字Kを新たな語頭文字列
ωに置き換える。
■Replace the last character K of the character string (ωK) with a new initial character string ω.

■文字Kが属する分割辞書番号f (K)をf (K)
=dとする。
■ Divided dictionary number f (K) to which the letter K belongs to f (K)
=d.

■全体辞書TDのアドレスnを1つインクリメントする
(2) Increment the address n of the entire dictionary TD by one.

■分割辞書DDのアドレスn (d)を1つインクリメ
ントする。
(2) Increment the address n (d) of the divided dictionary DD by one.

以上の■〜■に示すS6の処理が済むと再びS2に戻っ
て次の入力文字Kを読み込む。
After completing the processing in S6 shown in (1) to (4) above, the process returns to S2 again to read the next input character K.

以上の処理の繰り返しによりS3で全ての入力文字の読
み込みが終了したことが判別されると、S7に進んでS
6の場合と同様にインデックスiを算出し、算出したイ
ンデックスiを可変長符号化したcode (g (ω
))を出力して一連の処理を終了する。
When it is determined in S3 that reading of all input characters has been completed by repeating the above processing, the process advances to S7 and
6, the index i is calculated, and the calculated index i is variable-length coded as code (g (ω
)) is output and the series of processing ends.

第5図は本発明の復号化処理の動作フロー図であり、各
ステップにおいてアンダーラインの示した部分の処理が
第8図の従来処理と異なる。
FIG. 5 is an operational flow diagram of the decoding process according to the present invention, and the underlined parts of each step are different from the conventional process shown in FIG.

第5図において、まずSlで次の■〜■に示す初期化処
理を行なう。
In FIG. 5, first, the following initialization processing shown in (1) to (4) is performed in Sl.

■第1番目の文字を含むように全体辞書TDを初期化す
る。即ち、全体辞書TDのアドレスn=Q〜255は第
1番目の文字用に割り当てられることから全体辞書TD
の先頭アドレスnをn=256とする。
(2) Initialize the entire dictionary TD to include the first character. That is, since the address n=Q~255 of the entire dictionary TD is assigned for the first character, the address n=Q~255 of the entire dictionary TD
Let the start address n of the file be n=256.

■分割辞書DDの先頭アドレスn (i)を全てn(i
)=Oにセットする。但し、iはO〜分割数Nを示す。
■The first address n(i) of the divided dictionary DD is all n(i
) = set to O. However, i indicates O to the number of divisions N.

■最初の符号C0DEを読み込む。■Read the first code C0DE.

■g−’ (code−’ (CODE) )により全
体辞書TDのインデックスωを求める。
(2) Find the index ω of the entire dictionary TD using g-'(code-' (CODE)).

但し、code”は可変長符号を固定長符号に復号する
テーブル。
However, "code" is a table for decoding a variable length code into a fixed length code.

g −1は全体辞書TDのインデックスを分割辞書D 
Dのインデックスに変換するテーブル。
g −1 is the index of the whole dictionary TD divided into dictionary D
Table to convert to index of D.

■ ■で求めた全体辞書TDのインデックスωをω= 
OLDωに置く。
■ The index ω of the entire dictionary TD obtained in ■ is ω=
Place it in OLDω.

■全体辞書インデックスωから第1文字Kを求める。■ Find the first character K from the overall dictionary index ω.

■求めた第1文字Kを出力する3、 ■第1文字Kをに1と置く。■Output the first character K found 3. ■Place the first letter K as 1.

次に82に進んで次の入力符号コードC0DEを読み込
み、Sl−の■と同様にして辞書全体インデックスC0
DEを求め、このインデックスC0DEをINωに置く
Next, proceed to 82 to read the next input symbol code C0DE, and in the same way as ■ in Sl-, the whole dictionary index C0
Determine DE and place this index C0DE in INω.

次に83に進んで全ての入力符号の読み込みが終了した
か否かチエツクしてS4に進み、全体辞書TDにC0D
Eが定義されているか否かチエツクする。通常、入力し
た符号語は前回までの処理で辞書に登録されているため
、S5に進んでC0DHに対応する全体辞書インデック
スにより全体辞書から対応する文字列(ωK)を読み出
し、S6で文字Kを一時的にスタックし、参照番号ωを
新たなC01)EとしてS5に戻る。このS5.S6の
手順を再帰的に全体辞書インデックスωか1文字Kに至
るまで繰り返し、最終的に87に進んでS6でスタック
した文字をLIFO(La+t In Fact 0u
t)形式でポツプアップして出力する。
Next, proceed to 83, check whether reading of all input codes has been completed, proceed to S4, and add C0D to the overall dictionary TD.
Check if E is defined. Normally, the input code word has been registered in the dictionary in the previous processing, so the process proceeds to S5 and reads the corresponding character string (ωK) from the general dictionary using the general dictionary index corresponding to C0DH, and the character K is read out in S6. It is temporarily stuck, the reference number ω is set as a new C01)E, and the process returns to S5. This S5. The procedure in S6 is recursively repeated until the entire dictionary index ω or one character K is reached, and finally the process proceeds to 87 and the stacked characters in S6 are LIFO (La+t In Fact 0u
t) Pop up and output in format.

このS7の処理は次の■〜■の内容をもつ。The process of S7 has the following contents.

■スタックが空になるまでスタックをポツプアップしな
がら格納しである文字を出力する。
■Pop up and store the stack until the stack is empty, then output a certain character.

■復元した第】文字をKJ−と嘗<0、■復元文字の第
1文字に1より次の分割辞書の番号dを求める。
(2) The number d of the next divided dictionary is determined from the restored character KJ- and 嘗<0, and (2) the first character of the restored character is 1.

■(OLDω、K)の組を全体辞書TDのアドレスnに
格納する。
(2) Store the set (OLDω, K) at address n of the entire dictionary TD.

■全体辞書インデックスを分割辞書インデックス変換表
の(j、n (d))のアドレスに、この時の全体辞書
TDのアドレスnを格納する。
(2) Store the address n of the entire dictionary TD at the address (j, n (d)) of the divided dictionary index conversion table.

■全体辞書のアトし・スnを1つインクリメントする。■Increments Atoshi/Sn in the entire dictionary by one.

■分割辞書のアドレスn (d)を1つインクリメント
する。
(2) Increment the address n (d) of the divided dictionary by one.

■全体辞書インデックスINωを0Ll)ωと置く。■Set the overall dictionary index INω as 0Ll)ω.

尚、S5は第8図の従来例と同様な例外処理を行なうも
ので、S4でC0DEが定義されていなかった場合には
S5に進んで次の■〜■の処理を行なつ0 ■S1の■でに1=にと置かれた文字FINcha+を
出力する。
Note that S5 performs exception handling similar to the conventional example shown in FIG. ■Output the character FINcha+, which has already been placed in 1=.

■S1の■でセットされたOLDωをC0DEと置く。■ OLDω set in ■ of S1 is set as C0DE.

■TD(ωKl)の組から求めた全体辞書インデックス
をINωと置く。
(2) Set the overall dictionary index obtained from the set of TD(ωKl) as INω.

次に第5図の81及びS2でテーブルg −1により行
なわれる全体辞書インデックスから分割辞書インデック
スへの変換処理は次の■〜■により行なわれる。
Next, the conversion process from the entire dictionary index to the divided dictionary index, which is performed using the table g-1 at 81 and S2 in FIG. 5, is performed by the following steps 1 to 2.

■出現頻度順に並んだ分割辞書の順番を示す番号jをj
=0とする。
■The number j indicating the order of the divided dictionaries arranged in order of appearance frequency is j
=0.

■分割辞書インデックスXが正である間、次のループを
まわる。
■While the divided dictionary index X is positive, the next loop is executed.

■j=j+1と1つインクリメントする。■Increment by one as j=j+1.

■x=x−n (h (D )を求める。但し、n(h
(j))はj番目の分割辞書内の文字列数(節点個数)
である。
■ Find x=x−n (h (D ). However, n(h
(j)) is the number of strings (number of nodes) in the j-th divided dictionary
It is.

■分割辞書インデックスXがマイナスの値となった時、
j=j−1番目、即ち1つ前の分割辞書で算出されたイ
ンデックスXが分割辞書インデックスの値となる。
■When the divided dictionary index X becomes a negative value,
The j=j-1st index, that is, the index X calculated in the previous divided dictionary, becomes the value of the divided dictionary index.

■ ■で求められた分割辞書の辞書番号jとj番目の分
割辞書内でのインデックスXの組(j、x)を出力する
(2) A pair (j, x) of the dictionary number j of the divided dictionary obtained in (2) and the index X in the j-th divided dictionary is output.

例えば第2図で全体辞書インデックス=25が与えられ
たとすると、j=0とセットした後にj=j+1=1と
してx=25−nl=25−6=19を求め、次にj=
2としてx=19−8=11を求め、続いてj=3とし
てx=11−4=7を求め、更にj=4としてx=7−
8=−1を求める。このj=4でx=−1とマイナスに
なることから1つ前のj=3におけるx=7を分割辞書
インデックスとして求める。即ち、分割辞書DD4内の
黒丸で示すインデックス7が変換値として求まる。
For example, if the overall dictionary index = 25 is given in Fig. 2, after setting j = 0, set j = j + 1 = 1 to obtain x = 25 - nl = 25 - 6 = 19, then set j =
2, find x=19-8=11, then set j=3 to find x=11-4=7, and then set j=4 to find x=7-
Find 8=-1. Since x=-1 at j=4, which is a negative value, x=7 at the previous j=3 is determined as the divided dictionary index. That is, index 7 indicated by a black circle in the divided dictionary DD4 is found as a converted value.

以上説明した第4,5図の符号化及び復号化の動作フて
コーの中で辞書全体の位置を示すインデックスの符号化
コード酸び復号化コードは数の小さいインデックス程、
短い符号を割り当てる公知の技術であるハフマン符号化
等の可変長符号化を用いることができる。また種々のデ
ータを圧縮できるようにユニバーサルな性質を保持させ
るためには、例えば人為的に短し・番号に短い符号長を
割り当(るイライアス(Elia+ )符号を用いれば
よい。
In the encoding and decoding operation graphs of FIGS. 4 and 5 explained above, the encoding code and decoding code of the index indicating the position of the entire dictionary are as small as the index.
Variable length encoding, such as Huffman encoding, which is a known technique for assigning short codes, can be used. Furthermore, in order to maintain universal properties so that various data can be compressed, for example, an Elias (Elia+) code that is artificially shortened and assigns a short code length to the number may be used.

イライアス符号は第6図に示tようにγ符号と6符号で
構成される。イライアス符号のγ符号は2進数に有効桁
を示す接頭語(prefix)を付けたものである。δ
符号はγ符号の接頭語を更にγ符号で表わしたものであ
る1、イライ7ス符号は接頭語より2進数の桁数が分か
るので符号語をビット詰しても一義的に復号することが
できる。
The Elias code is composed of a γ code and 6 codes as shown in FIG. The γ code of the Elias code is a binary number with a prefix indicating a significant digit added thereto. δ
The code is the prefix of the γ code further represented by the γ code.1. With the erase code, the number of binary digits can be determined from the prefix, so even if the code word is bit-packed, it can be unambiguously decoded. can.

「発明の効果」 以上説明してきたように本発明にすれば、辞書登録をい
くつかに分割して持ち2辞書の全体としての登録位置を
示すイー/デ・・!クスを各分割辞書の出現順に並べた
番号中のインデックスで表わすことにより文字列間の冗
長性が削減され、従来のl5ZW符号に比べ高い圧縮率
を得ることができる。
"Effects of the Invention" As explained above, according to the present invention, dictionary registration can be divided into several parts, and the registration position of the two dictionaries can be shown as a whole. By representing each character string by an index in a number arranged in the order of appearance in each divided dictionary, redundancy between character strings can be reduced, and a higher compression rate can be obtained than with the conventional 15ZW code.

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

第1図は本発明の原理説明図; 第2図は実施例構成図; 第3図は本発明の詳細な説明図。 第4図は本発明の符号化処理フロー図 第5図は本発明の復号化処理フロ〜図;第6図は本発明
で用いるイライアス符号説明図:第7図は従来のLZW
符号化処理フロー図:第8図は従来のLZW復号復号化
処理フロー図画9図ZW符号化説明図; 第10図は辞書構成例の説明図; 第11図はLZW復号化説明図である。 図中、 10:CPU 12:可変長符号器/′復号器 14、復元文字の順序変換用スタック J6・全体辞書(TD) 18:分割辞書(DD)
FIG. 1 is a diagram illustrating the principle of the present invention; FIG. 2 is a diagram illustrating the configuration of an embodiment; FIG. 3 is a detailed diagram illustrating the present invention. Fig. 4 is an encoding process flow diagram of the present invention; Fig. 5 is a decoding process flow diagram of the present invention; Fig. 6 is an explanatory diagram of the Elias code used in the present invention; Fig. 7 is a conventional LZW
Encoding process flowchart: FIG. 8 is a conventional LZW decoding process flow diagram; FIG. 9 is an explanatory diagram of ZW encoding; FIG. 10 is an explanatory diagram of a dictionary configuration example; FIG. 11 is an explanatory diagram of LZW decoding. In the figure, 10: CPU 12: Variable length encoder/decoder 14, stack J6 for converting the order of restored characters/total dictionary (TD) 18: divided dictionary (DD)

Claims (2)

【特許請求の範囲】[Claims] (1)符号化済データを相異なる部分列に分けて各部分
列の毎に異なる参照番号を付加して辞書に登録しておき
、入力データを前記辞書の部分列の内、最大長一致する
部分列の参照番号で指定して符号化するデータ圧縮方式
に於いて、 新たな符号化済み部分列を辞書登録する際に、既に登録
済みの部分列との従属関係によって分類される分割辞書
を指定して登録すると共に、辞書全体の登録位置を該登
録符号化部分列の属する分割辞書より出現確率の大きい
分割辞書群内の部分列の総数に、該符号化部分列の属す
る分割辞書内の参照番号を加えた番号で指定し、該番号
を符号化することを特徴とするデータ圧縮方式。
(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. In a data compression method that specifies and encodes a subsequence using its reference number, when registering a new encoded subsequence in a dictionary, a divided dictionary is created that is classified according to the dependency relationship with already registered subsequences. In addition to specifying and registering, the registration position of the entire dictionary is set to the total number of subsequences in the divided dictionary group that have a higher probability of occurrence than the divided dictionary to which the registered encoded subsequence belongs. A data compression method characterized by specifying a number with a reference number added and encoding the number.
(2)復号化済データを相異なる部分列に分けて各部分
列毎に異なる参照番号を付加して辞書に登録しておき、
入力された復元データを前記辞書の部分列の内、最大長
一致する部分列の参照番号で指定して復号化するデータ
復元方式に於いて、新たな復号化済み部分列を辞書登録
する際に、既に復号化済みの部分列との従属関係によっ
て分類される分割辞書を指定して登録すると共に、辞書
全体の登録位置を該復号化部分列の属する分割辞書より
出現確率の大きい分割辞書群内の部分列の総数に、該復
号化部分列の属する前記分割辞書内の参照番号を加えた
番号で指定された符号を復号化することを特徴とするデ
ータ復元方式。
(2) Divide the decoded data into different subsequences, add a different reference number to each subsequence, and register it in the dictionary.
In a data restoration method in which the input restored data is decoded by specifying the reference number of the maximum length matching subsequence among the subsequences in the dictionary, when registering a new decoded subsequence in the dictionary, , specifies and registers a divided dictionary that is classified according to the dependency relationship with the already decoded subsequence, and also registers the registration position of the entire dictionary in a divided dictionary group that has a higher probability of appearance than the divided dictionary to which the decoded subsequence belongs. A data restoration method characterized by decoding a code specified by a number obtained by adding a reference number in the divided dictionary to which the decoded subsequence belongs to the total number of subsequences.
JP2066303A 1990-03-16 1990-03-16 Data compression and decoding system Pending JPH04100322A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2066303A JPH04100322A (en) 1990-03-16 1990-03-16 Data compression and decoding system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2066303A JPH04100322A (en) 1990-03-16 1990-03-16 Data compression and decoding system

Publications (1)

Publication Number Publication Date
JPH04100322A true JPH04100322A (en) 1992-04-02

Family

ID=13311908

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2066303A Pending JPH04100322A (en) 1990-03-16 1990-03-16 Data compression and decoding system

Country Status (1)

Country Link
JP (1) JPH04100322A (en)

Similar Documents

Publication Publication Date Title
JP3273119B2 (en) Data compression / decompression device
JP3278297B2 (en) Data compression method, data decompression method, data compression device, and data decompression device
JP3241788B2 (en) Data compression method
JP3231105B2 (en) Data encoding method and data restoration method
CN116471337A (en) Message compression and decompression method and device based on BWT and LZW
JP3350118B2 (en) Data encoding method and data restoration method
JPH03247167A (en) Data compression system
Ghuge Map and Trie based Compression Algorithm for Data Transmission
JP2774350B2 (en) Data compression method and data restoration method of compressed data
JPH04100322A (en) Data compression and decoding system
JP3241787B2 (en) Data compression method
JP2590287B2 (en) Data compression method and data compression apparatus
JP3199292B2 (en) Run-length extraction method, Huffman code conversion method, and MH coding processing method in Huffman code coding
JPH0628149A (en) Method for compressing plural kinds of data
JP3038233B2 (en) Data compression and decompression device
WO1991013395A1 (en) Data compression and restoration method and device therefor
JPH05152971A (en) Data compressing/restoring method
JPH06161705A (en) Data encoding system and data decoding system
Zia et al. Two-level dictionary-based text compression scheme
JP2825960B2 (en) Data compression method and decompression method
JP3100206B2 (en) Data compression method
JP3108404B2 (en) Data compression device and data decompression device
JP3051501B2 (en) Data compression method
JP3117760B2 (en) Data restoration method
JPH0527943A (en) Data compressing system