JPH0832454A - Data coding and decoding system - Google Patents
Data coding and decoding systemInfo
- Publication number
- JPH0832454A JPH0832454A JP16713194A JP16713194A JPH0832454A JP H0832454 A JPH0832454 A JP H0832454A JP 16713194 A JP16713194 A JP 16713194A JP 16713194 A JP16713194 A JP 16713194A JP H0832454 A JPH0832454 A JP H0832454A
- Authority
- JP
- Japan
- Prior art keywords
- data
- identifier
- history
- data storage
- storage means
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Landscapes
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
(57)【要約】
【目的】 LZ符号の復号化処理を高速化する
【構成】 メモリのアドレス単位を1バイト、一連の文
字からなるデータ列で各文字が1バイトのデータとする
と、新たなデータ列(新規データ列)とこれまでのデー
タ列(履歴データ列)との内容を比較し、2文字以上の
一致がなければ、参照識別子を第1のバッファ6aに格
納し、新規データ列の最初の1文字を非参照データとし
て第2のバッファ6bに格納する。2文字以上の一致が
あれば、履歴参照識別子を第1のバッファ6aに格納
し、履歴データ列での一致するだけの文字列の位置と長
さを表わす履歴参照インデックスを生成し、第2のバッ
ファ6bに格納する。そして、次の同様の比較で得られ
る識別子を第2のバッファ6bで上記の履歴参照インデ
ックスに追加し、この履歴参照インデックスと識別子と
で1バイトの整数倍の長さのデータとなるようにする。
(57) [Abstract] [Purpose] To speed up the decoding process of LZ code [Configuration] If the memory address unit is 1 byte and each character is a 1-byte data string consisting of a series of characters, a new The contents of the data string (new data string) and the previous data string (history data string) are compared, and if there is no match of two characters or more, the reference identifier is stored in the first buffer 6a and the new data string The first character is stored in the second buffer 6b as non-reference data. If there is a match of two or more characters, the history reference identifier is stored in the first buffer 6a, a history reference index indicating the position and length of the matching character string in the history data string is generated, and the second history reference index is generated. Store in buffer 6b. Then, the identifier obtained by the next similar comparison is added to the history reference index in the second buffer 6b so that the history reference index and the identifier become data of an integral multiple of 1 byte. .
Description
【0001】[0001]
【産業上の利用分野】本発明は、情報処理装置のプログ
ラムやデータを高速に圧縮符号化及び復号化する方式に
関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a system for compressing and encoding programs and data of an information processing device at high speed.
【0002】[0002]
【従来の技術】情報処理装置のプログラムやテキストな
どのデータ列を、元データを完全復号可能な形で、圧縮
符号化するアルゴリズムとしては、“IEEE Transa
ctionson Information Theory”Vol.IT-23,N
o.3,pp.337−343のJ.ZivとA.Lempelによ
る論文“A Universal Algorithm for SequentialD
ata Complession"に記載の方式が有効であることが知
られている。これを、以下、簡単に説明する。2. Description of the Related Art As an algorithm for compressing and coding a data string such as a program or text of an information processing device in a form in which original data can be completely decoded, "IEEE Transa
ctionson Information Theory "Vol.IT-23, N
O.3, pp.337-343, by J. Ziv and A. Lempel, "A Universal Algorithm for Sequential D"
It is known that the method described in "ata Complession" is effective. This will be briefly described below.
【0003】この方式による符号化の手順は次の通りで
ある。The coding procedure according to this method is as follows.
【0004】まず、入力されたデータ列を逐次バッファ
に溜めておく。バッファ上のかかるデータ列を履歴デー
タ列という。方式によってタイミングなどは異なるが、
ある程度バッファに履歴データ列が蓄積された段階で、
さらに、入力されたデータ列(以下、新規データ列とい
う)と履歴データ列とを比較し、 A)新規データ列の先頭からの内容と一致するデータ列
(部分データ列)が履歴データ列中に存在すれば、これ
を「履歴参照」といい、これを示す識別子(以下、履歴
参照識別子という)と、その部分データ列の位置を示す
インデックス(以下、参照位置インデックスという)と
一致したデータの長さを示すインデックス(以下、参照
長さインデックスという)とからなる符号(以下、これ
を履歴参照インデックスという)を生成し、履歴参照識
別子,履歴参照インデックスの順に圧縮データ記憶手段
に記憶する。First, the input data string is sequentially stored in a buffer. Such a data string on the buffer is called a history data string. Timing varies depending on the method,
When the history data string is accumulated in the buffer to some extent,
Further, the input data string (hereinafter referred to as a new data string) is compared with the history data string, and A) a data string (partial data string) that matches the contents from the beginning of the new data string is included in the history data string. If it exists, this is referred to as “history reference”, and the length of the data that matches the identifier (hereinafter, referred to as history reference identifier) indicating this and the index (hereinafter referred to as reference position index) indicating the position of the partial data string A code (hereinafter, referred to as a history reference index) including an index indicating the length (hereinafter, referred to as a reference length index) is generated and stored in the compressed data storage unit in the order of the history reference identifier and the history reference index.
【0005】B)新規データ列の先頭からの内容と一致
する部分データ列が履歴データ列中に存在しなければ、
これを「非参照」といい、これを示す識別子(以下、非
参照識別子という)を生成するとともに、新規データ列
の先頭の1文字(あるいは1バイト)を符号(非参照デ
ータという)とし、非参照識別子,非参照データの順で
圧縮データ記憶手段に記憶する。B) If there is no partial data string in the history data string that matches the contents from the beginning of the new data string,
This is called "non-reference", and an identifier indicating this (hereinafter, referred to as non-reference identifier) is generated, and the first character (or 1 byte) of the new data string is used as a code (referred to as non-reference data). The reference identifier and the non-reference data are stored in the compressed data storage means in this order.
【0006】このようにして、新規データ列と履歴デー
タ列とが比較される毎に、圧縮データ記憶手段では、順
次識別子と符号とが追加記憶されていき、バッファで
は、圧縮データ記憶手段に記憶される符号に対応した新
規データ列が、これまでに記憶された履歴データに続い
て記憶されて新たな履歴データとなる。これにより、新
たに追加された履歴データ列も新規データ列との比較対
象となるが、バッファの容量いっぱいになると、新たな
履歴データ列の追加とともに、古い履歴データ列は排除
される。In this way, every time the new data sequence and the history data sequence are compared, the compressed data storage means additionally stores the identifier and the code, and the buffer stores them in the compressed data storage means. A new data string corresponding to the code is stored following the history data stored so far to become new history data. As a result, the newly added history data string is also compared with the new data string, but when the buffer capacity is full, the new history data string is added and the old history data string is excluded.
【0007】上記の識別子や履歴参照インデックスは短
かい符号で構成される。履歴データ列中の部分データ列
に内容が一致する新規データ列の部分はかかる識別子と
履歴参照インデックスとに置換される。これにより、入
力されるデータ列の上記部分データ列に内容が一致する
部分が冗長部分として圧縮されることになり、従って、
新規データ列が圧縮符号化されることになる。The above identifier and history reference index are composed of short codes. The part of the new data string whose contents match the partial data string in the history data string is replaced with the identifier and the history reference index. As a result, the part of the input data string whose content matches the partial data string is compressed as a redundant part, and therefore,
The new data string will be compressed and encoded.
【0008】かかる圧縮データの復号化処理は次の通り
である。The decoding process of such compressed data is as follows.
【0009】予め符号化処理のときと同じ大きさの履歴
データを保持するバッファが設けられ、まず、上記圧縮
データを記憶した圧縮データ記憶手段から最初の符号に
対する識別子を読み取り、この識別子が非参照識別子で
あれば、これに続く1文字分のデータを圧縮データ記憶
手段から読み取って伸長データ記憶手段に記憶するとと
もに、履歴データを保持するバッファにも、履歴データ
列として記憶する。A buffer for holding history data of the same size as that in the encoding process is provided in advance. First, the identifier for the first code is read from the compressed data storage means storing the above compressed data, and this identifier is not referenced. If it is an identifier, the data for one character following this is read from the compressed data storage means and stored in the decompressed data storage means, and is also stored as a history data string in the buffer holding the history data.
【0010】読み出された上記識別子が履歴参照識別子
であれば、これに続く履歴参照インデックスを圧縮デー
タ記憶手段から読み取り、これの参照位置インデックス
と参照長さインデックスとが示す情報内容から、バッフ
ァ上の履歴データの対応する部分データ列を読み取っ
て、伸長データ記憶手段に記憶するとともに、新たな履
歴データ列として、このバッファにそこに既に記憶され
ている履歴データ列に続けて記憶する。If the above-mentioned read identifier is a history reference identifier, the history reference index following it is read from the compressed data storage means, and the information content indicated by the reference position index and the reference length index of the history reference index is stored in the buffer. The corresponding partial data string of the history data is read and stored in the decompressed data storage means, and is also stored as a new history data string following the history data string already stored in this buffer.
【0011】以上の動作が圧縮データ記憶手段の全ての
圧縮データについて繰り返し行なわれ、これにより、圧
縮データの復号が行なわれる。The above operation is repeated for all the compressed data in the compressed data storage means, whereby the compressed data is decoded.
【0012】履歴参照インデックスの構成は、圧縮を行
なうデータの冗長性に応じて最適なビット長を選択する
ことができる。例えば、履歴参照インデックスを固定長
の2進表現する場合を考えると、プログラムのソースコ
ードのように冗長性が高く、部分データ列の長さが9バ
イトを超えるようなデータを圧縮する場合には、履歴参
照インデックスの参照位置インデックスに12ビット
を、参照長さインデックスに4ビットを夫々割り当てる
ことにより、圧縮率を高くすることができる。また、実
行プログラムコードのように冗長性がそれ程高くなく、
部分データ列の長さも9バイトを超えることは殆どない
データを圧縮する場合には、参照位置インデックスを1
1ビット乃至10ビットで、参照長さのインデックスを
3ビットで夫々構成すると、圧縮率が高くなる。With regard to the structure of the history reference index, an optimum bit length can be selected according to the redundancy of data to be compressed. For example, considering the case where the history reference index is expressed in a fixed-length binary, when compressing data with high redundancy such as the program source code and the length of the partial data string exceeds 9 bytes, By allocating 12 bits to the reference position index of the history reference index and 4 bits to the reference length index, the compression rate can be increased. Also, the redundancy is not so high as in the execution program code,
The reference position index is set to 1 when compressing data in which the length of the partial data string rarely exceeds 9 bytes.
If the reference length index is composed of 1 bit to 10 bits and is composed of 3 bits, the compression rate becomes high.
【0013】このように、データの出現パターンをバッ
ファに保持し、それと入力データ列とを比較して符号化
する方法は、一般に、スライディングディクショナリ方
式、あるいはLZ符号化方式と呼ばれ、履歴の参照の仕
方や符号の構成によって様々な方法が提案されている。
この方式の特徴は復号処理が簡単なことであり、従っ
て、プログラムコードやデータの初期値、メニュー画面
データなどといった通常変更を伴わないものをこの方式
で圧縮して記憶し、実行時に復号化して用いるといった
用途に好適である。As described above, a method of holding the appearance pattern of data in a buffer and comparing it with an input data string for encoding is generally called a sliding dictionary method or an LZ encoding method, and refers to a history. Various methods have been proposed depending on the method and the configuration of codes.
The feature of this method is that the decoding process is simple.Therefore, the program code, initial values of data, menu screen data, etc. that are not normally changed are compressed and stored by this method, and are decrypted at the time of execution. It is suitable for applications such as use.
【0014】[0014]
【発明が解決しようとする課題】ところで、このように
符号化された圧縮データでの個々の符号は、元のデータ
でのバイト単位や文字単位とは異なる長さのものとな
る。従来技術では、かかる符号を単一の圧縮データ記憶
手段に生成順にシーケンシャルに記憶していた。また、
その圧縮データの符号を同じシーケンシャルで伸長処理
し、復号するようにしている。By the way, the individual code in the compressed data encoded in this way has a length different from the byte unit or the character unit in the original data. In the conventional technology, such codes are sequentially stored in a single compressed data storage means in the order of generation. Also,
The code of the compressed data is decompressed and decoded in the same sequential manner.
【0015】以下、LZ符号化方式での圧縮データを得
る場合の従来技術を図5により説明する。但し、同図
(a)は圧縮データを、同図(b)は伸長データ(従っ
て、元のデータ)を夫々示し、また、図5(a),
(b)では、非参照識別子10、非参照データ11、履
歴参照識別子12、履歴参照インデックス13及び後述
する履歴複写データを模様で区別するようにしており、
これら模様との対象表も図示している。A conventional technique for obtaining compressed data in the LZ encoding system will be described below with reference to FIG. However, FIG. 5A shows compressed data, FIG. 5B shows decompressed data (hence, original data), and FIG.
In (b), the non-reference identifier 10, the non-reference data 11, the history reference identifier 12, the history reference index 13, and the history copy data described later are distinguished by patterns.
The target table with these patterns is also shown.
【0016】なお、図5(a)での1区切りは8ビット
であり、図5(b)での1区切りは8ビットの文字を表
わしている。また、丸で囲んだ数字は非参照データ11
についての順序を示すものである。It should be noted that one division in FIG. 5 (a) is 8 bits, and one division in FIG. 5 (b) represents an 8-bit character. The numbers circled are non-reference data 11.
It shows the order of.
【0017】図5(b)のデータが元のデータとする場
合、区切りによって示す文字を左から順に1番目の文
字,2番目の文字,3番目の文字,……とする。この例
では、3番目の文字,7番目の文字が1番目の文字と内
容が等しく、4番目の文字,6番目の文字、8番目の文
字が2番目の文字と内容が等しいとする。前の文字と内
容が同じでない文字は、1番目の文字と2番目の文字
と5番目の文字である。前の文字と内容が同じ文字
は白抜きで同じ内容の文字に付された丸で囲んだ数字で
示している。When the data in FIG. 5B is the original data, the characters indicated by the delimiters are the first character, the second character, the third character, ... In this example, it is assumed that the third character and the seventh character have the same content as the first character and the fourth character, the sixth character, and the eighth character have the same content as the second character. The characters that are not the same in content as the previous character are the first character, the second character, and the fifth character. Characters that have the same contents as the previous characters are shown in white and circled numbers attached to the characters that have the same contents.
【0018】ここで、各識別子を1ビット、履歴参照イ
ンデックスを14ビットとすると、かかる入力データ列
(元のデータ)をLZ符号化する場合、図5(a)に示
す元のデータは図5(b)に示されるような圧縮データ
となる。Here, assuming that each identifier is 1 bit and the history reference index is 14 bits, when such input data string (original data) is LZ-encoded, the original data shown in FIG. The compressed data is as shown in (b).
【0019】即ち、1番目の文字と2番目の文字
は、前に同じ内容の文字がないから、非参照データ11
であり、夫々の直前毎に非参照識別子10が付加され
る。従って、これら文字,文字に対する8ビットの
非参照データ11は1ビットの非参照識別子10が付加
されて9ビットのデータとなる。That is, since the first character and the second character have no preceding characters, the non-reference data 11
Therefore, the non-reference identifier 10 is added immediately before each of them. Therefore, the 1-bit non-reference identifier 10 is added to these characters and the 8-bit non-reference data 11 for the characters to become 9-bit data.
【0020】また、3番目の文字と4番目の文字とは1
番目の文字と2番目の文字と内容が同じであるの
で、これら2つの文字に対して1番目の文字と2番目
の文字と同じ内容であることを示す上記の履歴参照イ
ンデックス13(これを、図5(a)では、符号Aとし
て示す)が形成され、これの先頭に1ビットの履歴参照
識別子12が付加される。ここで、履歴参照インデック
ス12が14ビットからなるものとすると、3番目の文
字と4番目の文字の16ビットのデータが14+1=1
5ビットのデータに圧縮されたことになる。The third character and the fourth character are 1
Since the contents of the first character and the second character are the same, the history reference index 13 (which shows the same contents as the first character and the second character for these two characters) In FIG. 5A, a symbol A is formed, and a 1-bit history reference identifier 12 is added to the head of the symbol. Here, if the history reference index 12 consists of 14 bits, the 16-bit data of the third character and the fourth character is 14 + 1 = 1.
This means that the data has been compressed into 5-bit data.
【0021】図5(b)での5番目の文字は非参照デ
ータ11であり、図5(a)に示すように、1ビットの
非参照識別子10が付加される。6番目の文字、7番目
の文字、8番目の文字は夫々、2番目の文字、1番目
の文字、2番目の文字と同じ内容であるから、これ
ら3文字に対して14ビットの履歴参照インデックス1
3が形成され、図5(a)において、符号Bとして示す
ように、1ビットの履歴参照識別子12が付加される。
この場合には、3文字の24ビットのデータが15ビッ
トのデータに圧縮されたことになる。The fifth character in FIG. 5 (b) is the non-reference data 11, and a 1-bit non-reference identifier 10 is added as shown in FIG. 5 (a). The 6th character, 7th character, and 8th character have the same contents as the 2nd character, 1st character, and 2nd character, respectively, so a 14-bit history reference index for these 3 characters 1
3 is formed, and a 1-bit history reference identifier 12 is added, as indicated by a symbol B in FIG.
In this case, the 24-bit data of three characters is compressed into the 15-bit data.
【0022】ところで、図5(a)に示すような圧縮デ
ータの場合、8ビット毎に区分すると、非参照データ1
1や履歴参照データ13の区分とは関係がない区分とな
る。例えば、最初の8ビットの区分は、1ビットの非参
照識別子10と文字に対する非参照データ11の7ビ
ットからなり、次の8ビットの区分は、文字に対する
非参照データ11の1ビットと1ビットの非参照識別子
10と文字に対する非参照データ11の6ビットとか
らなる。一方、メモリへのアクセスはアドレス単位で行
なわれ、アドレス単位は8ビットあるいは16ビットで
ある。アドレス単位を8ビットとすると、例えば、文字
や文字に対する非参照データ11は2つのアドレス
単位にまたがって記憶されることになる。By the way, in the case of compressed data as shown in FIG. 5A, if it is divided into 8 bits, the non-reference data 1
This is a category that is not related to the category of 1 or the history reference data 13. For example, the first 8-bit division consists of 1-bit non-reference identifier 10 and 7 bits of non-reference data 11 for a character, and the next 8-bit division is 1 bit and 1 bit of non-reference data 11 for a character. Of the non-reference identifier 10 and 6 bits of the non-reference data 11 for the character. On the other hand, access to the memory is performed in address units, and the address unit is 8 bits or 16 bits. If the address unit is 8 bits, for example, the character and the non-reference data 11 for the character will be stored over two address units.
【0023】このように、図5(a)に示す圧縮データ
では、非参照データ11や履歴参照インデックス13と
メモリでのアドレスとの対応関係が非常に複雑なものと
なり、かかるメモリから所望の非参照データ11や履歴
参照インデックス13を読み出すときには、対応するア
ドレス単位の割出しと対応する部分の切出しとが必要で
あった。As described above, in the compressed data shown in FIG. 5A, the correspondence between the non-reference data 11 and the history reference index 13 and the address in the memory becomes very complicated, and the desired non-reference data is stored in the memory. When reading the reference data 11 and the history reference index 13, it is necessary to perform indexing in corresponding address units and cutting out corresponding portions.
【0024】ここで、図5(a)に示す圧縮データを、
アドレス単位を1バイト(8ビット)とするメモリに書
き込み、これを図5(a)に示す順で識別子や非参照デ
ータ、履歴参照インデックスを読み出す場合に必要なア
ドレス数(アクセス容量)を示すと、次の表1のように
なる。Here, the compressed data shown in FIG.
The number of addresses (access capacity) required when writing to a memory whose address unit is 1 byte (8 bits) and reading the identifier, non-reference data, and history reference index in the order shown in FIG. , As shown in Table 1 below.
【0025】[0025]
【表1】 [Table 1]
【0026】表1において、例えば、最初の非参照識別
子11を読み出す場合には、この非参照識別子11は1
ビットであるから(取得ビット数1)、1つのアドレス
ですみ、この場合のアクセス容量は1バイトである。ま
た、文字に対する非参照データ11を読み出す場合に
は、8ビットの非参照データ11に対して2つのアドレ
スが必要であり、従って、アクセス容量は2バイトであ
る。文字に対する非参照データ11を読み出す場合で
も同様である。14ビットの履歴参照インデックス13
を読み出す場合には、図5(a)から明らかなように、
3つのアドレスが必要であり、このため、アドレス容量
は3バイトとなる。このようにして、図5(a)に示す
圧縮データを読み出すためには、全取得ビット数が57
ビットであるのに対し、全アクセス容量は17バイト
(=136ビット)となり、2倍以上のアクセス容量が
必要となる。In Table 1, for example, when the first non-reference identifier 11 is read, this non-reference identifier 11 is 1
Since it is a bit (the number of acquired bits is 1), only one address is needed, and the access capacity in this case is 1 byte. Further, when reading the non-reference data 11 for a character, two addresses are required for the 8-bit non-reference data 11, and therefore the access capacity is 2 bytes. The same applies when the non-reference data 11 for a character is read. 14-bit history reference index 13
When reading out, as is clear from FIG.
Since three addresses are required, the address capacity is 3 bytes. In this way, in order to read the compressed data shown in FIG.
While the total access capacity is 17 bytes (= 136 bits), the access capacity is double or more.
【0027】しかも、非参照データや履歴参照インデッ
クスの読出しでは、複数バイト(複数アドレス)にまた
がったデータの切出しや合成が必要である。例えば、図
5(a)における文字に対する非参照データ11を得
るためには、この非参照データが2つのアドレスにまた
がっているので、夫々のアドレスの読出しを行なうとと
もに、夫々のアドレスの読出しデータから非参照データ
11の部分を切り出し、それら切出し部分を合成しなけ
ればならない。このような処理を必要とするため、これ
ら非参照データや履歴参照インデックスを得るのに非常
な時間を要することになる。Moreover, in reading out non-reference data or history reference index, it is necessary to cut out or combine data over a plurality of bytes (a plurality of addresses). For example, in order to obtain the non-reference data 11 for the character in FIG. 5A, since the non-reference data spans two addresses, each address is read and the read data of each address is read. It is necessary to cut out the portion of the non-reference data 11 and combine the cut-out portions. Since such processing is required, it takes a very long time to obtain these non-reference data and history reference index.
【0028】また、従来では、復号処理を行なうための
履歴データをバッファに保持していたが、履歴データ
は、復号処理の進行とともに、内容を更新しなければな
らず、これによっても処理時間がかかるという問題があ
った。In the past, the history data for performing the decoding process was held in the buffer, but the history data must be updated as the decoding process progresses, which also results in processing time. There was a problem of this.
【0029】本発明の目的は、かかる問題を解消し、高
速に圧縮データの復号を行なうことができるようにした
データ符号化及び復号化方式を提供することにある。It is an object of the present invention to provide a data encoding and decoding system which solves the above problem and is capable of decoding compressed data at high speed.
【0030】[0030]
【課題を解決するための手段】上記目的を達成するため
に、本発明は、文字列からなる入力データをそれ以前に
入力された文字列と比較して同一内容の文字列があるか
否かを判定し、その判定結果を表わす識別子を生成する
とともに、以前に同じ内容の文字列がないときには、入
力データの先頭の1文字を非参照データとし、ある場合
には、最も古い同じ内容の文字列の位置と長さを表わす
インデックス(履歴参照インデックス)を生成し、かか
る履歴参照インデックスが元の文字列よりも短かいデー
タであるようにしてデータの圧縮を行なうに際し、この
ようにして得られる圧縮データを、識別子だけの入力順
の配列からなる第1のデータと、非参照データと履歴参
照インデックスとが入力順に配列されてなる第2のデー
タとで構成する。In order to achieve the above object, the present invention compares input data consisting of a character string with a character string input before and determines whether or not there is a character string having the same content. Is generated and an identifier representing the determination result is generated, and if there is no character string with the same content previously, the first character of the input data is made non-reference data, and if there is, the oldest character with the same content is used. An index (history reference index) that represents the position and length of the column is generated, and is obtained in this way when the data is compressed so that the history reference index is shorter than the original character string. The compressed data is composed of first data composed of an array of only identifiers in the input order, and second data composed of non-reference data and history reference indexes arrayed in the input order.
【0031】また、本発明は、上記履歴参照インデック
スの長さが非参照データの長さの整数倍でない場合に
は、この履歴参照インデックスに対する元の文字列に続
く文字列の識別子をこの履歴参照インデックスに追加す
る。Further, according to the present invention, when the length of the history reference index is not an integral multiple of the length of the non-reference data, the history reference is made to the identifier of the character string following the original character string for this history reference index. Add to index.
【0032】[0032]
【作用】識別子は非参照データか履歴参照インデックス
かを示すものであるから、そのビット数はメモリのアド
レス単位のビット数以下とすることができ、従って、上
記第1のデータをメモリに格納する場合には、メモリの
各アドレスに1個ずつ識別子を格納することが可能とな
る。また、履歴参照インデックスの長さを非参照データ
の長さの整数倍とすれば、上記第2のデータは非参照デ
ータの長さを単位として区切ることができ、非参照デー
タの長さをメモリのアドレス単位のビット数に定めるこ
とにより、第2のデータをメモリに格納する場合、メモ
リの各アドレスに1個ずつしか非参照データが格納させ
ず、また、メモリの複数個のアドレスに1個の履歴参照
インデックスのみしか納まらないようにすることが可能
となる。これにより、データの伸長に際しては、メモリ
から圧縮データを読み出す場合、識別子や非参照データ
は1アドレスのアクセスで読み出すことができ、しか
も、かかるアクセスによって識別子や非参照データその
ものが得られることになる。また、履歴参照インデック
スを読み出す場合には、複数アドレスのアクセスを必要
とするが、履歴参照インデックスの長さはデータ圧縮の
観点から短く設定されるから、アクセスするアドレス数
もわずかなものであり、しかも、かかるアクセスによっ
て履歴参照インデックスそのものが得られることにな
る。Since the identifier indicates the non-reference data or the history reference index, the number of bits can be less than or equal to the number of bits in the memory address unit. Therefore, the first data is stored in the memory. In this case, it becomes possible to store one identifier at each address of the memory. Also, if the length of the history reference index is an integral multiple of the length of the non-reference data, the second data can be delimited by the length of the non-reference data, and the length of the non-reference data can be stored in the memory. When the second data is stored in the memory by setting the number of bits in the address unit of, the non-reference data is stored only at one address in the memory, and the non-reference data is stored in the plurality of addresses in the memory. Only the history reference index of can be stored. As a result, when decompressing the data, when reading the compressed data from the memory, the identifier and non-reference data can be read by accessing one address, and furthermore, the identifier and non-reference data itself can be obtained by such access. . Further, when reading the history reference index, it is necessary to access multiple addresses, but since the length of the history reference index is set to be short from the viewpoint of data compression, the number of addresses to be accessed is also small. Moreover, the history reference index itself can be obtained by such access.
【0033】また、履歴参照インデックスの長さは、入
力文字列と比較する既に入力された文字列をどこまで対
象とするかによってきまるが、非常に遡った文字列まで
も対象にすると、履歴参照インデックスは非常に長いも
のとなり、履歴参照インデックスと置換される文字列は
非常に長いものとしなければ、データ圧縮の効果が現わ
れず、短かい文字列に対してはデータ圧縮をすることが
できなくなる。このようなことから履歴参照インデック
スの長さが決められるものであるから、履歴参照インデ
ックスの長さは非参照データの長さの整数倍となるとは
限らない。このような場合、本発明では、上記のよう
に、履歴参照インデックスに次の文字列に対して得られ
る識別子を追加するものであり、これにより、非参照デ
ータの長さの整数倍の長さのデータとすることができ
る。The length of the history reference index depends on how much of the character string that has already been input to be compared with the input character string is to be targeted. Becomes very long, and unless the character string to be replaced with the history reference index is very long, the effect of data compression does not appear, and it becomes impossible to perform data compression for a short character string. Since the length of the history reference index is determined from the above, the length of the history reference index is not always an integral multiple of the length of the non-reference data. In such a case, the present invention adds the identifier obtained for the next character string to the history reference index, as described above, so that the length of an integer multiple of the length of the non-reference data is added. Can be data.
【0034】[0034]
【実施例】以下、本発明の実施例を図面を用いて説明す
る。図1は本発明による符号化方式及び復号化方式の一
実施例を示すブロック図であって、1はCPU(演算処
理装置)、2はROM(読出し専用メモリ)、3はRA
M(随時書込み読出しメモリ)、4はシステムバスであ
る。Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing an embodiment of an encoding system and a decoding system according to the present invention, in which 1 is a CPU (arithmetic processing unit), 2 is a ROM (read only memory), and 3 is an RA.
M (random write / read memory), 4 is a system bus.
【0035】同図において、CPU1とROM2とRA
M3とがシステムバス4で相互に接続されており、シス
テムバス4を介してこれら間のデータのやり取りが行な
われる。CPU1はROM2に格納されているプログラ
ムやデータやRAM3に格納されているデータに基づい
て演算処理を行ない、その演算結果をRAM3に格納す
る。In the figure, CPU 1, ROM 2 and RA
The M3 and the M3 are connected to each other by the system bus 4, and data is exchanged between them via the system bus 4. The CPU 1 performs arithmetic processing based on the programs and data stored in the ROM 2 and the data stored in the RAM 3, and stores the arithmetic result in the RAM 3.
【0036】ROM2には、圧縮処理プログラム2Aや
伸長処理プログラム2B、管理プログラム2C、演算処
理プログラム2D、演算処理データ2Eが格納されてい
る。管理プログラム2Cは電源投入後の初期処理を行な
うためのものであり、圧縮,伸長処理を行なう場合に
は、圧縮処理プログラム2Aあるいは伸長処理プログラ
ム2Bを起動する。また、演算処理プログラム2Dは演
算処理を行なうためのものであり、演算処理データ2E
はこの演算処理を行なうために使用され、圧縮処理プロ
グラム2Aによって圧縮された形で格納されている。The ROM 2 stores a compression processing program 2A, a decompression processing program 2B, a management program 2C, an arithmetic processing program 2D, and arithmetic processing data 2E. The management program 2C is for performing initial processing after power is turned on, and when performing compression / expansion processing, it activates the compression processing program 2A or the expansion processing program 2B. The arithmetic processing program 2D is for performing arithmetic processing, and the arithmetic processing data 2E
Is used to perform this arithmetic processing, and is stored in a compressed form by the compression processing program 2A.
【0037】RAM3には、圧縮処理を行なう際に用い
る履歴バッファ5、圧縮した結果を保持する圧縮データ
記憶バッファ6及び伸長データを保持する伸長データ記
憶バッファ7が設けられ、また、出力先制御フラグ8や
識別子取得フラグ9を格納している。圧縮データ記憶バ
ッファ6は、さらに、第1の圧縮データ記憶バッファ6
a、第2の圧縮データ記憶バッファ6bとに区分されて
いる。The RAM 3 is provided with a history buffer 5 used when performing compression processing, a compressed data storage buffer 6 that holds the result of compression, and an expanded data storage buffer 7 that holds expanded data, and an output destination control flag. 8 and an identifier acquisition flag 9 are stored. The compressed data storage buffer 6 further includes a first compressed data storage buffer 6
a and the second compressed data storage buffer 6b.
【0038】履歴バッファ5は2048バイトの容量を
有しており、FIFO(First InFirst Out)でデ
ータを保持し、新たにデータが読み込まれると、最も古
いデータから順に消去される。The history buffer 5 has a capacity of 2048 bytes, holds data by a FIFO (First In First Out), and when new data is read, the oldest data is erased in order.
【0039】ここで、この実施例で用いている圧縮符号
は、上記従来技術と同様に、次の4つで構成されてい
る。 1)非参照識別子10 2)非参照データ11 3)履歴参照識別子12 4)履歴参照インデックス13。Here, the compression code used in this embodiment is composed of the following four, as in the above-mentioned prior art. 1) Non-reference identifier 10 2) Non-reference data 11 3) History reference identifier 12 4) History reference index 13.
【0040】非参照識別子10と履歴参照識別子12は
1ビットで構成されており、前者は“1”、後者は
“0”とする。上記従来技術の場合と同様に、非参照デ
ータ11は、履歴バッファ5上のどの部分データ列とも
一致しなかったデータであって、8ビットで構成される
ものとする。履歴参照インデックス13は15ビットで
構成され、新規データ列と内容が一致する部分データ列
がこの新規データ列よりも何バイト手前から始まるかを
示す11ビットの位置インデックスと新規データ列と内
容が一致する部分データ列のデータ長を示す4ビットの
長さインデックスとを組み合わせたものとする。次の表
2に位置インデックスと長さインデックスの値と実際の
参照位置と参照長さとの対応を示す。The non-reference identifier 10 and the history reference identifier 12 are composed of 1 bit. The former is "1" and the latter is "0". As in the case of the above-described conventional technique, the non-reference data 11 is data that does not match any partial data string in the history buffer 5, and is composed of 8 bits. The history reference index 13 is composed of 15 bits, and the 11-bit position index that indicates how many bytes before the new data string the content of the new data string starts and the contents match the new data string. A 4-bit length index indicating the data length of the partial data string to be processed is combined. The following Table 2 shows the correspondence between the position index and length index values and the actual reference position and reference length.
【0041】[0041]
【表2】 [Table 2]
【0042】値0の位置インデックスは、他の位置イン
デックスとは異なり、圧縮データの終了コードとして使
用される。伸長処理プログラム2Bは、この値0の位置
インデックスを取得すると、処理を終了する。長さイン
デックスにおいて、参照長さが2バイトであるのに、参
照長インデックスの値を0としているのは、長さ2バイ
トが参照長さの最小であり、4ビットの長さインデック
スを効率良く使うために、値0の参照長インデックスを
参照長さ2バイトに、………、値15の参照長インデッ
クスを長さ17バイトに夫々対応させているためであ
る。Unlike the other position indexes, the position index with the value 0 is used as the end code of the compressed data. When the decompression processing program 2B acquires the position index of this value 0, the processing ends. In the length index, the reference length is 2 bytes, but the value of the reference length index is 0. The length of 2 bytes is the minimum reference length, and a 4-bit length index can be used efficiently. This is because the reference length index of value 0 corresponds to a reference length of 2 bytes, and the reference length index of value 15 corresponds to a length of 17 bytes for use.
【0043】後に詳細に説明するが、圧縮処理プログラ
ム2Aの実行による圧縮処理においては、上記従来技術
のように、履歴バッファ5上の履歴データ列と新規デー
タ列との比較結果に応じて、非参照識別子10と非参照
データ11、もしくは履歴参照識別子12と履歴参照イ
ンデックス13が得られ、これらが圧縮データ記憶バッ
ファ6に供給されて記録されるのであるが、これら識別
子10,12は第1の圧縮データ記憶バッファ6aに、
非参照データ11と履歴参照インデックス13とは第2
の圧縮データ記憶バッファ6bに夫々格納される。As will be described in detail later, in the compression processing by the execution of the compression processing program 2A, as in the above-described conventional technique, the compression processing program 2A determines whether or not the history data string on the history buffer 5 is compared with the new data string. The reference identifier 10 and the non-reference data 11 or the history reference identifier 12 and the history reference index 13 are obtained, and these are supplied to the compressed data storage buffer 6 and recorded. In the compressed data storage buffer 6a,
The non-reference data 11 and the history reference index 13 are second
Are stored in the compressed data storage buffer 6b.
【0044】また、これも後に詳細に説明するが、伸長
処理プログラム2Bの実行による伸長処理では、第1の
圧縮データ記憶バッファ6aに識別子10,12を、第
2の圧縮データ記憶バッファ6bに非参照データ11と
履歴参照インデックス13を夫々格納し、まず、第1の
圧縮データ記憶バッファ6aから識別子を読み取り、そ
の内容(非参照識別子10のときは“1”,履歴参照識
別子12のときは“0”)に応じて、次に第2の圧縮デ
ータ記憶バッファ6bから読み取るデータが非参照デー
タ11であるか、履歴参照インデックス13であるかを
判別する。Further, as will be described later in detail, in the decompression processing by executing the decompression processing program 2B, the identifiers 10 and 12 are stored in the first compressed data storage buffer 6a and the identifiers 10 and 12 are not stored in the second compressed data storage buffer 6b. The reference data 11 and the history reference index 13 are stored respectively. First, the identifier is read from the first compressed data storage buffer 6a, and the contents (“1” for the non-reference identifier 10 and “for the history reference identifier 12”) are read. 0 "), it is determined whether the data read from the second compressed data storage buffer 6b is the non-reference data 11 or the history reference index 13.
【0045】なお、以下の説明では、識別子に関して
“1”の出力や参照(判定)は非参照識別子52の出力
や参照(判定)を示し、“0”の出力や参照(判定)は
履歴参照識別子の出力や参照(判定)を示している。In the following description, the output or reference (judgment) of "1" for the identifier indicates the output or reference (judgment) of the non-reference identifier 52, and the output or reference (judgment) of "0" refers to the history. The output and reference (judgment) of the identifier are shown.
【0046】次に、この実施例の動作(CPU1の処理
動作)を図2により概略的に説明する。ここで、同図
(b)は元のデータ列を示すものであり、図5(b)に
示したデータ列と同じものである。また、図2(a)は
この元のデータ列の圧縮データである。なお、ここで
は、説明を簡単にするため、1文字のビット数を8ビッ
ト(1バイト)とし、また、履歴参照インデックスは1
5ビットとしている。しかし、本発明は、これに限定さ
れるものではない 図2(b)に示す元のデータ列を圧縮処理プログラム2
Aによって圧縮処理する場合、かかるデータの2文字以
上が履歴バッファ5に既に格納されている履歴データの
うちで内容が一致する部分文字列があるか否かを判定
し、1番目の文字と2番目の文字については否であ
るとすると、これらが夫々非参照データ11となり、ま
た、夫々に“1”の非参照識別子10が生成される。そ
して、これら非参照識別子10は順に第1の圧縮データ
記憶バッファ6aに記憶され、文字と2番目の文字
に対する非参照データ11もその順に第2の圧縮データ
記憶バッファ6bに記憶される。Next, the operation of this embodiment (processing operation of the CPU 1) will be schematically described with reference to FIG. Here, FIG. 5B shows the original data string, which is the same as the data string shown in FIG. 5B. Further, FIG. 2A shows compressed data of this original data string. In addition, here, in order to simplify the description, the number of bits of one character is 8 bits (1 byte), and the history reference index is 1
It is 5 bits. However, the present invention is not limited to this. The original data string shown in FIG.
When the compression processing is performed by A, it is determined whether or not there is a partial character string in which the contents of two or more characters of the data are the same in the history data already stored in the history buffer 5, and the first character and the second character If the second character is negative, these become non-reference data 11 respectively, and a non-reference identifier 10 of "1" is generated for each. Then, these non-reference identifiers 10 are sequentially stored in the first compressed data storage buffer 6a, and the non-reference data 11 for the character and the second character are also stored in that order in the second compressed data storage buffer 6b.
【0047】次に、図2(b)での3番目の文字と4番
目の文字からなる文字列は1番目の文字と2番目の文字
とからなる文字列と内容が一致するから、これらに対し
て“0”の履歴参照識別子12と15ビットの履歴参照
インデックス13とが生成され、履歴参照識別子12は
第1の圧縮データ記憶バッファ6aに、15ビットの履
歴参照インデックス13は第2の圧縮データ記憶バッフ
ァ6bに夫々先に記憶された非参照識別子10や非参照
データ11に続けて記憶されるが、この履歴参照インデ
ックス13の生成に際し、3番目の文字と4番目の文字
に続く5番目の文字には必ず非参照識別子10と非参
照データ11が対応するから、この5番目の文字に対
応する非参照識別子11も同じに生成して履歴参照イン
デックス13に最下位ビットとして付加し、履歴参照イ
ンデックス13を16ビット(=2バイト)にして第2
の圧縮データ記憶バッファ6bに記憶する。そして、次
の5番目の文字に対しては、非参照データ11のみを
生成し、これを第2の圧縮データ記憶バッファ6bに記
憶する。Next, since the character string consisting of the third character and the fourth character in FIG. 2 (b) has the same content as the character string consisting of the first character and the second character, On the other hand, a history reference identifier 12 of "0" and a history reference index 13 of 15 bits are generated, the history reference identifier 12 is stored in the first compressed data storage buffer 6a, and the history reference index 13 of 15 bits is stored in the second compressed data. The non-reference identifier 10 and the non-reference data 11 respectively stored in the data storage buffer 6b are sequentially stored, but when the history reference index 13 is generated, the fifth character following the third character and the fourth character is stored. Since the non-reference identifier 10 and the non-reference data 11 always correspond to the character of, the non-reference identifier 11 corresponding to the fifth character is also generated in the same manner and the lowest in the history reference index 13. Added as Tsu DOO, second with a history reference index 13 to 16 bits (= 2 bytes)
Stored in the compressed data storage buffer 6b. Then, for the next fifth character, only the non-reference data 11 is generated and stored in the second compressed data storage buffer 6b.
【0048】このようにして、2以上の文字の新規デー
タ列が履歴データ列の部分データ列と内容が一致しない
場合には、1文字ずつ非参照データ11として第2の圧
縮データ記憶バッファ6bに記憶するとともに、各非参
照データ11毎に非参照識別子10を生成し、第1の圧
縮データ記憶バッファ6aに記憶するが、2以上の文字
の新規データ列が履歴データ列の部分データ列と内容が
一致する場合には、履歴参照識別子12を生成して第1
の圧縮データ記憶バッファ6aに記憶するとともに、履
歴参照インデックス13に次の非参照データ11に対す
る非参照識別子10を付加して2バイトのデータとし、
これを第2の圧縮データ記憶バッファ6bに記憶する。In this way, when the content of the new data string of two or more characters does not match the partial data string of the history data string, the character-by-character non-reference data 11 is stored in the second compressed data storage buffer 6b. While storing, the non-reference identifier 10 is generated for each non-reference data 11 and is stored in the first compressed data storage buffer 6a, but a new data string of two or more characters is a partial data string of the history data string and its contents. If they match, the history reference identifier 12 is generated and
Stored in the compressed data storage buffer 6a, and the non-reference identifier 10 for the next non-reference data 11 is added to the history reference index 13 to form 2-byte data.
This is stored in the second compressed data storage buffer 6b.
【0049】ここで、2文字以上の文字列の内容が一致
したとき、履歴参照インデックス13を用いるのは、履
歴参照インデックス13のビット数が15ビットであ
り、1個の文字のビット数よりも大きく、2文字の文字
列よりも小さいからであり、1文字に対しても履歴参照
インデックス13を用いるようにすると、却ってビット
数が増加してデータ圧縮とはならないからである。Here, when the contents of a character string of two or more characters match, the history reference index 13 is used because the number of bits of the history reference index 13 is 15 bits, rather than the number of bits of one character. This is because it is large and smaller than the character string of two characters, and if the history reference index 13 is used for one character, the number of bits is rather increased and data compression is not performed.
【0050】以上により、第2の圧縮データ記憶バッフ
ァ6bでは、図2(a)に示すように、1バイトずつ区
切ったとき、非参照データ11は1つずつ区切れ、履歴
参照インデックス13は2バイトに区切れる圧縮データ
を得ることができる。かかる圧縮データを記憶する第2
の圧縮データ記憶バッファ6bのアドレス単位が1バイ
トとすると、各非参照データ11は1アドレスに記憶す
ることができ、また、履歴参照インデックス13も2ア
ドレスに記憶することができて、1アドレスに異なる非
参照データ11が同時に記憶されるようなことがない
し、また、1アドレスに非参照データ11と履歴参照イ
ンデックス13が同時に記憶されるようなこともない。As described above, in the second compressed data storage buffer 6b, as shown in FIG. 2 (a), when divided by 1 byte, non-reference data 11 is divided by 1 and history reference index 13 is divided by 2. You can get compressed data that is divided into bytes. Second for storing such compressed data
If the address unit of the compressed data storage buffer 6b is 1 byte, each non-reference data 11 can be stored at 1 address, and the history reference index 13 can be stored at 2 addresses. The different non-reference data 11 are not stored at the same time, and the non-reference data 11 and the history reference index 13 are not stored simultaneously at one address.
【0051】なお、第1の圧縮データ記憶バッファ6a
もアドレス単位を1バイトとし、各アドレスに識別子が
1つずつ順に8つまで記憶される。The first compressed data storage buffer 6a
Also has an address unit of 1 byte, and up to eight identifiers are stored in sequence, one for each address.
【0052】図2(a)に示す圧縮データ列を伸長処理
プログラム2Bによって伸長処理する場合には、各識別
子が圧縮処理のときの順で第1の圧縮データ記憶バッフ
ァ6aまたはこれから移されたメモリに格納されてお
り、また、非参照データ11や履歴参照インデックス1
3などが圧縮処理のときの順で第2の圧縮データ記憶バ
ッファ6bまたはこれから移されたメモリに格納されて
いるが、ここでは、識別子が第1の圧縮データ記憶バッ
ファ6aに、また、非参照データ11や履歴参照インデ
ックス13などが第2の圧縮データ記憶バッファ6bに
夫々格納されているものとする。When decompressing the compressed data string shown in FIG. 2A by the decompression processing program 2B, the first compressed data storage buffer 6a or the memory transferred from the first compressed data storage buffer 6a in the order in which the respective identifiers are compressed. Stored in the non-reference data 11 and history reference index 1
3 and the like are stored in the second compressed data storage buffer 6b or the memory moved from the second compressed data storage buffer 6b in the order of the compression processing, but here, the identifier is stored in the first compressed data storage buffer 6a and is not referenced. It is assumed that the data 11 and the history reference index 13 are stored in the second compressed data storage buffer 6b, respectively.
【0053】次に、第1の圧縮データ記憶バッファ6a
から識別子を1つ読み取り、それが“1”か“0”かそ
の内容から、次に第2の圧縮データ記憶バッファ6bか
ら読み取られる、この識別子に対応した1バイト単位の
データの内容を判定する。図2(a)の場合、最初に読
み取られる識別子は“1”の非参照識別子10であるか
ら、第2の圧縮データ記憶バッファ6bから読み取るデ
ータは非参照データ11であり、これが1番目の文字
として伸長データ記憶バッファ7に記憶される。2番目
の文字についても同様である。Next, the first compressed data storage buffer 6a
One identifier is read from the identifier, and the content of the 1-byte unit data corresponding to this identifier, which is read next from the second compressed data storage buffer 6b, is determined from the content of "1" or "0" or its content. . In the case of FIG. 2A, since the first identifier read is the non-reference identifier 10 of "1", the data read from the second compressed data storage buffer 6b is the non-reference data 11, which is the first character. Is stored in the expanded data storage buffer 7. The same applies to the second character.
【0054】なお、第1の圧縮データ記憶バッファ6a
のアドレス単位は1バイトであり、このため、1アドレ
スからは1バイトのデータ、即ち、8つの識別子が読み
出される。この実施例では、この8つの識別子を順次切
り出して処理するようにしている。The first compressed data storage buffer 6a
The address unit is 1 byte, and therefore, 1 byte of data, that is, 8 identifiers are read from one address. In this embodiment, the eight identifiers are sequentially cut out and processed.
【0055】第1の圧縮データ記憶バッファ6aから読
み取った識別子が“0”の履歴参照識別子12である場
合には、第2の圧縮データ記憶バッファ6bから2バイ
トの読み取りを行ない、これにより、“1”の非参照識
別子10が最下位ビットとして付加された履歴参照イン
デックス13が読み取られる。そして、かかる2バイト
のデータから1ビットの非参照識別子10と15ビット
の履歴参照インデックス13とが分離され、非参照識別
子10はCPU1にそのまま保持しておく。また、履歴
参照インデックス13から上記表2のように設定されて
いる参照位置と参照長さとを求め、これをもとに、伸長
データ記憶バッファ7に記憶されている伸長データの中
の対応する部分データ列を読み取り、これを伸長データ
記憶バッファ7に既に記憶されているデータに続けて記
憶する。この場合、かかる履歴参照インデックス13が
図2(a)で符号Aとして示されるものとすると、伸長
データ記憶バッファ7に既に記憶されている1番目の文
字と2番目の文字とが読み取られ、これらが夫々3
番目の文字,4番目の文字として伸長データ記憶バッフ
ァ7に記憶される。このようにして、履歴参照インデッ
クス13が伸長処理されて元の3番目の文字,4番目の
文字が得られる。When the identifier read from the first compressed data storage buffer 6a is the history reference identifier 12 of "0", 2 bytes are read from the second compressed data storage buffer 6b. The history reference index 13 to which the non-reference identifier 10 of "1" is added as the least significant bit is read. The 1-bit non-reference identifier 10 and the 15-bit history reference index 13 are separated from the 2-byte data, and the non-reference identifier 10 is retained in the CPU 1 as it is. Further, the reference position and the reference length set as shown in Table 2 above are obtained from the history reference index 13, and based on this, the corresponding portion in the decompressed data stored in the decompressed data storage buffer 7 The data string is read and stored following the data already stored in the decompressed data storage buffer 7. In this case, assuming that the history reference index 13 is shown as a symbol A in FIG. 2A, the first character and the second character already stored in the decompressed data storage buffer 7 are read and 3 each
It is stored in the decompression data storage buffer 7 as the second character and the fourth character. In this way, the history reference index 13 is expanded, and the original third and fourth characters are obtained.
【0056】次に、符号Aで示す履歴参照インデックス
13に続く非参照データ11は、先に履歴参照インデッ
クス13の読取りの際に得られて保持されている非参照
識別子10により判定され、5番目の文字として伸長
データ記憶バッファ7に記憶される。また、次の符号B
として示す履歴参照インデックス13については、符号
Aとして示す履歴参照インデックス13の場合と同様で
ある。Next, the non-reference data 11 following the history reference index 13 indicated by the symbol A is judged by the non-reference identifier 10 which was obtained and held when the history reference index 13 was read previously, and the fifth Is stored in the decompression data storage buffer 7 as a character. Also, the following code B
The history reference index 13 indicated by is the same as that of the history reference index 13 indicated by the symbol A.
【0057】このようにして、伸長データ記憶バッファ
7に図2(b)に示す元のデータと同じ伸長データが得
られることになる。In this way, the same decompressed data as the original data shown in FIG. 2B is obtained in the decompressed data storage buffer 7.
【0058】かかる伸長処理による復号化においては、
圧縮データを格納したメモリ、即ち、第2の圧縮データ
記憶バッファ6bのアドレス単位が1バイトである場
合、1バイトの非参照データ11は1回のアクセスで読
み取ることができ、上記従来技術に比べてアクセス時間
が短くて済むし、上記従来技術のような読取りデータの
切取りや合成などの処理が不要となる。In the decoding by such decompression processing,
When the memory storing compressed data, that is, the address unit of the second compressed data storage buffer 6b is 1 byte, the 1-byte non-reference data 11 can be read by one access, Therefore, the access time can be shortened, and the processing such as cutting and synthesizing the read data as in the above-described conventional technique is not necessary.
【0059】また、第2の圧縮データ記憶バッファ6b
から履歴参照インデックス13を読み取る場合も、2つ
のアドレスを続けて読み出せばよく、これらから読み取
られた2バイトのデータを単に繋ぎ合わせるだけでよ
い。この場合、2バイトのデータから1ビットの非参照
識別子10と15ビットの履歴参照インデックス13を
分離する必要があるが、この非参照識別子10は、この
2バイトのデータの最下位ビットであるから、2バイト
のデータに最下位ビットのみが“1”で他のビットが
“0”のデータを論理積処理し、下位1バイトの部分を
抽出することによって得ることができる、また、2バイ
トのデータを1ビットだけ最下位ビット側に右シフトす
ることにより、履歴参照インデックス13が得られ、非
常に簡単な処理である。Also, the second compressed data storage buffer 6b
When the history reference index 13 is read from, the two addresses may be read consecutively, and the 2-byte data read from these may be simply connected. In this case, it is necessary to separate the 1-bit non-reference identifier 10 and the 15-bit history reference index 13 from the 2-byte data, because the non-reference identifier 10 is the least significant bit of the 2-byte data. It can be obtained by logically ANDing data in which only the least significant bit is “1” and the other bits are “0” in the 2-byte data and extracting the lower 1-byte portion. The history reference index 13 is obtained by right-shifting the data by 1 bit to the least significant bit side, which is a very simple process.
【0060】先の表1に対応して、この実施例における
図2の例の場合でのアクセス容量を示すと、次の表3の
ようになる。Corresponding to Table 1 above, the access capacity in the case of the example of FIG. 2 in this embodiment is shown in Table 3 below.
【0061】[0061]
【表3】 [Table 3]
【0062】図2(a)に示す圧縮データを図2(b)
に示すように伸長処理する場合、第1の圧縮データ記憶
バッファ6aからは、1バイト単位のアクセスを4回行
なうことにより、4個の識別子の取得(読取り)を行な
うことになるから、この第1の圧縮データ記憶バッファ
6aでのアクセス容量は合計4バイトであり、また、第
2の圧縮データ記憶バッファ6bからは、1バイト単位
のアクセスを3回行なうことによって3個の非参照デー
タ11の取得(読取り)を行ない、2バイト単位のアク
セスを2回行なうことによって2個の履歴参照インデッ
クス13の取得(読取り)を行なうから、この第2の圧
縮データ記憶バッファ6bでのアクセス容量は合計7バ
イトである。従って、第1の圧縮データ記憶バッファ6
aでのアクセス容量を加えても、表1で示した従来の1
7バイトに比べると、充分小さい容量のアクセスで復号
することができ、従って、アクセスに要する時間が大幅
に短縮できることになる。The compressed data shown in FIG. 2A is converted into FIG.
When the decompression process is performed as shown in (4), four identifiers are acquired (read) from the first compressed data storage buffer 6a by performing one byte unit access four times. The total access capacity of one compressed data storage buffer 6a is 4 bytes, and three non-reference data 11 are accessed from the second compressed data storage buffer 6b by performing one byte unit access three times. Since the two history reference indexes 13 are acquired (read) by performing the acquisition (reading) and the 2-byte unit access twice, the total access capacity of the second compressed data storage buffer 6b is 7 bytes. It is a byte. Therefore, the first compressed data storage buffer 6
Even if the access capacity in a is added, the conventional 1 shown in Table 1
As compared with 7 bytes, it is possible to perform decoding with a sufficiently small capacity of access, and therefore the time required for access can be greatly shortened.
【0063】次に、この実施例の動作をさらに詳細に説
明するが、まず、圧縮処理プログラム2Aによる圧縮処
理を図1と図3を用いて説明する。なお、以下の説明で
は、上記と同様に、内容を比較するデータの単位を1バ
イトとし、この1バイトのデータを1文字と表現する
が、これに限るものではないことは明らかである。Next, the operation of this embodiment will be described in more detail. First, the compression processing by the compression processing program 2A will be described with reference to FIGS. 1 and 3. In the following description, the unit of data whose contents are compared is 1 byte, and the 1-byte data is expressed as 1 character, similarly to the above, but it is obvious that the present invention is not limited to this.
【0064】圧縮処理プログラム2Aは、起動すると、
まず、履歴バッファ5を初期化し(ステップ100)、
次いで、出力先制御フラグ8を“1”に設定する(ステ
ップ101)。この出力先制御フラグ8は、非参照識別
子10や履歴参照識別子12を第1の圧縮データ記憶バ
ッファ6a,第2の圧縮データ記憶バッファ6bのいず
れに格納するかを指示するものであって、“1”のとき
には、第1の圧縮データ記憶バッファ6aに記憶するこ
とを、“0”のときには、第2の圧縮データ記憶バッフ
ァ6bに記憶することを夫々指示しているものとする。When the compression processing program 2A is started,
First, the history buffer 5 is initialized (step 100),
Next, the output destination control flag 8 is set to "1" (step 101). The output destination control flag 8 indicates whether to store the non-reference identifier 10 or the history reference identifier 12 in the first compressed data storage buffer 6a or the second compressed data storage buffer 6b. When it is "1", it is instructed to store it in the first compressed data storage buffer 6a, and when it is "0", it is instructed to store it in the second compressed data storage buffer 6b.
【0065】しかる後、履歴バッファ5に符号化する入
力データをM文字分(但し、Mは1よりも大きい整数)
読み込む(ステップ102)。読込み元は管理プログラ
ム2Cからパラメータで与えられている。ここでは、履
歴参照インデックス13の長さインデックス(上記表2
参照)で表現できる最大長の文字数17をMとし、17
文字(17バイト)を履歴バッファ5に読み込む。ま
た、変数mをMの値に設定する(ステップ103)。こ
の変数mは比較する部分データ列の長さを示している。Thereafter, the input data to be encoded in the history buffer 5 is for M characters (where M is an integer greater than 1).
Read (step 102). The reading source is given as a parameter from the management program 2C. Here, the length index of the history reference index 13 (see Table 2 above).
The maximum number of characters that can be expressed by
The character (17 bytes) is read into the history buffer 5. Further, the variable m is set to the value of M (step 103). This variable m indicates the length of the partial data string to be compared.
【0066】以上の処理が終了すると、次に説明する一
連のステップによる処理に移るが、かかる処理は符号化
する文字列がなくなるまで繰り返される。まず、履歴バ
ッファ5上に読み込んだ最新のm文字とそれ以前に読み
込んだ履歴バッファ5上のデータ(履歴データ列)とを
比較し(ステップ104)、最長の一致文字列を求め
る。この比較は一般的な方法を用いて実現している。こ
の比較の後、一致文字長を評価し(ステップ105)、
2文字以上一致するならば、ステップ106〜ステップ
115を実行し、そうでなければ、ステップ116〜ス
テップ122あるいはステップ123を実行する。When the above process is completed, the process proceeds to a series of steps described below, but this process is repeated until there is no character string to be encoded. First, the latest m characters read into the history buffer 5 are compared with the data (history data string) previously read into the history buffer 5 (step 104) to obtain the longest matching character string. This comparison is achieved using standard methods. After this comparison, the matching character length is evaluated (step 105),
If two or more characters match, steps 106 to 115 are executed, otherwise step 116 to step 122 or step 123 are executed.
【0067】ここで、2文字以上の一致の有無を判定す
るのは、履歴参照インデックス13は15ビットであ
り、1文字のビット数(8ビット)よりも大きく、1文
字のデータを履歴参照インデックスで表わすと、却って
ビット数が増加してデータ圧縮にはならず、データ圧縮
のためには、少なくとも2文字以上のデータでなければ
ならないからである。Here, whether or not there is a match of two or more characters is determined by the history reference index 13 having 15 bits, which is larger than the number of bits of one character (8 bits) and the data of one character is referred to as the history reference index. This is because the number of bits increases and the data compression does not occur, and the data must be at least two characters for data compression.
【0068】まず、2文字以上一致する場合を説明する
と、出力先制御フラグ8を調べ(ステップ106)、こ
れが“1”であれば、“0”の履歴参照識別子12を第
1の圧縮データ記憶バッファ6aに書き込み(ステップ
107)、また、出力先制御フラグ8が“2”であれ
ば、“0”の履歴参照識別子12を第2の圧縮データ記
憶バッファ6bに書き込み(ステップ108)、しかる
後、いずれの場合も、出力先制御フラグ8を2に設定し
て(ステップ109)、一致文字列の比較元の文字列と
の相対距離を11ビット、長さを4ビットの固定長符号
で表わした履歴参照インデックス13を第2の圧縮デー
タ記憶バッファ6bに書き込む(ステップ110)。First, the case where two or more characters match will be described. The output destination control flag 8 is checked (step 106), and if it is "1", the history reference identifier 12 of "0" is stored in the first compressed data storage. Write to the buffer 6a (step 107). If the output destination control flag 8 is "2", write the history reference identifier 12 of "0" to the second compressed data storage buffer 6b (step 108). In either case, the output destination control flag 8 is set to 2 (step 109), and the relative distance between the matching character string and the comparison source character string is represented by 11 bits and the length is represented by a fixed length code of 4 bits. The history reference index 13 is written in the second compressed data storage buffer 6b (step 110).
【0069】その後、一致文字列の長さとまだ符号化処
理を行なっていない未符号化文字列の長さを比較し(ス
テップ111)、未符号化文字列の方が長ければ、変数
Cに一致文字長の値を代入し(ステップ112)、そう
でなければ、変数Cに未符号化文字長の値を代入する
(ステップ113)。しかる後、履歴バッファ5に符号
化する文字を変数Cの値の数だけ新たに履歴データ列と
して書き込み(ステップ114)、変数mに変数Cの値
を加えて一致文字長を引き算した値を再び変数mに代入
する(ステップ115)。Then, the length of the matched character string is compared with the length of the uncoded character string that has not been encoded yet (step 111). If the uncoded character string is longer, it matches variable C. The value of the character length is substituted (step 112), and if not, the value of the uncoded character length is substituted into the variable C (step 113). Then, the number of characters to be encoded is newly written in the history buffer 5 as the number of values of the variable C as a history data string (step 114), the value of the variable C is added to the variable m, and the value obtained by subtracting the matching character length is again obtained. The variable m is substituted (step 115).
【0070】ステップ105で2文字以上の一致がない
ときには、出力先制御フラグ8を調べ(ステップ11
6)、これが“1”であれば、“1”の非参照識別子1
0を第1の圧縮データ記憶バッファ6aに書き込み(ス
テップ117)、出力先制御フラグ8が“2”であれ
ば、“1”の非参照識別子10を第2の圧縮データ記憶
バッファ6bに書き込む(ステップ118)。しかる
後、出力先制御フラグ8を1に設定し(ステップ11
9)、履歴バッファ5上の最新のm文字のうちの先頭1
文字を非参照データ11として第2の圧縮データ記憶バ
ッファ6bに書き込む(ステップ120)。そして、未
符号化文字長が0よりも大きいかどうか調べ(ステップ
121)、0より大きい場合には、履歴バッファ5に符
号化するデータを1文字読み込み(ステップ122)、
そうでない場合には、変数mから1を減ずる(ステップ
123)。If there is no match of two or more characters in step 105, the output destination control flag 8 is checked (step 11
6) If this is “1”, the non-reference identifier 1 of “1”
0 is written to the first compressed data storage buffer 6a (step 117), and if the output destination control flag 8 is "2", the non-reference identifier 10 of "1" is written to the second compressed data storage buffer 6b ( Step 118). Then, the output destination control flag 8 is set to 1 (step 11
9), the first 1 of the latest m characters on the history buffer 5
The character is written as the non-reference data 11 in the second compressed data storage buffer 6b (step 120). Then, it is checked whether or not the uncoded character length is larger than 0 (step 121). If it is larger than 0, one character of the data to be coded is read into the history buffer 5 (step 122),
If not, 1 is subtracted from the variable m (step 123).
【0071】以上のようにしてステップ115,122
または123までの処理が終了すると、変数mが0より
も大きいかどうか調べ(ステップ124)、0よりも大
きければ、ステップ104に戻り、そうでなければ、第
2の圧縮データ記憶バッファ6bに、上記表2に示した
位置インデックスが0の15ビットの履歴参照インデッ
クス13を終了コードとして供給し(ステップ12
5)、圧縮処理プログラム2Aによる処理を終了する。As described above, steps 115 and 122
When the processes up to 123 are completed, it is checked whether or not the variable m is larger than 0 (step 124). If it is larger than 0, the process returns to step 104. Otherwise, the second compressed data storage buffer 6b stores The 15-bit history reference index 13 with the position index 0 shown in Table 2 above is supplied as the end code (step 12
5) The processing by the compression processing program 2A ends.
【0072】圧縮データ記憶バッファ6b上に記憶され
た上記圧縮データ(識別子も含む)は、管理プログラム
2Cの機能により、目的に応じた格納場所に移される。
例えば、演算結果を圧縮退避する場合には、管理プログ
ラム2CがRAM3上の演算結果の格納場所(図1に図
示せず)を読込み元として圧縮処理プログラム2Aを起
動し、圧縮処理プログラム2Aの終了後、RAM3上の
データ退避場所(図1に図示せず)に圧縮データ記憶バ
ッファ6の上記内容を転送する。The compressed data (including the identifier) stored in the compressed data storage buffer 6b is moved to a storage location according to the purpose by the function of the management program 2C.
For example, when compressing and saving the calculation result, the management program 2C activates the compression processing program 2A with the storage location (not shown in FIG. 1) of the calculation result on the RAM 3 as the read source, and ends the compression processing program 2A. After that, the above contents of the compressed data storage buffer 6 are transferred to a data save location (not shown in FIG. 1) on the RAM 3.
【0073】次に、伸長処理プログラム2Bの動作を図
1及び図4を用いて説明する。管理プログラム2Cは、
伸長処理プログラム2Bに対して、第1の入力と第2の
入力という2つの入力元のアドレスを与える。これは夫
々、圧縮処理プログラム2Aでの第1の圧縮データ記憶
バッファ6aの内容と第2の圧縮データ記憶バッファ6
bの内容とに対応している。即ち、管理プログラム2C
は、第1の圧縮データ記憶バッファ6aあるいはその内
容を移動した先のデータを第1の入力とし、第2の圧縮
データ記憶バッファ6bあるいはその内容を移動した先
のデータを第2の入力として伸長処理プログラム2Bに
与える。Next, the operation of the decompression processing program 2B will be described with reference to FIGS. The management program 2C is
The two input source addresses of the first input and the second input are given to the decompression processing program 2B. These are the contents of the first compressed data storage buffer 6a and the second compressed data storage buffer 6 in the compression processing program 2A, respectively.
It corresponds to the contents of b. That is, the management program 2C
Decompresses the first compressed data storage buffer 6a or the data to which the contents have been moved as the first input, and the second compressed data storage buffer 6b or the data to which the contents have been moved as the second input. It is given to the processing program 2B.
【0074】伸長処理プログラム2Bは、起動すると、
まず、識別子取得フラグ9を「未取得」状態に設定する
(ステップ200)。以下に説明するこれ以降の処理
は、全ての圧縮データを復号し終わるまで繰り返され
る。なお、識別子取得フラグ9はCPU1(図1)に次
の識別子を既に取り込んでいるか否かを示すフラグであ
って、「未取得」状態にあるときには、まだ取り込んで
おらず、「取得済み」状態にあるときには、既に取り込
んで保持している状態を夫々示している。後者の場合、
CPU1は、この保持している識別子を用いて次に第2
の入力から取り込むデータが非参照データ11である
か、あるいは履歴参照インデックス13であるかを判定
する。When the decompression processing program 2B is activated,
First, the identifier acquisition flag 9 is set to the "unacquired" state (step 200). The subsequent processes described below are repeated until all the compressed data have been decoded. The identifier acquisition flag 9 is a flag indicating whether or not the CPU 1 (FIG. 1) has already acquired the next identifier, and when it is in the “unacquired” state, it has not been acquired yet and is in the “acquired” state. In the case of 1), the states already taken in and held are shown. In the latter case,
The CPU 1 then uses the retained identifier to execute the second
It is determined whether the data fetched from the input is non-reference data 11 or history reference index 13.
【0075】まず、識別子取得フラグ9を調べ(ステッ
プ201)、これが「未取得」状態に設定されていれ
ば、識別子を上記の第1の入力から取り込む(ステップ
202)。そして、この識別子の内容が“0”かどうか
を判定し(ステップ203)、履歴参照識別子12であ
って“0”ならば、ステップ204〜ステップ209
を、そうでなければ(即ち、非参照識別子10であって
“1”ならば)、ステップ212〜ステップ214を夫
々実行する。First, the identifier acquisition flag 9 is checked (step 201), and if it is set to the "unacquired" state, the identifier is fetched from the first input (step 202). Then, it is judged whether or not the content of this identifier is "0" (step 203), and if the history reference identifier 12 is "0", steps 204 to 209.
Otherwise (that is, if it is the non-reference identifier 10 and "1"), steps 212 to 214 are executed respectively.
【0076】そこで、識別子の内容が“0”である場合
を説明すると、第2の入力から2バイト(2文字)のデ
ータを取り込み(ステップ204)、その16ビット目
から6ビット目までの11ビットを履歴参照インデック
ス13の位置インデックスとして切り出し(ステップ2
05)、次の5ビット目から2ビット目までの4ビット
を履歴参照インデックス13の長さインデックスとして
切り出し(ステップ206)、最後の1ビット目(即
ち、最下位ビット)を、次に第2の入力から取り込むべ
き非参照データ11もしくは履歴参照インデックス13
の識別子として、取得する(ステップ207)。Therefore, the case where the content of the identifier is "0" will be described. 2 bytes (2 characters) of data are fetched from the second input (step 204), and the 16th to 6th bits of the data are read. Cut out the bit as the position index of the history reference index 13 (step 2
05), the next 4 bits from the 5th bit to the 2nd bit are cut out as the length index of the history reference index 13 (step 206), and the last 1st bit (that is, the least significant bit) is set to the second bit. Non-reference data 11 or history reference index 13 that should be imported from
(Step 207).
【0077】そして、さらに、識別子取得フラグ9を
「取得済み」状態に設定して(ステップ208)、履歴
参照インデックス13の位置インデックスが0かどうか
を調べ(ステップ209)、この位置インデックスが0
であれば、圧縮データの終了と判定して伸長処理プログ
ラム2Bによる処理を終了するが、この位置インデック
スが0でなければ、伸長データ記憶バッファ7から履歴
参照インデックス13の位置インデックス,長さインデ
ックスで表わされる一致文字列を取り込み(ステップ2
10)、伸長データ記憶バッファ7に格納されているデ
ータ末尾にこの一致文字列を追加して書き込み(ステッ
プ211)、ステップ201に戻る。Then, the identifier acquisition flag 9 is set to the "acquired" state (step 208), and it is checked whether or not the position index of the history reference index 13 is 0 (step 209).
If so, it is determined that the compression data has ended, and the processing by the decompression processing program 2B is ended. However, if this position index is not 0, the position index and length index of the history reference index 13 from the decompression data storage buffer 7 Capture the matching string represented (step 2
10), the matching character string is added to the end of the data stored in the decompressed data storage buffer 7 and written (step 211), and the process returns to step 201.
【0078】ステップ203で識別子が“0”でないと
判定された場合には、第2の入力から1バイトのデータ
を取り出し(ステップ212)、これを1文字として伸
長データ記憶バッファ7に格納されている文字列の最後
に追加して書き込む(ステップ213)。そして、識別
子取得フラグ9を「取得済み」状態に設定し(ステップ
214)、ステップ201に戻る。If it is determined in step 203 that the identifier is not "0", 1-byte data is extracted from the second input (step 212), and this is stored in the decompression data storage buffer 7 as one character. It is additionally written at the end of the existing character string and written (step 213). Then, the identifier acquisition flag 9 is set to the “acquired” state (step 214) and the process returns to step 201.
【0079】次に、図2に示したデータを例にして、圧
縮処理プログラム2Aによる処理を図1及び図3を用い
て説明する。但し、かかるデータは18バイトよりも充
分に長いものとする。Next, taking the data shown in FIG. 2 as an example, the processing by the compression processing program 2A will be described with reference to FIGS. However, such data is sufficiently longer than 18 bytes.
【0080】図3において、圧縮処理プログラム2Aが
起動されると、図3に示したステップ100からステッ
プ103までの一連の処理がなされた後、ステップ10
4で部分データ列の比較が行なわれる。図2(b)での
1バイト目の最初の文字のデータについては、ステッ
プ104の比較の結果は、履歴バッファ5に最新のm文
字より前に読み込んだデータがないため、一致データな
しとなり、ステップ116に移行する。このとき、ステ
ップ101で出力先制御フラグ8が1に設定されている
から、第1の圧縮データ記憶バッファ6aに“1”の非
参照識別子10が出力され(ステップ117)、第2の
圧縮データ記憶バッファ6bに1番目の文字に対応す
るバイトデータが非参照データ11として書き込まれる
(ステップ120)。ここで、圧縮する元のデータは充
分な長さを持つから、ステップ121の判定は常に
“y”となり、履歴バッファ5に1文字、即ち、最初の
文字が読み込まれ(ステップ122)、ステップ12
4を経由してステップ104に戻り、2番目の文字、
即ち、2バイト目のデータの処理に移る。In FIG. 3, when the compression processing program 2A is started, a series of processing from step 100 to step 103 shown in FIG. 3 is performed, and then step 10
At 4, the partial data strings are compared. As for the data of the first character of the first byte in FIG. 2B, the result of the comparison in step 104 is that there is no data read before the latest m characters in the history buffer 5, so there is no matching data, Go to step 116. At this time, since the output destination control flag 8 is set to 1 in step 101, the non-reference identifier 10 of "1" is output to the first compressed data storage buffer 6a (step 117) and the second compressed data is stored. The byte data corresponding to the first character is written in the storage buffer 6b as the non-reference data 11 (step 120). Here, since the original data to be compressed has a sufficient length, the judgment in step 121 is always "y", and one character, that is, the first character is read into the history buffer 5 (step 122) and step 12
Return to step 104 via 4, the second character,
That is, the processing of the data of the second byte is started.
【0081】2番目の文字に対しても、ステップ10
4の判定は一致データなしとなるので、ステップ116
に移行する。ここで、1番目の文字のデータのステッ
プ119での処理で出力先制御フラグ8が1に設定され
るため、ステップ117に進み、第1の圧縮データ記憶
バッファ6aに“1”の非参照識別子10が書き込まれ
る。そして、ステップ120で第2の圧縮データ記憶バ
ッファ6bに2番目の文字に対応するバイトデータが
非参照データ11として書き込まれる。上記と同様に、
ステップ121の判定は“y”となり、履歴バッファ5
に2番目の文字が書き込まれ(ステップ122)、ス
テップ124を経由してステップ104に戻り、3番目
の文字のデータの処理となる。Also for the second character, step 10
The determination of 4 indicates that there is no matching data, so step 116
Move to Here, since the output destination control flag 8 is set to 1 in the process of step 119 for the data of the first character, the process proceeds to step 117, and the non-reference identifier of "1" is stored in the first compressed data storage buffer 6a. 10 is written. Then, in step 120, the byte data corresponding to the second character is written as the non-reference data 11 in the second compressed data storage buffer 6b. Similar to the above,
The judgment in step 121 is “y”, and the history buffer 5
The second character is written in (step 122), and the process returns to step 104 via step 124 to process the data of the third character.
【0082】3番目の文字と4番目の文字のデータは夫
々1番目の文字と2番目の文字と一致するので、ス
テップ104の比較結果では2文字以上の一致となり、
ステップ106に移行する。ここで、2番目の文字の
データの上記処理でのステップ119で出力先制御フラ
グ8が1に設定されたため、ステップ107に進んで第
1の圧縮データ記憶バッファ6aに“0”の履歴参照識
別子12が書き込まれ、出力先制御フラグ8が2とされ
る(ステップ109)。そして、一致した部分データ列
の位置と長さを表わす履歴参照インデックス13が第2
の圧縮データ記憶バッファ6bに書き込まれる(ステッ
プ110)。これが図2(a)での符号Aである。この
場合には、現在の処理データ(即ち、3番目の文字のデ
ータ)の2バイト前から2バイトの長さ(即ち、文字
,)を参照するので、表2での2の位置インデック
スと0の長さインデックスとが組み合わされた15ビッ
トの符号Aが書き込まれる。Since the data of the third character and the data of the fourth character match the first character and the second character, respectively, the comparison result of step 104 indicates that two or more characters match.
Go to step 106. Here, since the output destination control flag 8 is set to 1 in step 119 in the above processing of the data of the second character, the process proceeds to step 107 and the history reference identifier of "0" is stored in the first compressed data storage buffer 6a. 12 is written and the output destination control flag 8 is set to 2 (step 109). The history reference index 13 representing the position and length of the matched partial data string is the second
Is written in the compressed data storage buffer 6b (step 110). This is the symbol A in FIG. In this case, since the length of 2 bytes (that is, character,) from 2 bytes before the current processing data (that is, the data of the third character) is referred to, the position index of 2 in Table 2 and 0 The 15-bit code A combined with the length index of is written.
【0083】次のステップ111でデータ長が充分長い
と判定されるので、変数Cに一致文字列長の2がセット
され(ステップ112)、履歴バッファ5に3番目の文
字と4番目の文字が新たな履歴データとして追加書き込
まれる(ステップ114)。そして、変数mの値を更新
する(ステップ115)が、加算する変数Cの値と減算
する一致文字数が同じであるため、mの値は不変であ
る。その後、ステップ124を経由してステップ104
に戻り、5番目の文字のデータの処理と移る。Since it is determined in the next step 111 that the data length is sufficiently long, the matching character string length of 2 is set in the variable C (step 112), and the third character and the fourth character are stored in the history buffer 5. It is additionally written as new history data (step 114). Then, although the value of the variable m is updated (step 115), the value of the variable C is the same as the value of the variable C to be added and the number of matching characters to be subtracted is the same. Then, via step 124, step 104
Return to and process the data of the fifth character.
【0084】5バイト目のデータ(即ち、文字のデー
タ)に対しては、ステップ104の判定は一致データな
しとなるので、ステップ116に移行する。このとき、
3番目の文字と4番目の文字のデータの処理でのステッ
プ109で出力先制御フラグ8が2に設定されるため、
第2の圧縮データ記憶バッファ6bに“1”の非参照識
別子10が書き込まれ(ステップ118)、これによ
り、上記の15ビットの履歴参照インデックス13(符
号A)に1ビットの非参照識別子10が加わって16ビ
ット(2バイト)のデータとなる。次いで、第2の圧縮
データ記憶バッファ6bに文字に対応するバイトデー
タが供給される(ステップ120)。そして、上記と同
様に、ステップ121の判定は“y”となり、履歴バッ
ファ5に1文字新たに読み込まれ(ステップ122)、
ステップ124を経由してステップ104に戻り、6番
目の文字のデータの処理に移る。For the data of the fifth byte (that is, the character data), the determination in step 104 indicates that there is no matching data, so the process proceeds to step 116. At this time,
Since the output destination control flag 8 is set to 2 in step 109 in the processing of the data of the third character and the fourth character,
The non-reference identifier 10 of "1" is written in the second compressed data storage buffer 6b (step 118), whereby the one-bit non-reference identifier 10 is added to the above-mentioned 15-bit history reference index 13 (code A). When added, it becomes 16-bit (2-byte) data. Then, the byte data corresponding to the character is supplied to the second compressed data storage buffer 6b (step 120). Then, similarly to the above, the determination in step 121 is "y", and one character is newly read into the history buffer 5 (step 122),
The process returns to step 104 via step 124 to move to processing the data of the sixth character.
【0085】6〜8番目の文字のデータは2〜4番目の
文字と内容が一致するので、ステップ104の比較結果
では2文字以上一致となり、ステップ106に移行す
る。このとき、5番目の文字のデータの処理でのステッ
プ119で出力先制御フラグ8が1に設定されているた
め、第1の圧縮データ記憶バッファ6aに“0”の履歴
参照識別子12が書き込まれる(ステップ107)。そ
して、出力先制御フラグ8が2に設定され(ステップ1
09)、一致した部分データ列の位置と長さを表わす履
歴参照インデックス13が第2の圧縮データ記憶バッフ
ァ6bに出力される(ステップ110)。これが図2
(a)での符号Bである。この場合には、現在の処理デ
ータの4文字(4バイト)前から3文字(3バイト)の
長さを参照するので、履歴参照インデックス13の位置
インデックスは4,長さインデックスは1である。次
に、ステップ111でデータ長が充分長いと判定される
ので、変数Cに一致文字列の文字数3がセットされ(ス
テップ112)、履歴バッファ5に6〜8番目の3文字
を書き込む(ステップ114)。そして、ステップ11
5で変数mの値を更新するが、加算する変数Cの値と減
算する一致文字数が同じため、mの値は不変である。そ
の後、ステップ124を経由してステップ104に戻
り、9番目の文字以降のデータの処理となる。Since the contents of the data of the 6th to 8th characters match the contents of the 2nd to 4th characters, the comparison result of step 104 shows that two or more characters match, and the routine proceeds to step 106. At this time, since the output destination control flag 8 is set to 1 in step 119 in the processing of the fifth character data, the history reference identifier 12 of "0" is written in the first compressed data storage buffer 6a. (Step 107). Then, the output destination control flag 8 is set to 2 (step 1
09), the history reference index 13 representing the position and length of the matched partial data string is output to the second compressed data storage buffer 6b (step 110). This is Figure 2
It is the code B in (a). In this case, since the length of 3 characters (3 bytes) from 4 characters (4 bytes) before the current processing data is referred to, the history reference index 13 has a position index of 4 and a length index of 1. Next, since it is determined in step 111 that the data length is sufficiently long, the number of characters of the matching character string is set to the variable C (step 112), and the 6th to 8th three characters are written in the history buffer 5 (step 114). ). And step 11
Although the value of the variable m is updated by 5, the value of the variable m remains unchanged because the value of the variable C to be added and the number of matching characters to be subtracted are the same. After that, the process returns to step 104 via step 124, and the processing of the data after the ninth character is performed.
【0086】以上のような処理の流れにより、図2
(a)に示すような圧縮データが夫々第1の圧縮データ
記憶バッファ6a,第2の圧縮データ記憶バッファ6b
に得られる。As a result of the above processing flow, FIG.
The compressed data as shown in (a) is the first compressed data storage buffer 6a and the second compressed data storage buffer 6b, respectively.
Can be obtained.
【0087】次に、図2(a)に示す圧縮データから同
図(b)に示す伸長データ(元のデータ)を生成する処
理を図1及び図4を用いて説明する。Next, a process for generating the decompressed data (original data) shown in FIG. 2B from the compressed data shown in FIG. 2A will be described with reference to FIGS. 1 and 4.
【0088】ここで、図1における第1の圧縮データ記
憶手段6aに上記一連の識別子が格納され、第2の圧縮
データ記憶手段6bに上記非参照データ11と履歴参照
インデックス13とからなる一連のデータが格納されて
いるものとすると、前者を第1の入力、後者を第2の入
力として伸長処理プログラム2Bを起動する。Here, the series of identifiers are stored in the first compressed data storage means 6a in FIG. 1, and the series of non-reference data 11 and history reference index 13 are stored in the second compressed data storage means 6b. Assuming that data is stored, the decompression processing program 2B is activated with the former as the first input and the latter as the second input.
【0089】そこで、まず、ステップ200で識別子取
得フラグ9を「未取得」状態に設定するので、ステップ
201の判定の結果、ステップ202に移行して第1の
圧縮データ記憶手段6aから識別子を読み取る。図2
(a)の例では、最初の識別子は“1”の非参照識別子
10であるので、ステップ203の判定の結果、ステッ
プ212に移行して第2の圧縮データ記憶手段6bから
1番目の非参照データ11を読み取り、一番目の文字
として伸長データ記憶バッファ7に書き込む(ステップ
213)。そして、識別子取得フラグ9を「未取得」状
態に設定し(ステップ214)、ステップ201に戻っ
て次の符号の伸長処理に移る。Therefore, first, the identifier acquisition flag 9 is set to the "unacquired" state in step 200, and as a result of the determination in step 201, the process proceeds to step 202 and the identifier is read from the first compressed data storage means 6a. . Figure 2
In the example of (a), since the first identifier is the non-reference identifier 10 of "1", as a result of the determination in step 203, the process moves to step 212 and the first non-reference is made from the second compressed data storage means 6b. The data 11 is read and written as the first character in the expanded data storage buffer 7 (step 213). Then, the identifier acquisition flag 9 is set to the "unacquired" state (step 214), and the process returns to step 201 to proceed to the expansion processing of the next code.
【0090】次の符号の伸長処理では、ステップ214
で識別子取得フラグ9が「未取得」状態に設定されてい
るので、上記と同様に、ステップ201の判定の結果、
ステップ202に移行し、第1の圧縮データ記憶手段6
aから識別子を読み取る。図2(a)では、2番目の識
別子も“1”の非参照識別子10であるので、ステップ
203の判定の結果、ステップ212に移行して第2の
圧縮データ記憶手段6bから第2番目の非参照データ1
1を読み取り、これを2番目の文字として伸長データ
記憶バッファ7に書き込む(ステップ213)。そし
て、識別子取得フラグ9を「未取得」状態に設定し(ス
テップ214)、ステップ201に戻ってさらに次の符
号の伸長処理に移る。In the next code decompression process, step 214
Since the identifier acquisition flag 9 has been set to the “unacquired” state in step 1, the result of the determination in step 201 is similar to the above.
Moving to step 202, the first compressed data storage means 6
Read the identifier from a. In FIG. 2A, the second identifier is also the non-reference identifier 10 of “1”, and as a result of the determination in step 203, the process moves to step 212 and the second compressed data storage means 6b is used to store the second identifier. Non-reference data 1
1 is read and this is written in the decompression data storage buffer 7 as the second character (step 213). Then, the identifier acquisition flag 9 is set to the "unacquired" state (step 214), and the process returns to step 201 to move to the next code decompression process.
【0091】さらに次の符号の伸長処理では、上記のよ
うに、ステップ214で識別子取得フラグ9が「未取
得」状態に設定されているので、上記と同様に、ステッ
プ201の判定の結果、ステップ202に移行して第1
の圧縮データ記憶手段6aから識別子を読み取る。図2
(a)では、3番目の識別子は“0”の履歴参照識別子
12であるので、ステップ203の判定の結果、ステッ
プ204に移行して第2の圧縮データ記憶手段6bから
2バイトのデータを読み取る。図2(a)の例では、符
号Aで示される部分とそれに続く非参照識別子10の1
ビットがまとめて読み出され、ステップ205〜207
で位置インデックスが2,長さインデックスが0の履歴
参照インデックス13と“0”の非参照識別子10(こ
れが、次の4番目の処理の識別子となる)とが得られ
る。そして、識別子取得フラグ9が「取得済」状態に設
定される(ステップ208)。次のステップ209の判
定では、上記のように位置インデックスが0でないの
で、ステップ210に移行し、0の長さインデックスに
より、伸長データ記憶バッファ7でのデータの末尾の2
バイト手前から2バイトのデータ(即ち、図2(b)で
の「Aの参照範囲」として示す範囲の文字と文字)
を取得し、それらを、履歴複写データ,として、伸
長データ記憶バッファ7のデータの末尾に付加する。そ
して、ステップ201に戻り、さらに次の符号の伸長処
理に移る。Further, in the next code decompression process, since the identifier acquisition flag 9 is set to the "unacquired" state in step 214 as described above, the result of the judgment in step 201 is First move to 202
The identifier is read from the compressed data storage means 6a. Figure 2
In (a), since the third identifier is the history reference identifier 12 of "0", as a result of the determination in step 203, the process shifts to step 204 and the 2-byte data is read from the second compressed data storage means 6b. . In the example of FIG. 2A, the part indicated by the symbol A and the following 1 of the non-reference identifier 10
The bits are read together and steps 205-207
A history reference index 13 having a position index of 2 and a length index of 0 and a non-reference identifier 10 of "0" (this is the identifier of the next fourth process) are obtained. Then, the identifier acquisition flag 9 is set to the "acquired" state (step 208). In the next determination in step 209, since the position index is not 0 as described above, the process moves to step 210, and the length index of 0 indicates that the last 2 of the data in the expanded data storage buffer 7 is
2 bytes of data before the byte (that is, characters and characters in the range shown as "reference range of A" in FIG. 2B)
Are added to the end of the data in the decompressed data storage buffer 7 as history copy data. Then, the process returns to step 201, and proceeds to the decompression process of the next code.
【0092】さらに次の符号の処理では、1回前の処理
でのステップ208で識別子取得フラグ9が「取得済」
状態に設定されているので、ステップ201の判定の結
果、ステップ203に移行する。図2(a)の例では、
1回前の処理でのステップ207で取得した4番目の識
別子は“0”の非参照識別子10であるので、ステップ
203の判定の結果、ステップ212に移行して第2の
圧縮データ記憶手段6bから非参照データ11が読み取
られ、5番目の文字として伸長データ記憶バッファ7
に書き込まれる(ステップ213)。そして、ステップ
214で識別子取得フラグ9を「未取得」状態に設定し
てステップ201に戻り、さらに次の符号の伸長処理に
移る。In the processing of the next code, the identifier acquisition flag 9 is "acquired" in step 208 in the processing one time before.
Since the state is set, the process proceeds to step 203 as a result of the determination in step 201. In the example of FIG. 2A,
Since the fourth identifier acquired in step 207 in the process one time before is the non-reference identifier 10 of “0”, as a result of the determination in step 203, the process moves to step 212 and the second compressed data storage means 6b The non-reference data 11 is read from the decompressed data storage buffer 7 as the fifth character.
(Step 213). Then, in step 214, the identifier acquisition flag 9 is set to the “unacquired” state, the process returns to step 201, and the process for expanding the next code is started.
【0093】次の伸長処理では、識別子取得フラグ9が
「未取得」状態に設定されているので、ステップ201
の判定の結果、ステップ202に移行して第1の圧縮デ
ータ記憶手段6aから識別子を読み取る。図2(a)の
例では、5番目の識別子は“0”の履歴参照識別子12
であるので、ステップ203の判定の結果、ステップ2
04に移行して第2の圧縮データ記憶手段6bから2バ
イトのデータを読み取る。図2(a)の例では、符号B
で示される部分とそれに隣接した非参照識別子10の1
ビットがまとめて読み取られる。そして、ステップ20
5〜ステップ207で位置インデックスが4,長さイン
デックスが1の履歴参照インデックス13と“1”の非
参照識別子10とが得られる。次に、識別子取得フラグ
9を「取得済」状態に設定し、ステップ209の判定に
より、位置インデックスが0でないので、ステップ21
0に移行し、履歴参照インデックス13で示される伸長
データ記憶バッファ7のデータの末尾の4バイト手前か
ら3バイト(図2(a)での「Bの参照範囲」と示され
る範囲での非参照データ11である文字と履歴複写デ
ータである文字,)を取り込み、それを伸長データ
記憶バッファのデータ末尾に6番目,7番目,8番目の
文字として追加する。そして、ステップ201に戻り、
さらに次の符号の伸長処理に移る。In the next decompression process, the identifier acquisition flag 9 is set to the "unacquired" state, so step 201
As a result of the determination, the process proceeds to step 202 and the identifier is read from the first compressed data storage means 6a. In the example of FIG. 2A, the fifth identifier is the history reference identifier 12 of “0”.
Therefore, as a result of the determination in step 203, step 2
In step 04, the 2-byte data is read from the second compressed data storage means 6b. In the example of FIG. 2A, the code B
1 of the non-reference identifier 10 adjacent to the part indicated by
The bits are read together. And step 20
In steps 5 to 207, the history reference index 13 with the position index 4 and the length index 1 and the non-reference identifier 10 with "1" are obtained. Next, the identifier acquisition flag 9 is set to the “acquired” state, and the position index is not 0 in the determination of step 209.
0, and 3 bytes from the last 4 bytes before the end of the data of the decompressed data storage buffer 7 indicated by the history reference index 13 (non-reference in the range indicated as “reference range of B” in FIG. 2A) The character which is the data 11 and the character which is the history copy data are fetched and added as the sixth, seventh and eighth characters to the end of the data of the decompression data storage buffer. Then, return to step 201,
Further, the process proceeds to the next code decompression process.
【0094】このように、この実施例では、圧縮データ
の復号に際し、非参照データ11や履歴参照インデック
ス13は、メモリからバイト単位でアクセスして読み取
ることができる。また、識別子は1ビットの符号である
ので、複数ビットの符号の切出しのように複数バイトに
またがることがなく、容易に読み取ることができる。従
って、高速な伸長処理が実現できる。As described above, in this embodiment, when decoding the compressed data, the non-reference data 11 and the history reference index 13 can be accessed and read in byte units from the memory. Also, since the identifier is a 1-bit code, it does not extend over a plurality of bytes as in the case of cutting out a code of a plurality of bits and can be easily read. Therefore, high-speed decompression processing can be realized.
【0095】なお、以上の説明では、入出力の単位を1
バイトあるいは1ビットとしたが、アクセスが高速に行
なえるメモリバウンダリであれば、何ビットであって
も、本発明による符号化及び復号化方式を適用可能であ
る。また、識別子のビット数も1ビット以上でもよい。
この場合、履歴参照インデックスは (メモリバウンダリ×n)−(識別子のビット数) ………(1) で与えられるビット数で構成すればよい。In the above description, the input / output unit is 1
Although the byte or 1 bit is used, the encoding and decoding method according to the present invention can be applied to any number of bits as long as it is a memory boundary that can be accessed at high speed. The number of bits of the identifier may be 1 bit or more.
In this case, the history reference index may be composed of the number of bits given by (memory boundary × n) − (number of bits of identifier) (1).
【0096】また、例えば、先に説明した冗長性が高い
データの場合のように、位置インデックスを12ビッ
ト,長さインデックスを4ビットとして履歴参照インデ
ックスを非参照データの2倍の16ビット構成とした場
合には、上記のように履歴参照インデックスに次の文字
列の識別子を付加するようなことは必要ない。Further, for example, as in the case of the data with high redundancy described above, the position reference index is 12 bits, the length index is 4 bits, and the history reference index has a 16-bit structure which is twice as large as the non-reference data. In this case, it is not necessary to add the identifier of the next character string to the history reference index as described above.
【0097】さらに、図1に示したように、第2の圧縮
データ記憶バッファ6bには、履歴参照できなかったデ
ータ、言い換えれば、入力データ中で非冗長なデータが
出現順に記録される。従って、全く冗長を含まない文字
の列からなるデータを圧縮した場合、第1の圧縮データ
記憶バッファ6aには、非参照識別子10のみが圧縮デ
ータ数と同じ数だけ記憶され、また、第2の圧縮データ
記憶バッファ6bには、入力データそのものが記憶され
ることになる。Further, as shown in FIG. 1, in the second compressed data storage buffer 6b, data whose history cannot be referred to, in other words, non-redundant data in the input data are recorded in the order of appearance. Therefore, when compressing data consisting of character strings that do not include any redundancy, only the non-reference identifiers 10 are stored in the first compressed data storage buffer 6a in the same number as the number of compressed data, and in the second compressed data storage buffer 6a. The input data itself is stored in the compressed data storage buffer 6b.
【0098】[0098]
【発明の効果】以上説明したように、本発明によれば、
符号の復号化のためのメモリアクセスが1ビットのアク
セスと1文字単位のアクセスの2種類でよいため、非常
に高速に行なうことができるし、また、伸長処理時の履
歴参照を伸長したデータそのものを利用して行なうた
め、履歴バッファが不要となり、処理が簡単化して高速
化される。As described above, according to the present invention,
Two types of memory access for decoding the code, 1-bit access and 1-character unit access, can be performed at extremely high speed, and the history itself during decompression processing is decompressed data itself. , The history buffer is unnecessary, and the processing is simplified and speeded up.
【図1】本発明による符号化及び復号化方式の一実施例
を示すブロック図である。FIG. 1 is a block diagram showing an embodiment of an encoding and decoding system according to the present invention.
【図2】図1に示した実施例での圧縮データと伸長デー
タ(元のデータ)との一具体例を示す図である。FIG. 2 is a diagram showing a specific example of compressed data and decompressed data (original data) in the embodiment shown in FIG.
【図3】図1における圧縮処理プログラムの流れを示す
フローチャートである。FIG. 3 is a flowchart showing a flow of a compression processing program in FIG.
【図4】図1における伸長処理プログラムの流れを示す
フローチャートである。4 is a flowchart showing a flow of a decompression processing program in FIG.
【図5】従来の符号化及び復号化方式のでの圧縮データ
と伸長データ(元のデータ)との一具体例を示す図であ
る。FIG. 5 is a diagram showing a specific example of compressed data and decompressed data (original data) in a conventional encoding and decoding method.
1 演算処理装置 2 読出し専用メモリ 2A 圧縮処理プログラム 2B 伸長処理プログラム 2C 管理プログラム 2D 演算処理プログラム 2E 演算処理データ 3 随時書込み読出しメモリ 4 システムバス 5 履歴バッファ 6 圧縮データ記憶バッファ 6a 第1の圧縮データ記憶バッファ 6b 第2の圧縮データ記憶バッファ 7 伸長データ記憶バッファ 8 出力先制御フラグ 9 識別子取得フラグ 10 非参照識別子 11 非参照データ 12 履歴参照識別子 13 履歴参照インデックス 1 arithmetic processing unit 2 read-only memory 2A compression processing program 2B decompression processing program 2C management program 2D arithmetic processing program 2E arithmetic processing data 3 occasional writing / reading memory 4 system bus 5 history buffer 6 compressed data storage buffer 6a first compressed data storage Buffer 6b Second compressed data storage buffer 7 Decompression data storage buffer 8 Output destination control flag 9 Identifier acquisition flag 10 Non-reference identifier 11 Non-reference data 12 History reference identifier 13 History reference index
Claims (5)
モリに蓄積し、 蓄積された文字列の中で複数回繰り返し出現する部分文
字列を検索し、 2回目以降に出現する同じ内容の部分文字列を同じ内容
の先頭の部分文字列を指示する符号に変換して圧縮する
とともに、圧縮されない部分文字列と該符号毎に識別子
を生成し、 該圧縮されない部分文字列と該部分文字列を指示する符
号が入力順に配列されてなるデータと、該識別子が生成
順に配列されてなるデータとを別々に出力することを特
徴とするデータ符号化方式。1. A sequentially input character string is stored in a memory, a partial character string that appears repeatedly a plurality of times is searched in the stored character string, and a partial character string of the same content that appears after the second time is searched. Is converted into a code indicating the first partial character string of the same content and compressed, and an uncompressed partial character string and an identifier are generated for each code, and the uncompressed partial character string and the partial character string are specified. A data coding method, wherein data in which codes are arranged in an input order and data in which the identifiers are arranged in a generation order are separately output.
積する履歴バッファと、 1文字のデータバウンダリ単位で記憶する圧縮データ記
憶手段と、 1文字のデータバウンダリ単位で記憶する伸長データ記
憶手段と、 新たに入力された文字列と該履歴バッファ上の文字列を
比較し、2文字以上一致する文字列があるとき、履歴参
照識別子と、新たに入力された該文字列と一致する該履
歴バッファ上の文字列での部分文字列の位置及び長さを
示す履歴参照インデックスとを生成して圧縮データ記憶
手段に追加格納し、2文字以上一致する文字列がないと
きには、新たに入力された該文字列の先頭1文字を非参
照データとするとともに、非参照識別子を生成し、該非
参照データと該非参照識別子とを圧縮データ記憶手段に
追加格納する処理を繰り返し、該圧縮データ記憶手段に
履歴参照識別子,非参照識別子と履歴参照インデック
ス,非参照データとからなる圧縮データを得るようにし
た圧縮処理手段と、 該圧縮データの識別子を取り込み、取り込んだ該識別子
が非参照識別子であるときには、該圧縮データから該非
参照データ1個分のデータを取り込み、1文字のデータ
として該伸長データ記憶手段に追加格納し、該圧縮デー
タから取り込んだ識別子が履歴参照識別子であるときに
は、該圧縮データから履歴参照インデックス1個分のデ
ータを取り込み、その内容に基づいて、既に該伸長デー
タ記憶手段に格納されている文字列のうちの該履歴参照
インデックスで指示される部分文字列を取り込んで該伸
長データ記憶手段に追加格納する伸長処理手段とを有す
るデータ符号化及び復号化方式において、 前記圧縮データ記憶手段は、第1,第2の圧縮データ記
憶手段からなり、 前記圧縮処理手段は、該第1の圧縮データ記憶手段に前
記履歴参照識別子と非参照識別子とを格納し、該第2の
圧縮データ記憶手段に前記履歴参照インデックスと非参
照データとを格納することを特徴とするデータ符号化及
び復号化方式。2. A history buffer for accumulating sequentially input character strings, compressed data storage means for storing in one character data boundary units, decompressed data storage means for storing in one character data boundary units, and The character string input to is compared with the character string in the history buffer, and when there is a character string that matches two or more characters, the history reference identifier and the newly input character string in the history buffer that match A history reference index indicating the position and length of a partial character string in the character string is generated and additionally stored in the compressed data storage means, and when there is no character string that matches two or more characters, the newly input character string The process of generating the non-reference identifier by adding the first character of the non-reference data to the non-reference data and additionally storing the non-reference data and the non-reference identifier in the compressed data storage means is repeated. Then, compression processing means for obtaining compressed data consisting of a history reference identifier, a non-reference identifier, a history reference index, and non-reference data in the compressed data storage means, and an identifier of the compressed data, and the captured identifier Is a non-reference identifier, the data corresponding to one piece of the non-reference data is fetched from the compressed data and additionally stored in the decompressed data storage means as one character data, and the identifier fetched from the compressed data is the history reference identifier. At some time, data of one history reference index is fetched from the compressed data, and based on the content, a partial character designated by the history reference index in the character string already stored in the decompressed data storage means. Data encoding and decoding having decompression processing means for taking in a column and additionally storing it in the decompressed data storage means In the method, the compressed data storage means comprises first and second compressed data storage means, and the compression processing means stores the history reference identifier and non-reference identifier in the first compressed data storage means. A data encoding and decoding method, wherein the history reference index and non-reference data are stored in the second compressed data storage means.
される部分文字列に続く部分文字列に対して生成する識
別子を、前記第2の圧縮データ記憶手段で、前記履歴参
照インデックスに付加して格納し、 該識別子が付加された履歴参照インデックスのデータ長
を前記非参照データのデータ長の整数倍とすることを特
徴とするデータ符号化及び復号化方式。3. The compression processing means according to claim 2, wherein the second compressed data storage means generates an identifier generated for a partial character string following the partial character string converted into the history reference index, A data encoding and decoding method, wherein the data length of the history reference index added to the history reference index is stored, and the data length of the history reference index added with the identifier is an integral multiple of the data length of the non-reference data.
の出力を指示し、第2の状態で前記第2の圧縮データ記
憶手段への出力を指示する出力先制御フラグと、識別子
の「取得済み」か「未取得」かを示す識別子取得フラグ
とを設け、 前記圧縮処理手段は、 圧縮処理の開始時、該出力先制御フラグを第1の状態に
設定し、 圧縮処理時、前記履歴バッファ上の文字列中に入力され
る文字列と2文字以上一致する部分文字列がないときに
は、該出力先制御フラグの状態に応じて前記非参照識別
子を前記第1または第2の圧縮データ記憶手段に記憶し
た後、該出力先制御フラグを第1の状態に設定し、 圧縮処理時、前記履歴バッファ上の文字列中に入力され
る文字列と2文字以上一致する部分文字列があるときに
は、該出力先制御フラグの状態に応じて前記履歴参照識
別子を前記第1または第2の圧縮データ記憶手段に記憶
した後、該出力先制御フラグを第2の状態に設定し、 前記伸長処理手段は、 前記第1または第2の圧縮データ記憶手段から取り込ん
だ識別子の保持手段を有しており、 伸長処理の開始時、前記識別子取得フラグを「未取得」
状態に設定し、 前記識別子取得フラグが「未取得」状態にあるとき、前
記第1の圧縮データ記憶手段から識別子を取り込んで該
保持手段に保持し、これが非参照識別子であるとき、前
記第2の圧縮データ記憶手段から1バイト取り込んで復
号データとし、前記伸長データ記憶手段に格納するとと
もに、前記識別子取得フラグを「未取得」状態に設定
し、前記保持手段に保持された識別子が履歴参照識別子
であるときには、前記第2の圧縮データ記憶手段から取
り込まれる前記履歴参照インデックスから分離される識
別子を前記保持手段に保持するとともに前記識別子取得
フラグを「取得済み」状態に設定し、 前記識別子取得フラグが「取得済み」状態にあるときに
は、前記保持手段で保持されている前記識別子の内容に
応じて前記第2の圧縮データ記憶手段からデータの取込
みを行なうことを特徴とするデータ符号化及び復号化方
式。4. The method according to claim 2, wherein an instruction to output the identifier to the first compressed data storage means is issued in the first state, and an identifier is output to the second compressed data storage means in the second state. Is provided, and an identifier acquisition flag indicating whether the identifier is “acquired” or “not acquired” is provided, and the compression processing means sets the output destination control flag to the first when the compression processing is started. When there is no partial character string that matches the input character string in the character string on the history buffer during compression processing, the non-reference is made according to the state of the output destination control flag. After storing the identifier in the first or second compressed data storage means, the output destination control flag is set to the first state, and a character string input in the character string on the history buffer during compression processing. Is a substring that matches two or more characters with When the output destination control flag is set, the history reference identifier is stored in the first or second compressed data storage means according to the state of the output destination control flag, and then the output destination control flag is set to the second state. The processing means has a holding means for holding the identifier fetched from the first or second compressed data storage means, and when the decompression processing is started, the identifier acquisition flag is set to “not acquired”.
When the identifier acquisition flag is in the “unacquired” state, the identifier is fetched from the first compressed data storage means and held in the holding means, and when the identifier is a non-reference identifier, the second 1 byte is taken from the compressed data storage means as the decoded data, stored in the decompressed data storage means, the identifier acquisition flag is set to the “unacquired” state, and the identifier held in the holding means is the history reference identifier. Is held, the identifier separated from the history reference index fetched from the second compressed data storage means is held in the holding means, the identifier acquisition flag is set to the “acquired” state, and the identifier acquisition flag is set. Is in the “acquired” state, the second pressure depending on the content of the identifier held by the holding means. Data encoding and decoding method of the data storage means and performs acquisition of data.
スで指示される位置,長さに基づいて前記伸長データ記
憶手段から部分データ列を取り込み、前記伸長データ記
憶手段でのデータ列の最後に続けて格納することを特徴
とするデータ符号化及び復号化方式。5. The decompression processing means according to claim 2, 3 or 4, wherein the decompression data storage means decompresses a partial data string based on a position and a length designated by the history reference index fetched from the compressed data. Data encoding and decoding method, characterized in that the data is captured and stored continuously at the end of the data string in the decompressed data storage means.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP16713194A JP3202488B2 (en) | 1994-07-19 | 1994-07-19 | Data encoding and decoding method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP16713194A JP3202488B2 (en) | 1994-07-19 | 1994-07-19 | Data encoding and decoding method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH0832454A true JPH0832454A (en) | 1996-02-02 |
| JP3202488B2 JP3202488B2 (en) | 2001-08-27 |
Family
ID=15844011
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP16713194A Expired - Fee Related JP3202488B2 (en) | 1994-07-19 | 1994-07-19 | Data encoding and decoding method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3202488B2 (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2014097356A1 (en) * | 2012-12-19 | 2014-06-26 | 富士通株式会社 | Compression program, compression method, compression device, expansion program, expansion method and expansion device |
| CN114050831A (en) * | 2021-11-14 | 2022-02-15 | 山东云海国创云计算装备产业创新中心有限公司 | Decoding method, system, device and medium based on LZ77 |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| RU2661196C1 (en) | 2015-03-31 | 2018-07-13 | Асахи Касеи Кабусики Кайся | Method for the preparation of an oxide catalyst and method for the preparation of unsaturated nitril |
-
1994
- 1994-07-19 JP JP16713194A patent/JP3202488B2/en not_active Expired - Fee Related
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2014097356A1 (en) * | 2012-12-19 | 2014-06-26 | 富士通株式会社 | Compression program, compression method, compression device, expansion program, expansion method and expansion device |
| US9496895B2 (en) | 2012-12-19 | 2016-11-15 | Fujitsu Limited | Compression method and decompression method |
| JP6032291B2 (en) * | 2012-12-19 | 2016-11-24 | 富士通株式会社 | Compression program, compression apparatus, decompression program, decompression apparatus, and system |
| CN114050831A (en) * | 2021-11-14 | 2022-02-15 | 山东云海国创云计算装备产业创新中心有限公司 | Decoding method, system, device and medium based on LZ77 |
Also Published As
| Publication number | Publication date |
|---|---|
| JP3202488B2 (en) | 2001-08-27 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5870036A (en) | Adaptive multiple dictionary data compression | |
| US5001478A (en) | Method of encoding compressed data | |
| KR100894002B1 (en) | Device and data method for selective compression and decompression and data format for compressed data | |
| KR100527891B1 (en) | Method of performing huffman decoding | |
| EP0438955B1 (en) | Data compression method | |
| JP2000505968A (en) | Data compression and decompression system with immediate dictionary update interleaved with string search | |
| JPH0682370B2 (en) | Character processor | |
| EP2499743A1 (en) | Indexing compressed data | |
| WO2002015408A2 (en) | Dual mode data compression for operating code | |
| JPH0869370A (en) | Method and system for compression of data | |
| JPH0368219A (en) | Data compressor and method of compressing data | |
| US9479195B2 (en) | Non-transitory computer-readable recording medium, compression method, decompression method, compression device, and decompression device | |
| US5394143A (en) | Run-length compression of index keys | |
| JP3611319B2 (en) | Method and apparatus for reducing the time required for data compression | |
| US5010344A (en) | Method of decoding compressed data | |
| JP2026010210A (en) | A device that processes received data | |
| JPH0832454A (en) | Data coding and decoding system | |
| JPH10261969A (en) | Data compression method and apparatus | |
| JP3241787B2 (en) | Data compression method | |
| JPH07135471A (en) | Data compression device and data expansion device | |
| JP3242795B2 (en) | Data processing device and data processing method | |
| CN117200805B (en) | Compression and decompression method and device with low memory occupation of MCU | |
| JPH0546357A (en) | Text data compression and decompression methods | |
| JP3236747B2 (en) | Data decompression method | |
| US20250291482A1 (en) | Storage system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| LAPS | Cancellation because of no payment of annual fees |