JPH07135471A - Data compressor and data expander - Google Patents
Data compressor and data expanderInfo
- Publication number
- JPH07135471A JPH07135471A JP30335593A JP30335593A JPH07135471A JP H07135471 A JPH07135471 A JP H07135471A JP 30335593 A JP30335593 A JP 30335593A JP 30335593 A JP30335593 A JP 30335593A JP H07135471 A JPH07135471 A JP H07135471A
- Authority
- JP
- Japan
- Prior art keywords
- data
- dictionary
- buffer
- rank
- code
- 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.)
- Withdrawn
Links
- 239000000872 buffer Substances 0.000 claims abstract description 224
- 238000013144 data compression Methods 0.000 claims description 47
- 238000000034 method Methods 0.000 claims description 40
- 230000006837 decompression Effects 0.000 claims description 26
- 230000008569 process Effects 0.000 claims description 16
- 238000007906 compression Methods 0.000 abstract description 38
- 230000006835 compression Effects 0.000 abstract description 34
- 238000010586 diagram Methods 0.000 description 34
- 238000006243 chemical reaction Methods 0.000 description 12
- 230000008901 benefit Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 230000008707 rearrangement Effects 0.000 description 1
Landscapes
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
Description
【0001】[0001]
【産業上の利用分野】本発明は、例えば一般的なコンピ
ュータシステムにおいて、磁気ディスクやICメモリ等
のデジタル記憶装置に記憶するデータを圧縮し、あるい
はこれらのデジタル記憶装置から読出したデータを伸張
するデータ圧縮装置およびデータ伸張装置に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention compresses data stored in a digital storage device such as a magnetic disk or IC memory in a general computer system, or expands data read from these digital storage devices. The present invention relates to a data compression device and a data decompression device.
【0002】[0002]
【従来の技術】近年、マイクロプロセッサの高速化およ
び高性能化にともない、コンピュータシステムにおける
処理内容も多様化しており、扱うデータ量も急激に増大
している。特に最近では、静止画や動画を対象とした画
像処理が盛んになりつつあり、このような画像処理を行
う場合には扱うデータ量も従来の文字データに比べて膨
大となる。そのため、この膨大な画像データを例えばハ
ードディスク装置に格納する場合に、その前処理として
データの圧縮を行っておいて、この圧縮されたデータを
ハードディスク装置に格納する方法が知られている。ま
た、データを読み出す場合には、圧縮して格納されてい
るデータを読み出した後に伸張し、この伸張データをパ
ーソナルコンピュータ(パソコン)に送ることになる。2. Description of the Related Art In recent years, the processing contents of computer systems have been diversified with the increase in speed and performance of microprocessors, and the amount of data to be handled has also increased rapidly. Particularly in recent years, image processing for still images and moving images has become popular, and the amount of data to be handled when performing such image processing becomes enormous compared to conventional character data. Therefore, when storing this huge amount of image data in, for example, a hard disk device, a method is known in which data is compressed as a pre-process and the compressed data is stored in the hard disk device. When reading data, the compressed and stored data is read and then expanded, and the expanded data is sent to a personal computer (personal computer).
【0003】図17は、ハードディスク装置あるいはメ
モリカードに対するデータの記憶を圧縮された形で行う
場合の一般的なシステム構成を示す図である。同図
(A)は、パソコン100に接続されたハードディスク
装置102内にデータの圧縮装置104および伸張装置
106を備えた場合が示されている。この場合には、パ
ソコン100からハードディスク装置102に対して非
圧縮データが送られ、圧縮装置104によって圧縮が行
われた後にこの圧縮データが記憶される。データを読み
出す際には、まず読み出した圧縮データをハードディス
ク装置102内の伸張装置106によって伸張した後に
パソコン100に向け出力する。FIG. 17 is a diagram showing a general system configuration when data is stored in a compressed form in a hard disk device or a memory card. FIG. 1A shows a case where a data compression device 104 and a data decompression device 106 are provided in a hard disk device 102 connected to a personal computer 100. In this case, the non-compressed data is sent from the personal computer 100 to the hard disk device 102, and the compressed data is stored after being compressed by the compression device 104. When reading data, first, the read compressed data is expanded by the expansion device 106 in the hard disk device 102 and then output to the personal computer 100.
【0004】また、同図(B)にはこの圧縮装置104
および伸張装置106をパソコン100内に設けた場合
の構成が示されている。Further, FIG. 1B shows the compression device 104.
Also, a configuration in which the expansion device 106 is provided in the personal computer 100 is shown.
【0005】さらに、同図(C)には、記憶装置として
ハードディスク装置102の代わりにメモリカード10
8を対象とした場合が示されている。この場合には、パ
ソコン100に装着されたメモリカード108にデータ
を格納する前に圧縮装置104によってデータの圧縮が
行われる。また、メモリカード108から読み出された
圧縮データが伸張装置106によって伸張される。Further, in FIG. 1C, a memory card 10 is used as a storage device instead of the hard disk device 102.
8 is shown. In this case, the compression device 104 compresses the data before storing the data in the memory card 108 mounted on the personal computer 100. In addition, the compressed data read from the memory card 108 is expanded by the expansion device 106.
【0006】図18は、パソコン100とプリンタ11
0の間に設けられたプリンタバッファ112に圧縮デー
タを格納する構成を示す図である。同図(a)には、パ
ソコン100内に圧縮装置104を設けるとともに、プ
リンタバッファ112内に伸張装置106を設けるよう
にしたものである。また、同図(B)はプリンタバッフ
ァ112内に圧縮装置104と伸張装置106の両方を
設けたものである。これらの図に示すように、パソコン
100の印刷データを圧縮装置104によって圧縮した
後にプリンタバッファ112に保持しているため、実際
の格納容量よりもたくさんの印刷データを保持すること
ができる。FIG. 18 shows a personal computer 100 and a printer 11.
It is a figure which shows the structure which stores compressed data in the printer buffer 112 provided between 0. In FIG. 1A, the compression device 104 is provided in the personal computer 100, and the decompression device 106 is provided in the printer buffer 112. Further, FIG. 2B shows that both the compression device 104 and the decompression device 106 are provided in the printer buffer 112. As shown in these figures, since the print data of the personal computer 100 is stored in the printer buffer 112 after being compressed by the compression device 104, a larger amount of print data than the actual storage capacity can be stored.
【0007】ところで、上述したデータの圧縮および伸
張を行う方式としては数々のものが提案されており、例
えば、ハフマン符号を用いる方法、動的辞書法、
スライド辞書法等が代表的なものとして挙げられる。By the way, various methods have been proposed for performing the above-described data compression and decompression, for example, a method using a Huffman code, a dynamic dictionary method,
A typical example is slide dictionary method.
【0008】ハフマン符号を用いる方法は、圧縮対象
となる全データ列内の各文字あるいは文字列の出現頻度
を予めカウントしておいて、出現頻度の高いものほどビ
ット長が短くなるような変換符号表を予め作成し、入力
データをこの変換符号表に従って符号化するものであ
る。この方法によれば、どのような入力データ列に対し
ても最適な変換符号表を作成することができ、効率よい
符号化、すなわち高い圧縮率のデータ圧縮が可能となる
という利点がある。The method using the Huffman code is a conversion code in which the appearance frequency of each character or character string in all data strings to be compressed is counted in advance, and the bit length becomes shorter as the appearance frequency increases. A table is created in advance and input data is encoded according to this conversion code table. According to this method, an optimum conversion code table can be created for any input data string, and there is an advantage that efficient encoding, that is, data compression with a high compression rate becomes possible.
【0009】動的辞書法は、入力されたデータ列に専
用の符号を割り当てて、順次辞書形式で登録する。処理
が進むにしたがって辞書内のデータが増えていくため、
動的辞書法と呼ばれているものであり、入力されたデー
タ列の中の文字列が辞書内に存在すると、辞書内の対応
する符号とこの文字列の次の1文字に対応する符号とを
出力する。存在しない場合には、存在しない旨のフラグ
とともに1文字分の生データを出力する。文字列の繰り
返し性に冗長成分を見付け出す方法であるため、高い圧
縮率が得られ、しかも入力されるデータ列を順次処理す
ることができるワンパス構成とすることができる。In the dynamic dictionary method, a dedicated code is assigned to an input data string and the data strings are sequentially registered in a dictionary format. As the data in the dictionary increases as the processing progresses,
This is called the dynamic dictionary method. When the character string in the input data string exists in the dictionary, the corresponding code in the dictionary and the code corresponding to the next character of this character string are Is output. If it does not exist, the raw data for one character is output together with the flag indicating that it does not exist. Since it is a method of finding a redundant component in the repeatability of a character string, it is possible to obtain a high compression rate, and further, it is possible to adopt a one-pass configuration capable of sequentially processing an input data string.
【0010】スライド辞書法は、既に処理が終了した
データ列を用いて辞書登録を行うものである。辞書の登
録内容は古いものから順に消されるため、有限の辞書サ
イズとすることができ、辞書の管理が容易となる利点が
ある。入力されたデータ列に対して辞書検索を行い、辞
書内に一致する文字列が存在する場合は、一致フラグに
続けてその位置と一致長を符号化したデータを出力す
る。存在しない場合には、不一致フラグとともに次の1
文字分の生データを出力する。の動的辞書法と同様
に、文字列の繰り返し性に上長成分を見付け出す方法で
あり、常に高い圧縮率が得られ、ワンパスで処理できる
という特徴がある。このスライド辞書法を用いたものと
しては、例えば特開平3−68219号公報に開示され
た「データ圧縮装置及び方法」がある。The slide dictionary method is to perform dictionary registration using a data string that has already been processed. Since the registered contents of the dictionary are deleted in order from the oldest one, the dictionary size can be limited and there is an advantage that the dictionary can be easily managed. A dictionary search is performed on the input data string, and if a matching character string exists in the dictionary, data that encodes the position and the matching length is output following the match flag. If it does not exist, the next 1
Output raw data for characters. Similar to the dynamic dictionary method of, it is a method of finding an upper long component in the repeatability of a character string, and is characterized in that a high compression rate is always obtained and it can be processed in one pass. An example of using this slide dictionary method is "data compression device and method" disclosed in Japanese Patent Application Laid-Open No. 3-68219.
【0011】[0011]
【発明が解決しようとする課題】ところで、上述した各
種の圧縮方法においては、種々の問題がある。すなわ
ち、ハフマン符号を用いる方法においてはデータ圧縮
を行う前処理として、入力されるデータ列内の各文字の
出現頻度をカウントし、出現頻度が高いものほど短いビ
ット長を有する符号を対応させた変換符号表を作成しな
ければならないため、順次入力されるデータ列をワンパ
スで処理することは不可能であり、必ずツーパス処理と
なるため、リアルタイムの処理が不可能であるという問
題があった。また、いくつかのデータ群が存在する場合
には、各データ群毎に異なる変換符号表を作成しなけれ
ばならないため、この変換符号表まで含めるとそれ程高
い圧縮率が得られないという問題があった。The various compression methods described above have various problems. That is, in the method using the Huffman code, as a preprocessing for data compression, the frequency of appearance of each character in the input data string is counted, and the conversion having a higher frequency of occurrence is associated with a code having a shorter bit length. Since it is necessary to create a code table, it is impossible to process sequentially input data strings in one pass, and there is a problem that real-time processing is impossible because two-pass processing is always performed. In addition, when there are several data groups, different conversion code tables must be created for each data group, so including this conversion code table poses the problem that a high compression rate cannot be obtained. It was
【0012】また、動的辞書法およびスライド辞書
法においては、辞書内に該当する文字が存在しない場合
には、不一致フラグ等と次の文字の生データを出力して
いるため、辞書内に該当するデータが存在しない場合に
は入力される元データよりもビット長の長い符号出力が
存在するという問題があった。さらに、動的辞書法に
おいては、有限の辞書サイズとするためには、辞書の更
新方法が複雑になってしまう。例えば、アクセス頻度の
低いものから順に更新していこうとすると、アクセス頻
度も情報として保持する必要がある。また、古い順に更
新していこうとすると、文字列とデータ登録時間とを対
応させて辞書を作成しなければならなくなる。In the dynamic dictionary method and the slide dictionary method, when the corresponding character does not exist in the dictionary, the mismatch flag or the like and the raw data of the next character are output. When there is no data to be input, there is a problem that a code output having a bit length longer than the input original data exists. Furthermore, in the dynamic dictionary method, in order to make the dictionary size finite, the method of updating the dictionary becomes complicated. For example, when trying to update from the one with the lowest access frequency, the access frequency also needs to be held as information. Also, when trying to update from the oldest, it becomes necessary to create a dictionary by associating character strings with data registration times.
【0013】そこで、本発明はこのような鑑みて創作さ
れたものであり、順次入力されるデータ列をリアルタイ
ムで処理することができ、しかも辞書内に該当するデー
タが存在しない場合であっても常に高い圧縮率を維持し
ながらデータの圧縮を行うことができるデータ圧縮装置
およびデータ伸張装置を提供することを目的とする。Therefore, the present invention was created in view of the above circumstances, and it is possible to process sequentially input data strings in real time, and even if there is no corresponding data in the dictionary. An object of the present invention is to provide a data compression device and a data decompression device that can perform data compression while always maintaining a high compression rate.
【0014】[0014]
【課題を解決するための手段】上述した課題を解決する
ために、請求項1の発明は、順次入力される非圧縮デー
タの中の最後尾に位置する所定ワード長のデータ列を処
理データとして、およびその前に位置する所定ワード長
のデータ列を辞書としてそれぞれ格納するデータバッフ
ァおよび辞書バッファと、前記データバッファ内の処理
データを構成する各ワードについて、前記辞書を構成す
る各ワードと一致するものがあるか否かを検索し、その
最も長い一致長を符号化した一致長符号を出力する一致
長符号化手段と、前記一致長符号化手段によって一致の
判定が行われた場合に、一致したワード列の中で最もワ
ード長が長いものの前記辞書内の位置を符号化した位置
符号を出力する位置符号化手段と、非圧縮データの各ワ
ードについて存在確率の高い順にビット長が短い順位符
号を対応させた順位テーブルを有しており、前記一致長
符号化手段によって不一致の判定が行われた場合に、前
記順位テーブルを検索することにより前記データバッフ
ァ内の処理データの先頭ワードに対応する順位符号を出
力する順位符号化手段と、前記順位符号化手段による符
号化処理が行われた場合に、符号化の対象となった前記
処理データの先頭ワードを考慮して前記順位テーブルを
更新するテーブル更新手段と、前記位置符号化手段ある
いは前記順位符号化手段による符号化が行われたとき
に、符号化が終了した前記処理データの一部あるいは全
部を前記辞書バッファ内の辞書に移すとともに、この移
した分の非圧縮データを前記データバッファに追加して
格納する処理を行うバッファ更新手段と、を備え、前記
辞書内に処理データの各ワードと一致したワードがある
場合には一致長とその位置とをそれぞれ符号化し、一致
したワードがない場合にはその旨を示す一致長と処理デ
ータの先頭ワードとをそれぞれ符号化することにより圧
縮データを得ることを特徴とする。In order to solve the above-mentioned problems, the invention of claim 1 uses a data string of a predetermined word length located at the end of the sequentially input uncompressed data as processing data. , And a data buffer and a dictionary buffer that store a data string of a predetermined word length located in front of them, respectively, as a dictionary, and for each word that configures the processed data in the data buffer, match each word that configures the dictionary. If there is a match, the match length coding means for outputting the match length code obtained by coding the longest match length, and the match length coding means, if a match is determined, a match is made. Position encoding means for outputting the position code obtained by encoding the position in the dictionary, which has the longest word length in the word sequence, and is present for each word of the uncompressed data. The data buffer has a rank table in which rank codes having shorter bit lengths are associated in the order of higher rate, and the data buffer is searched by searching the rank table when a mismatch is determined by the match length coding means. Rank coding means for outputting a rank code corresponding to the head word of the processed data in the inside, and the head word of the processed data to be coded when the rank coding means performs the coding processing. Table updating means for updating the rank table in consideration of the above, and when the position coding means or the rank coding means performs coding, a part or all of the processed data that has been coded is Buffer updating means for performing processing of transferring to the dictionary in the dictionary buffer and additionally storing the transferred uncompressed data in the data buffer , And if there is a word that matches each word of the processing data in the dictionary, the matching length and its position are encoded respectively, and if there is no matching word, a matching length and processing data indicating that It is characterized in that compressed data is obtained by encoding each of the first word and the first word.
【0015】請求項2の発明は、請求項1の発明におい
て、前記一致長符号化手段は、前記辞書バッファ内の辞
書の各ワードを先頭から順に見ていった場合に、異なる
ワード毎に先頭アドレスを格納するトップバッファと、
前記辞書バッファ内の辞書の各ワードを先頭から順に見
ていった場合に、同じワードが次に前記辞書内のどのア
ドレスに格納されているかを示すデータを格納するチェ
ーンバッファと、を含み、前記データバッファ内の処理
データの先頭ワードに基づいて前記トップバッファおよ
び前記チェーンバッファを検索することにより、該当す
る前記辞書内のアドレスを特定することを特徴とする。According to a second aspect of the present invention, in the first aspect of the present invention, when the matching length coding means sequentially views each word of the dictionary in the dictionary buffer from the head, the head of each word is different. A top buffer to store the address,
A chain buffer that stores data indicating at which address in the dictionary the same word is stored next when each word of the dictionary in the dictionary buffer is viewed in order from the beginning, The address in the dictionary is specified by searching the top buffer and the chain buffer based on the first word of the processed data in the data buffer.
【0016】請求項3の発明は、請求項1の発明におい
て、前記辞書バッファおよびデータバッファは、各アド
レスが互いに連続している複数のメモリ素子により構成
されており、前記バッファ更新手段は、符号化が終了し
た前記処理データの一部あるいは全部を構成する各ワー
ドを、前記複数のメモリ素子のそれぞれに分散して格納
し、前記一致長符号化手段は、前記複数のメモリ素子の
それぞれから同時にデータを読み出すことにより、前記
一致検索を行うことを特徴とする。According to a third aspect of the present invention, in the first aspect of the present invention, the dictionary buffer and the data buffer are composed of a plurality of memory elements whose addresses are continuous with each other, and the buffer updating means is a code. The respective words constituting a part or all of the processed data that have been encoded are stored in a distributed manner in each of the plurality of memory elements, and the match length encoding means simultaneously outputs from each of the plurality of memory elements. The coincidence search is performed by reading data.
【0017】請求項4の発明は、圧縮データを伸張して
得られる非圧縮データの中の最後尾に位置する所定ワー
ド長のデータ列を辞書として格納する辞書バッファと、
順次入力される圧縮データの先頭部分に位置する一致長
符号を復号化して具体的な一致長データを出力する一致
長復号化手段と、前記圧縮データの先頭部分に位置する
一致長符号が一致を示している場合に、その次に位置す
る位置符号を復号化して、前記辞書内の格納位置を示す
データを出力する位置復号化手段と、前記圧縮データの
先頭部分に位置する一致長符号が一致を示している場合
に、前記位置復号化手段から出力されるデータに基づい
て前記辞書内の格納位置を特定し、この格納位置を先頭
アドレスとして前記一致長データの分だけ前記辞書から
データの読出しを行って、非圧縮データを出力する辞書
読出し制御手段と、前記非圧縮データの各ワードについ
て存在確率の高い順に短い順位符号を対応させた順位テ
ーブルを有しており、前記圧縮データの先頭部分に位置
する一致長符号が不一致を示している場合に、その次に
位置する順位符号に基づいて前記順位テーブルを検索す
ることにより前記非圧縮データの復号化を行う順位復号
化を行う順位復号化手段と、前記順位復号化手段により
復号化処理が行われたときに、復号化された非圧縮デー
タを考慮して前記順位テーブルを更新するテーブル更新
手段と、前記位置復号化手段あるいは前記順位復号化手
段による復号化が行われたときに、復号化が終了した非
圧縮データを含ませるように前記辞書の更新を行う辞書
更新手段と、を備え、一致長符号と位置符号および順位
符号のいずれか一方とを組み合わせた圧縮データを復号
化することにより伸張データを得ることを特徴とする。According to a fourth aspect of the present invention, a dictionary buffer for storing, as a dictionary, a data string of a predetermined word length located at the end of the uncompressed data obtained by decompressing the compressed data,
A match length decoding unit that decodes the match length code located at the head of the sequentially input compressed data and outputs concrete match length data and the match length code located at the head of the compressed data are matched. In the case shown, the position decoding means for decoding the next position code and outputting the data indicating the storage position in the dictionary and the matching length code positioned at the beginning of the compressed data match. , The storage position in the dictionary is specified based on the data output from the position decoding means, and the storage position is used as a start address to read data from the dictionary by the amount corresponding to the matching length data. The dictionary read control means for outputting uncompressed data and a rank table in which shorter rank codes are associated with each word of the uncompressed data in descending order of existence probability. If the match length code located at the beginning of the compressed data indicates a mismatch, the order of performing decoding of the uncompressed data by searching the order table based on the order code located next A rank decoding means for decoding, a table updating means for updating the rank table in consideration of the decoded uncompressed data when the decoding processing is performed by the rank decoding means, and the position Dictionary decoding means for updating the dictionary so as to include uncompressed data that has been decoded when decoding is performed by the decoding means or the rank decoding means, and a matching length code is provided. It is characterized in that decompressed data is obtained by decoding compressed data in which either one of the position code and the rank code is combined.
【0018】[0018]
【作用】請求項1のデータ圧縮装置は、既に圧縮処理が
終了した最も最近の所定ワード長のデータ列を辞書とし
て辞書バッファに格納するとともに、これから処理を行
う所定ワード長のデータ列をデータバッファに格納す
る。そして、データバッファに格納されたデータ列につ
いて辞書バッファ内の辞書を構成する各ワードと一致す
るものがあるか否かを検索し、一致した場合には一致し
たワード列の中で最もワード長が長いものの一致長を符
号化した一致長符号と、その辞書内の位置を符号化した
位置符号とを圧縮データとして出力する。According to the data compression apparatus of the present invention, the most recent data string having a predetermined word length, which has been already compressed, is stored in the dictionary buffer as a dictionary, and the data string having a predetermined word length to be processed is stored in the data buffer. To store. Then, the data string stored in the data buffer is searched for a match with each word forming the dictionary in the dictionary buffer, and if there is a match, the word length is the largest in the matched word string. A match length code obtained by encoding a long match length and a position code obtained by encoding a position in the dictionary are output as compressed data.
【0019】また、一致しない場合には、一致していな
い旨を表す一致長符号と、各ワードについて存在確率の
高い順に短い順位符号を対応させた順位テーブルによっ
て処理データの先頭ワードに対応させて得られた順位符
号とを圧縮データとして出力する。If they do not match, a matching length code indicating that they do not match is associated with the leading word of the processed data by a rank table in which a short rank code is associated with each word in descending order of existence probability. The obtained rank code is output as compressed data.
【0020】上述した圧縮処理が終了した後、データバ
ッファ,辞書バッファ,順位テーブルのそれぞれが更新
され、常に最新の情報に基づくデータ圧縮が行われるよ
うになっている。After the above-mentioned compression processing is completed, each of the data buffer, the dictionary buffer, and the rank table is updated so that data compression is always performed based on the latest information.
【0021】請求項1の発明においては、順次入力され
るデータによって辞書が作成されるため、ワンパス構成
とすることができ、リアルタイムの圧縮処理が可能とな
る。また、辞書内に該当するデータ(ワード)が存在し
ない場合であっても、出現確率の高いものほど短い符号
に割り当てた圧縮処理が行われるため、元データよりも
短いビット長で符号化処理を行うことができ、全入力デ
ータに対して常に高い圧縮率を維持したデータ圧縮を行
うことが可能となる。According to the first aspect of the present invention, since the dictionary is created by the sequentially input data, the one-pass configuration can be realized and the real-time compression processing can be performed. Further, even if the corresponding data (word) does not exist in the dictionary, the compression process is performed by assigning a shorter code to a data item having a higher appearance probability. Therefore, the encoding process is performed with a bit length shorter than that of the original data. It is possible to perform data compression that always maintains a high compression rate for all input data.
【0022】また、請求項2の発明では、上述した一致
長符号化手段をトップバッファとチェーンバッファとを
含んで構成している。このトップバッファには、辞書の
各ワードを先頭から順に見ていった場合に異なるワード
毎の先頭アドレスが格納されており、チェーンバッファ
には辞書内の各ワードを先頭から順に見ていった場合に
同じワードが次に辞書内のどのアドレスに格納されてい
るかを示すデータが格納されている。したがって、デー
タバッファ内の各ワードを辞書内で検索する場合に、ト
ップファッファとチェーンバッファをアクセスすること
により、辞書の該当アドレスを速やかに知ることがで
き、処理の高速化が可能となる。Further, in the invention of claim 2, the above-mentioned matching length coding means is constituted by including a top buffer and a chain buffer. This top buffer stores the start address of each different word when looking at each word in the dictionary in order from the beginning, and when looking at each word in the dictionary in order from the beginning in the chain buffer. Stores data indicating in which address in the dictionary the same word is stored next. Therefore, when each word in the data buffer is searched in the dictionary, by accessing the top buffer and the chain buffer, the corresponding address in the dictionary can be quickly known, and the processing speed can be increased.
【0023】また、請求項3の発明は、上述した辞書バ
ッファおよびデータバッファを複数のメモリ素子によっ
て構成しており、しかもこれら各メモリ素子は各アドレ
スが互いに連続している。そして、辞書を更新する際に
は、符号化が終了した非圧縮データの一部あるいは全部
を構成する各ワードを、これら複数のメモリ素子のそれ
ぞれに分散して格納し、辞書検索時にはこれら複数のメ
モリ素子から同時にデータの読出しを行う。したがっ
て、メモリ素子の個数分のワード長を同時に比較するこ
とができ、一致長が長い場合の一致長判定を高速に処理
することができる。According to the third aspect of the present invention, the dictionary buffer and the data buffer are composed of a plurality of memory elements, and the addresses of these memory elements are continuous with each other. Then, when updating the dictionary, each of the words that compose part or all of the uncompressed data that has been encoded is distributed and stored in each of these memory elements. Data is simultaneously read from the memory element. Therefore, the word lengths corresponding to the number of memory elements can be compared at the same time, and the match length determination when the match length is long can be processed at high speed.
【0024】また、請求項4のデータ伸張装置は、上述
したデータ圧縮装置によって圧縮されたデータを伸張す
ることにより、データの復号を行うものである。入力さ
れる圧縮データの先頭部分に位置する一致長符号が一致
を示している場合には、その次に位置する位置符号を復
号化することにより辞書内の格納位置が得られる。そし
て、この格納位置を先頭アドレスとして一致長の分だけ
辞書からデータの読出しを行うことによりデータの伸張
が行われ、非圧縮データが得られる。また、上述した一
致長符号が不一致を示している場合には、データ圧縮装
置内の順位テーブルと同じ内容の順位テーブルを検索す
ることにより、データの伸張が行われ、非圧縮データが
得られる。この順位テーブルは検索された後にその都度
変更され、上述したデータ圧縮装置内の順位テーブルと
常に同じ手順で更新が行われるようになっている。The data decompression device according to a fourth aspect of the present invention decodes the data by decompressing the data compressed by the data compression device. If the matching length code located at the beginning of the input compressed data indicates a match, the position code located next to it is decoded to obtain the storage position in the dictionary. Then, the data is decompressed by reading the data from the dictionary by the amount corresponding to the matching length using this storage position as the head address, and uncompressed data is obtained. Further, when the above-mentioned match length code indicates non-match, the data is expanded by searching the rank table having the same contents as the rank table in the data compression apparatus, and uncompressed data is obtained. This rank table is changed each time after it is searched, and is always updated in the same procedure as the rank table in the above-described data compression device.
【0025】請求項4の発明においては、データ圧縮の
場合と同様にリアルタイムで伸張処理を行うことができ
る。In the fourth aspect of the invention, the decompression process can be performed in real time as in the case of data compression.
【0026】[0026]
【実施例】以下、図面に基づいて本発明の一実施例につ
いて詳細に説明する。DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described in detail below with reference to the drawings.
【0027】図1は、本発明を適用した一実施例のデー
タ圧縮装置の構成を示す図である。同図に示すデータ圧
縮装置は、データバッファ10,辞書バッファ12,バ
ッファ更新部14,一致長符号化部16,位置符号化部
20,順位符号化部24,テーブル更新部28を含んで
構成される。FIG. 1 is a diagram showing the configuration of a data compression apparatus of an embodiment to which the present invention is applied. The data compression apparatus shown in the figure includes a data buffer 10, a dictionary buffer 12, a buffer updating unit 14, a match length coding unit 16, a position coding unit 20, a rank coding unit 24, and a table updating unit 28. It
【0028】データバッファ10は、これから処理され
るデータ列を一時保持するものであり、圧縮処理が終了
したデータ分だけ新たなデータ列が入力され、順次内容
が更新されるようになっている。また、辞書バッファ1
2は、処理が終了した非圧縮データを辞書として格納す
るものであり、新たに圧縮処理が行われる毎に古い内容
が削除され更新が行われるようになっている。The data buffer 10 temporarily holds a data string to be processed, and a new data string is input by the amount of data for which the compression processing has been completed, and the contents are sequentially updated. Also, dictionary buffer 1
2 stores the uncompressed data that has been processed as a dictionary, and the old contents are deleted and updated each time a new compression process is performed.
【0029】図2は、データバッファ10および辞書バ
ッファ12と入力データ列との関係を概略的に示す図で
ある。同図において、矢印aは入力されるデータ列の方
向を示しており、入力データ列の各ワードを1文字のア
ルファベットで示した場合が示されている。入力された
データ列は、まずデータバッファ10に順次入力され格
納される。そして、このデータバッファ10に格納され
たデータ列の先頭から順にデータ圧縮処理が行われ、処
理が終了したデータ列が次に辞書バッファ12に格納さ
れるようになっている。FIG. 2 is a diagram schematically showing the relationship between the data buffer 10 and the dictionary buffer 12 and the input data string. In the same figure, arrow a indicates the direction of the input data string, and shows the case where each word of the input data string is indicated by one-letter alphabet. The input data string is sequentially input and stored in the data buffer 10. Then, the data compression processing is performed in order from the beginning of the data string stored in the data buffer 10, and the data string after the processing is stored in the dictionary buffer 12 next.
【0030】データバッファ10および辞書バッファ1
2は所定の容量(例えば数千ワード分)を有している
が、図2では説明の都合上それぞれが16ワード分の容
量を有するものとする。また、データバッファ10に格
納したデータ列と辞書バッファ12に格納したデータ列
とを比較する必要があるため、データバッファ10と辞
書バッファ12とは同じ容量であるか、あるいは辞書バ
ッファ12の方が大きな容量を有している。Data buffer 10 and dictionary buffer 1
2 has a predetermined capacity (for example, several thousand words), but in FIG. 2, each has a capacity for 16 words for convenience of explanation. Further, since it is necessary to compare the data string stored in the data buffer 10 with the data string stored in the dictionary buffer 12, the data buffer 10 and the dictionary buffer 12 have the same capacity, or the dictionary buffer 12 has a larger capacity. It has a large capacity.
【0031】バッファ更新部14は、データバッファ1
0および辞書バッファ12の内容を更新するものであ
る。データバッファ10に格納された文字列は、その先
頭から順に符号化されるため、この符号化が終了したデ
ータ列を辞書バッファ12に移すとともに、その分の新
たな非圧縮データをデータバッファ10に追加して格納
する処理が行われる。The buffer updating unit 14 is provided in the data buffer 1
0 and the contents of the dictionary buffer 12 are updated. Since the character string stored in the data buffer 10 is encoded in order from the beginning, the encoded data string is transferred to the dictionary buffer 12, and new uncompressed data for that is transferred to the data buffer 10. The process of adding and storing is performed.
【0032】一致長符号化部16は、データバッファ1
0に格納されたデータ列の先頭部分に位置する1ワード
あるいは複数ワードが辞書バッファ12内の辞書に存在
するか否かを検索し、その一致長に対応する一致長符号
を出力する。この一致長符号の作成は、一致長符号テー
ブル18に基づいて、検出された一致長に1対1に対応
する一致長符号を得ることにより行われる。The match length coding unit 16 uses the data buffer 1
It is searched whether or not one word or a plurality of words located at the beginning of the data string stored in 0 exists in the dictionary in the dictionary buffer 12, and the match length code corresponding to the match length is output. The matching length code is created by obtaining a matching length code corresponding to the detected matching length on a one-to-one basis based on the matching length code table 18.
【0033】図3は、一致長符号テーブル18の詳細な
内容を示す図である。同図に示すように、不一致の場合
には一致長符号“00”が割り当てられ、一致長が長くな
るにしたがって次第にビット長が長い一致長符号が割り
当てられている。ただし、一致長に比例して一致長符号
のビット長が長くなるわけではないので、一致長が長く
なるに従い圧縮率が高まるように一致長符号テーブル1
8が作成されている。FIG. 3 is a diagram showing the detailed contents of the match length code table 18. As shown in the figure, a match length code "00" is assigned in the case of a mismatch, and a match length code having a longer bit length is assigned as the match length becomes longer. However, since the bit length of the match length code does not increase in proportion to the match length, the match length code table 1 is set so that the compression rate increases as the match length increases.
8 has been created.
【0034】また、位置符号化部20は、一致長符号化
部16によって一致判定が行われた場合に、一致したデ
ータの辞書内の位置を符号化した位置符号を出力するも
のである。この符号化は、位置符号テーブル22を検索
することにより、辞書内の格納位置に1対1に対応した
位置符号を得ることにより行われる。また、辞書内の格
納位置としては、例えば図2においてデータバッファ1
0側に最も近いアドレスを「1」とし、以下遠ざかって
いくにしたがって「2」,「3」,……となる相対アド
レスが用いられる。The position coding unit 20 outputs a position code obtained by coding the position of the matched data in the dictionary when the match length coding unit 16 determines the match. This encoding is performed by searching the position code table 22 to obtain a position code corresponding to the storage position in the dictionary in a one-to-one manner. Further, the storage position in the dictionary is, for example, the data buffer 1 in FIG.
The address closest to the 0 side is set to "1", and relative addresses such as "2", "3", ...
【0035】図4は、位置符号化部20内の位置符号テ
ーブル22の詳細な一例を示す図である。同図に示すよ
うに、相対アドレス値(位置)が小さいものほど短いビ
ット長の位置符号が割り当てられており、一致長が同じ
である場合には最も最近に処理されたデータ列が繰り返
し現れた場合に最も圧縮率が高くなるようになってい
る。FIG. 4 is a diagram showing a detailed example of the position code table 22 in the position coding unit 20. As shown in the figure, the smaller the relative address value (position), the shorter the bit position code is assigned. If the matching length is the same, the most recently processed data string appears repeatedly. In this case, the compression rate is the highest.
【0036】なお、上述した図3および図4で示した一
致長符号および位置符号は、ともに可変長符号となって
おり、それらの符号を分離するための特別なビットデー
タを挿入するわけではないので、後の伸張処理によって
その内容のみから分離できるような内容の符号が割り当
てられている。The match length code and the position code shown in FIGS. 3 and 4 are both variable length codes, and special bit data for separating these codes is not inserted. Therefore, the code of the content that can be separated from the content only by the later expansion processing is assigned.
【0037】順位符号化部24は、一致長符号化部16
によって不一致判定が行われた場合に、データバッファ
10に格納された先頭のワードに対応した順位符号を出
力するものである。この符号化は、この先頭のワードの
順位を順位テーブル27を検索して読み出した後、各ワ
ードの最近の出現確率が高いもの程短い順位符号を対応
させた順位符号テーブル26を検索することにより行わ
れる。The rank coding unit 24 includes a match length coding unit 16
When the non-coincidence determination is performed by, the rank code corresponding to the first word stored in the data buffer 10 is output. This encoding is performed by searching the rank table 27 for the rank of the leading word and then searching the rank code table 26 in which a word having a higher probability of appearance of each word is associated with a shorter rank code. Done.
【0038】図5は、順位符号化部24内の順位符号テ
ーブル26の詳細な一例を示す図である。同図に示すよ
うに、出現頻度の高い順位ほど短い符号が割り当てられ
ており、辞書内に該当する文字が存在しない場合であっ
ても高い圧縮率が得られるようになっている。FIG. 5 is a diagram showing a detailed example of the rank code table 26 in the rank coding section 24. As shown in the same figure, a shorter code is assigned to a rank having a higher appearance frequency, so that a high compression rate can be obtained even when there is no corresponding character in the dictionary.
【0039】テーブル更新部28は、順位符号化部28
内の順位符号テーブル26の更新を行う。すなわち、上
述したように順位符号テーブル26は、最近の出現頻度
の高い順に短い符号を割り当てる必要があるため、符号
化が行われる毎に該当する文字の順位を上げる必要があ
り、この処理をテーブル更新部28によって行ってい
る。The table updating unit 28 includes a rank coding unit 28.
The rank code table 26 is updated. That is, as described above, the rank code table 26 needs to assign shorter codes in the descending order of the frequency of appearance. Therefore, it is necessary to raise the rank of the corresponding character each time encoding is performed. This is performed by the updating unit 28.
【0040】次に、上述した構成を有する一実施例のデ
ータ圧縮装置の動作を説明する。一例として、図2に示
すデータ列が入力され、データバッファ10および辞書
バッファ12のそれぞれに未処理のデータ列および処理
済みのデータ列が格納されているものとする。Next, the operation of the data compression apparatus of the embodiment having the above-mentioned configuration will be described. As an example, it is assumed that the data string shown in FIG. 2 is input, and the unprocessed data string and the processed data string are stored in the data buffer 10 and the dictionary buffer 12, respectively.
【0041】まず、一致長符号化部16は、辞書バッフ
ァ12内の辞書において、入力されてデータバッファ1
0内に格納されたデータ列に一致する最も長いデータ列
の検索を行う。図2に示す具体例においては、まずデー
タバッファ10に格納された先頭の文字「G」が辞書バ
ッファ12の辞書内に存在するか否かが検索され、存在
する場合には次に先頭の2文字「GC」が存在するか否
かが検索される。このようにして辞書内に一致する文字
列が見出だされなくなるまで、文字列の検索が行われ
る。First, the match length encoding unit 16 inputs the data in the dictionary in the dictionary buffer 12 to the data buffer 1
The longest data string that matches the data string stored in 0 is searched. In the specific example shown in FIG. 2, first, it is searched whether or not the leading character “G” stored in the data buffer 10 is present in the dictionary of the dictionary buffer 12. It is searched whether the character "GC" is present. In this way, character strings are searched until no matching character string is found in the dictionary.
【0042】ところで、図2に示す場合にはデータバッ
ファ10内の先頭の文字「G」が辞書バッファ12の辞
書内に存在しないため、一致長が「0」となる。一致長
符号化部16は、図3に内容を示した一致長符号テーブ
ル18を検索し、一致長「0」に対応する一致長符号
“00”を読出して出力する。By the way, in the case shown in FIG. 2, since the leading character "G" in the data buffer 10 is not in the dictionary of the dictionary buffer 12, the match length is "0". The match length coding unit 16 searches the match length code table 18 whose contents are shown in FIG. 3, reads the match length code “00” corresponding to the match length “0”, and outputs it.
【0043】また、上述した不一致を示す情報が一致長
符号化部16から順位符号化部24に入力され、順位符
号化部24における処理が開始される。Further, the information indicating the above-mentioned inconsistency is input from the match length coding unit 16 to the rank coding unit 24, and the processing in the rank coding unit 24 is started.
【0044】順位符号化部24は、データバッファ10
内の先頭に位置する文字「G」の順位を順位テーブル2
7から読出し、この順位に基づいて順位符号テーブル2
6を検索することにより、対応する順位符号を読出して
出力する。このように辞書バッファ12内の辞書に該当
する文字が存在しない場合には、データバッファ10内
の先頭文字に対応して、一致長符号化部16から一致長
符号“00”が、順位符号化部24から順位符号が順に圧
縮データとして出力される。The rank coding unit 24 includes the data buffer 10
The rank of the letter "G" located at the top of the rank table 2
7 and reads the rank code table 2 based on this rank.
By searching for 6, the corresponding rank code is read and output. In this way, when the character corresponding to the dictionary in the dictionary buffer 12 does not exist, the match length code “00” is assigned by the match length code “00” from the match length coding unit 16 to the order coding in correspondence with the first character in the data buffer 10. The order code is sequentially output from the unit 24 as compressed data.
【0045】このようにして、順位符号化部24による
順位符号の作成が行われた後、テーブル更新部28によ
って順位テーブル27の更新が行われる。In this way, after the rank coding unit 24 creates the rank code, the table updating unit 28 updates the rank table 27.
【0046】図6は、順テーブルの更新を説明するため
の図である。同図(A)に示すように、例えば文字
「G」の出現頻度が現時点において第8番目であった場
合には、順位符号化部24は、この順位「8」に対応す
る順位符号“010011”を図5に示した順位符号テーブル
26から読み出す。この処理に続けて、あるいはこの処
理と並行してテーブル更新部28は文字「G」の順位を
上げる処理を行う。例えば、図6(B)に示すように順
位を1つ上げて順位テーブル27の更新を行う。FIG. 6 is a diagram for explaining the updating of the order table. As shown in FIG. 9A, for example, when the appearance frequency of the letter “G” is the eighth at the present time, the rank encoding unit 24 causes the rank code “010011” corresponding to this rank “8”. Is read from the rank code table 26 shown in FIG. Following this processing, or in parallel with this processing, the table updating unit 28 performs processing for raising the rank of the character "G". For example, as shown in FIG. 6 (B), the rank is increased by one and the rank table 27 is updated.
【0047】このようにデータ圧縮が行われると、バッ
ファ更新部14は、処理の対象となった文字「G」のみ
を辞書バッファ12に移すとともに、データバッファ1
0を1文字分更新する。図7は、更新後のデータバッフ
ァ10および辞書バッファ12の内容を示す図である。
同図(A)は、図2に示したデータバッファ10の先頭
文字「G」のみが辞書バッファ12に移された状態を示
している。When the data compression is performed in this way, the buffer updating unit 14 moves only the character "G" to be processed to the dictionary buffer 12 and the data buffer 1
Update 0 for one character. FIG. 7 is a diagram showing the contents of the data buffer 10 and the dictionary buffer 12 after updating.
FIG. 3A shows a state in which only the first character “G” of the data buffer 10 shown in FIG. 2 has been moved to the dictionary buffer 12.
【0048】以上は、辞書バッファ12内の辞書に該当
する文字がない場合のデータ圧縮であったが、次に、辞
書内に該当する文字列が存在する場合について説明す
る。The above is the data compression when there is no corresponding character in the dictionary in the dictionary buffer 12, but next, the case where the corresponding character string exists in the dictionary will be described.
【0049】一致長符号化部16は、次にデータバッフ
ァ10の先頭に位置する文字あるいは文字列が辞書バッ
ファ12の辞書内に存在するか否かを検出する。図7
(A)に示す場合には、先頭の文字「C」が同図(a)
に示すように辞書バッファ12の相対アドレス「2」に
存在する。同様に、先頭の2文字「CB」が同図(b)
に示すように辞書バッファ12の相対アドレス「9」,
「10」に存在する。同様に、先頭の文字列「CBAD
ACBEBADFDA」が辞書バッファ12の相対アド
レス「3」〜「16」に存在する。このように辞書内の
複数箇所にデータバッファ10内の文字列が存在する
が、その中でも(c)に示すものの一致長「14」が最
も長いため、一致長符号化部16は、この一致長「1
4」に対応する一致長符号“101001”を図3に内容を示
す一致長符号テーブル18から読出して出力する。ま
た、このように一致した文字あるいは文字列がある場合
には、その旨の情報が位置符号化部20に送られる。The match length coding unit 16 next detects whether or not the character or character string located at the head of the data buffer 10 exists in the dictionary of the dictionary buffer 12. Figure 7
In the case shown in (A), the first character "C" is shown in (a) of the figure.
It exists at the relative address “2” of the dictionary buffer 12 as shown in FIG. Similarly, the first two characters "CB" are shown in FIG.
As shown in, the relative address of the dictionary buffer 12 is “9”,
It exists in "10". Similarly, the first character string "CBAD
"ACBEBADFDA" exists at relative addresses "3" to "16" of the dictionary buffer 12. As described above, the character strings in the data buffer 10 are present at a plurality of positions in the dictionary. Among them, the match length “14” shown in (c) is the longest. "1
The matching length code "101001" corresponding to "4" is read from the matching length code table 18 whose contents are shown in FIG. Further, when there is such a matched character or character string, information to that effect is sent to the position encoding unit 20.
【0050】位置符号化部20は、一致長符号化部16
が検出した辞書内の最も長い文字列の先頭位置を相対ア
ドレスで表すとともに、この先頭位置に対応する位置符
号を図4に示した位置符号テーブル22から読み出して
出力する。図7(A)に示す場合においては、辞書内の
一致する文字列の先頭が相対アドレス「16」に位置し
ており、位置符号化部20は、この相対アドレス「1
6」に対応する位置符号“0100011 ”を図4に内容を示
す位置符号テーブル22から読み出して出力する。The position coding unit 20 includes a match length coding unit 16
The leading position of the longest character string in the dictionary detected by is represented by a relative address, and the position code corresponding to this leading position is read from the position code table 22 shown in FIG. 4 and output. In the case shown in FIG. 7A, the beginning of the matching character string in the dictionary is located at the relative address “16”, and the position encoding unit 20 determines that the relative address “1”.
The position code "0100011" corresponding to "6" is read from the position code table 22 whose contents are shown in FIG.
【0051】このようにして、辞書内に対応する文字列
が存在する場合には、その一致長に対応する一致長符号
とその先頭文字の格納位置に対応する位置符号とを圧縮
データとして出力する。その後、バッファ更新部14に
より、辞書バッファ12およびデータバッファ10の更
新が行われる。In this way, when the corresponding character string exists in the dictionary, the match length code corresponding to the match length and the position code corresponding to the storage position of the first character are output as compressed data. . After that, the buffer updating unit 14 updates the dictionary buffer 12 and the data buffer 10.
【0052】図7(B)には、このようにして更新が成
された後のデータバッファ10および辞書バッファ12
の内容が示されている。FIG. 7B shows the data buffer 10 and the dictionary buffer 12 which have been updated in this way.
The content of is shown.
【0053】このように、本実施例のデータ圧縮装置に
よる処理を行った場合には、辞書内に該当する文字が存
在しない場合でもあっても出現頻度の高いもの程短いビ
ット長の符号によってデータ圧縮が行われ、辞書内に該
当する文字列が存在する場合にはその一致長と文字列の
格納位置とを符号化してデータ圧縮が行われる。したが
って、いずれの場合であっても元データよりもビット長
が短くなり、全体として非常に高い圧縮率を得ることが
できる。例えば、上述した処理によって得られる圧縮後
のデータは“00”,“010011”,“101001”,“010001
00”の計21ビットであり、基データは「GCBADA
CBEBABFDA」の15文字となる。1文字を8ビ
ットで構成するものとすれば、15文字は120ビット
であり、全体の圧縮率は(21/120)×100=1
7%となり、圧縮効率が非常に高いことがわかる。As described above, when the processing by the data compression apparatus of the present embodiment is performed, even if the corresponding character does not exist in the dictionary, the higher the frequency of appearance, the shorter the bit length of the data The compression is performed, and when the corresponding character string exists in the dictionary, the matching length and the storage position of the character string are encoded to perform data compression. Therefore, in any case, the bit length is shorter than that of the original data, and a very high compression rate can be obtained as a whole. For example, the compressed data obtained by the above-described processing is “00”, “010011”, “101001”, “010001”.
There are a total of 21 bits of "00", and the basic data is "GCBADA
15 characters of "CBEBABFDA". If one character is composed of 8 bits, 15 characters are 120 bits, and the overall compression rate is (21/120) × 100 = 1.
It is 7%, which shows that the compression efficiency is very high.
【0054】また、上述した本実施例のデータ圧縮装置
によれば、入力される非圧縮データをデータバッファ1
0および辞書バッファ12のそれぞれに順次格納するこ
とにより一連の圧縮処理が行われるため、予め辞書を作
成する等の処理が不要であり、リアルタイムで圧縮処理
を行うことができる。Further, according to the data compression apparatus of this embodiment described above, the input uncompressed data is transferred to the data buffer 1.
Since a series of compression processing is performed by sequentially storing in 0 and the dictionary buffer 12, processing such as creating a dictionary in advance is unnecessary, and compression processing can be performed in real time.
【0055】次に、上述したデータ圧縮に対応して行わ
れるデータ伸張について説明する。例えば上述したデー
タ圧縮によって得られた圧縮データ“00”,“01001
1”,“101001”,“01000100”が入力され、これらら
の圧縮データに基づいてデータ復元すなわちデータ伸張
を行う場合について説明する。Next, the data decompression performed corresponding to the above-mentioned data compression will be described. For example, compressed data "00", "01001" obtained by the above-mentioned data compression
A case will be described in which "1", "101001", and "01000100" are input, and data restoration, that is, data decompression is performed based on these compressed data.
【0056】図8は、本実施例のデータ伸張装置の構成
を示す図である。FIG. 8 is a diagram showing the configuration of the data decompression device of this embodiment.
【0057】同図に示すデータ伸長装置は、一致長復号
化部30,位置復号化部34,順位復号化部38,テー
ブル更新部42,辞書読出し制御部44,辞書バッファ
46,辞書更新部48を含んで構成される。The data decompression device shown in the figure has a match length decoding unit 30, a position decoding unit 34, a rank decoding unit 38, a table updating unit 42, a dictionary reading control unit 44, a dictionary buffer 46, and a dictionary updating unit 48. It is configured to include.
【0058】一致長復号化部30は、入力される圧縮デ
ータの先頭部分に位置する一致長符号を一致長符号テー
ブル32に基づいて復号化することにより、対応する一
致長を出力する。また、この一致長符号は、“00”の場
合にはデータ圧縮において辞書内に該当する文字列がな
い不一致状態を示しているため、一致長復号化部30
は、この一致長符号“00”が入力された場合には不一致
の旨を順位復号化部38に通知する。一方、それ以外の
一致長符号が入力された場合には、一致した旨を位置復
号化部34に通知する。The match length decoding section 30 outputs the corresponding match length by decoding the match length code located at the beginning of the input compressed data based on the match length code table 32. Further, when the match length code is "00", it indicates a mismatched state in which there is no corresponding character string in the dictionary in the data compression. Therefore, the match length decoding unit 30
When the match length code “00” is input, notifies the order decoding unit 38 that there is no match. On the other hand, if any other matching length code is input, the position decoding unit 34 is notified of the matching.
【0059】なお、上述した一致長符号テーブル32及
び後述する位置符号テーブル36,順位符号テーブル4
0は、先に説明した一致長符号テーブル18,位置符号
テーブル22,順位符号テーブル26と同一内容を有し
ており、その詳細は図3〜図5に示した通りである。The match length code table 32 described above, the position code table 36, and the rank code table 4 which will be described later.
0 has the same contents as the match length code table 18, the position code table 22, and the rank code table 26 described above, and the details thereof are as shown in FIGS. 3 to 5.
【0060】位置復号化部34は、一致長復号化部30
から一致した旨の通知を受けた場合に、一致長符号に続
けて入力される位置符号の復号化を位置符号テーブル3
6に基づいて行う。この復号化処理によって辞書バッフ
ァ46内の位置データが出力される。The position decoding unit 34 includes a match length decoding unit 30.
The position code table 3 is used to decode the position code input subsequently to the match length code when the notification of the match is received from
Based on 6. The position data in the dictionary buffer 46 is output by this decoding process.
【0061】辞書読出し制御部44は、位置復号化部3
4から出力される位置データに基づいて、辞書バッファ
46内の格納位置を特定し、この格納位置を先頭アドレ
スとしてそれに続く一致長分のデータを伸張データとし
て出力する。The dictionary read control unit 44 includes the position decoding unit 3
Based on the position data output from No. 4, the storage position in the dictionary buffer 46 is specified, and this storage position is used as the start address and the data of the following matching length is output as decompression data.
【0062】また、順位復号化部38は、一致長復号化
部30から不一致の旨が通知されると、順位復号テーブ
ル40に基づいて、一致長符号に続けて入力される順位
符号から対応する順位を読み出す。また、順位復号化部
38は、順位テーブル41に基づいて、順位復号テーブ
ルから読み出した順位に対応する文字を伸張データとし
て出力する。テーブル更新部42は、順位復号化部38
によって順位テーブル41がアクセスされる毎にこの順
位テーブル41の内容を更新する。When the order length decoding unit 38 is notified by the match length decoding unit 30 that there is no match, the order decoding unit 40 responds based on the order length code input following the match length code based on the order decoding table 40. Read the ranking. In addition, the rank decoding unit 38 outputs the character corresponding to the rank read from the rank decoding table as decompression data based on the rank table 41. The table updating unit 42 includes a rank decoding unit 38.
Every time the ranking table 41 is accessed by, the contents of the ranking table 41 are updated.
【0063】また、辞書更新部48は、辞書読出し制御
部44あるいは順位復号化部38から伸張データが出力
される毎に辞書バッファ46の更新を行う。具体的に
は、伸張後の非圧縮データである文字あるいは文字列を
辞書バッファ46内の辞書に含めると共に、古くなった
辞書内の文字をこの新規に含めた文字あるいは文字列の
分だけ削除する処理を行う。The dictionary updating unit 48 updates the dictionary buffer 46 every time the expanded data is output from the dictionary reading control unit 44 or the rank decoding unit 38. Specifically, the uncompressed character or character string after decompression is included in the dictionary in the dictionary buffer 46, and the character in the old dictionary is deleted by the amount of the newly included character or character string. Perform processing.
【0064】次に、上述した構成を有するデータ伸張装
置の動作について説明する。Next, the operation of the data decompression device having the above configuration will be described.
【0065】図9は、辞書バッファ46の内容の一例を
示す図である。同図(A)は、上述した圧縮処理によっ
て得られた圧縮データが入力される前の状態に対応する
ものであり、図2に示したデータ圧縮装置の辞書バッフ
ァ12の格納内容と同じとなっている。FIG. 9 is a diagram showing an example of the contents of the dictionary buffer 46. 2A corresponds to the state before the compressed data obtained by the above-described compression processing is input, and is the same as the storage content of the dictionary buffer 12 of the data compression apparatus shown in FIG. ing.
【0066】圧縮データが入力されると、まず一致長復
号化部30は、その先頭部分に位置する可変長の一致長
符号を分離し、一致長符号テーブル32に基づいて復号
化処理を行う。最初に入力される一致長符号は“00”で
あるため、一致長復号化部30は、図3に示すようにこ
の一致長符号に対応する一致長「0」を読出して出力す
る。When the compressed data is input, the match length decoding unit 30 first separates the variable length match length code located at the head of the match length decoding unit 30 and performs decoding processing based on the match length code table 32. Since the first match length code input is "00", the match length decoding unit 30 reads and outputs the match length "0" corresponding to this match length code as shown in FIG.
【0067】次に順位復号化部38は、上述した一致長
符号に続けて入力される順位符号“010011”に対応する
順位データ「8」を順位テーブル41から読み出す。そ
して、この順位データに基づいて順位符号テーブル40
をアクセスし、対応する1文字を特定し、伸張データと
して出力する。Next, the rank decoding unit 38 reads from the rank table 41 the rank data "8" corresponding to the rank code "010011" input following the above-mentioned matching length code. Then, based on this ranking data, the ranking code table 40
Is accessed to identify the corresponding one character and output it as decompressed data.
【0068】なお、この順位テーブル41は上述した圧
縮装置の順位テーブル27に対応するものであり、同一
の手順にしたがってテーブル更新部42による更新が行
われるようになっている。すなわち、上述した順位復号
化部38による処理は、図6(A)に示した内容を有す
る順位テーブル41を用いることにより行われ、この処
理が終了した後テーブル更新部42よる更新処理が行わ
れて、順位テーブル41は同図(B)の内容となる。The rank table 41 corresponds to the rank table 27 of the compression apparatus described above, and the table updating unit 42 updates the table according to the same procedure. That is, the processing by the rank decoding unit 38 described above is performed by using the rank table 41 having the contents shown in FIG. 6A, and after this processing is finished, the update processing by the table updating unit 42 is performed. The ranking table 41 has the contents shown in FIG.
【0069】このようにして、辞書バッファ46内に該
当する文字が存在しない場合の伸張処理が行われる。同
様にして次の圧縮データが入力されると、一致長復号化
部30は、その先頭部分に位置する一致長符号“10100
1”のみを分離し、一致長符号テーブル32をアクセス
することにより、対応する一致長「14」を出力する。In this way, the decompression process is performed when the corresponding character does not exist in the dictionary buffer 46. Similarly, when the next compressed data is input, the match length decoding unit 30 causes the match length code “10100
By separating only 1 "and accessing the match length code table 32, the corresponding match length" 14 "is output.
【0070】また、位置復号化部34、一致長復号化部
30に入力される一致長符号が“00”でないことによ
り、あるいは一致長復号化部30から出力される一致長
が「0」でないことにより処理を開始する。すなわち、
位置復号化部34は、一致長符号に続けて入力される位
置符号“101001”を分離し、位置符号テーブル36をア
クセスすることにより、対応する位置データ「16」を
読出して出力する。The match length code input to the position decoding unit 34 and the match length decoding unit 30 is not "00", or the match length output from the match length decoding unit 30 is not "0". The process is thereby started. That is,
The position decoding unit 34 separates the position code “101001” input subsequently to the match length code and accesses the position code table 36 to read and output the corresponding position data “16”.
【0071】次に、辞書読出し制御部44は、位置復号
化部34から出力される位置データに基づいて辞書バッ
ファ46の格納位置(該当する文字列の先頭アドレス)
を特定し、この格納位置を先頭として格納されている一
致長分の文字列を順に読出し、伸張データとして出力す
る。上述したデータ圧縮装置において説明したように、
位置復号化部34から出力される位置データは辞書内の
文字列の先頭部分の格納位置を示すものであり、データ
の最後尾からの相対アドレスとして認識されている。Next, the dictionary read control unit 44 stores the storage position of the dictionary buffer 46 (the start address of the corresponding character string) based on the position data output from the position decoding unit 34.
Is specified, and the character string of the matching length stored starting from this storage position is read in order and output as decompressed data. As explained in the data compression device described above,
The position data output from the position decoding unit 34 indicates the storage position of the head portion of the character string in the dictionary, and is recognized as a relative address from the end of the data.
【0072】このようにして順位復号化部38によって
伸張処理が行われた後、辞書更新部48により図9
(B)に示すように辞書バッファ46の更新が行われ
る。また、次に位置復号化部34,辞書読出し制御部4
4等により伸張処理が行われた後、辞書更新部48によ
り図9(C)に示すように辞書バッファ46の更新が行
われる。After the decompression processing is performed by the rank decoding unit 38 in this way, the dictionary updating unit 48 shown in FIG.
The dictionary buffer 46 is updated as shown in FIG. Further, next, the position decoding unit 34 and the dictionary reading control unit 4
After the decompression processing is performed by 4, etc., the dictionary update unit 48 updates the dictionary buffer 46 as shown in FIG. 9C.
【0073】このように、圧縮データが入力されると、
その先頭に位置する一致長符号に基づいて一致長の復号
が行われるとともに、この一致長符号に基づいて次に続
けて入力される符号が位置符号であるか順位符号である
かが判明し、位置符号化部34あるいは順位符号化部3
8による処理が行われる。位置符号であった場合には、
さらに辞書読出し制御部44によって辞書バッファ46
内の辞書がアクセスされ、データの伸張処理が行われ
る。したがって、いずれの場合でもあっても順次入力さ
れる圧縮データに基づいてリアルタイムに伸張処理を行
うことができる。Thus, when the compressed data is input,
Decoding of the match length is performed based on the match length code located at the beginning, and it is determined whether the code that is subsequently input based on this match length code is a position code or a rank code, Position coding unit 34 or rank coding unit 3
Processing by 8 is performed. If it is a position code,
Furthermore, the dictionary read control unit 44 causes the dictionary buffer 46
The dictionary in is accessed and the data expansion process is performed. Therefore, in any case, the expansion processing can be performed in real time based on the sequentially input compressed data.
【0074】次に、上述した本実施例のデータ圧縮装置
をさらに具体化した構成および動作について説明する。
具体的にデータ圧縮処理を行う場合には、辞書バッファ
内の辞書の検索を速やかに行う必要がある。そのための
工夫として、辞書バッファに対応させてトップバッファ
およびチェーンバッファが設けられており、検索対象と
なる文字が速やかに検索できるようになっている。Next, the configuration and operation of the above-described data compression apparatus according to this embodiment will be described.
When specifically performing the data compression processing, it is necessary to quickly search the dictionary in the dictionary buffer. As a device for that purpose, a top buffer and a chain buffer are provided in association with the dictionary buffer so that the character to be searched can be searched quickly.
【0075】図10は、トップバッファおよびチェーン
バッファの内容およびその使い方を説明するための図で
ある。同図において、トップバッファ50は、辞書バッ
ファ12の内容をデータバッファ10側から見ていった
場合に、該当する文字が最初に現れる辞書バッファ12
のアドレスをこの該当文字に対応させて格納するもので
ある。例えば、図10に示すように辞書バッファ12の
アドレスが設定されているものとすれば、文字「A」に
対応してこの文字のアドレスデータ「1」が格納されて
いる。同様に、文字「B」,「C」,……のそれぞれに
対応してアドレスデータ「6」,「0」,……が格納さ
れている。FIG. 10 is a diagram for explaining the contents of the top buffer and the chain buffer and how to use them. In the figure, when the contents of the dictionary buffer 12 are viewed from the data buffer 10 side, the top buffer 50 is the dictionary buffer 12 in which the corresponding character first appears.
The address of is stored in association with the corresponding character. For example, if the address of the dictionary buffer 12 is set as shown in FIG. 10, the address data "1" of this character is stored in correspondence with the character "A". Similarly, address data "6", "0", ... Is stored corresponding to each of the characters "B", "C", ....
【0076】また、チェーンバッファ52は、辞書バッ
ファ12の内容をデータバッファ10側から見た場合
に、同一の文字が次にどのアドレスに格納されているか
を示すチェーンデータを格納するものである。例えば、
文字「C」に着目すると、辞書バッファ12のアドレス
「0」,「9」,「e」の各アドレスに格納されてい
る。したがって、チェーンバッファ52のアドレス
「0」,「9]のそれぞれには次に文字「C」が表われ
るアドレスである「9」,「e」のそれぞれが格納され
る。また、データバッファ10側からみて最後尾側に対
応するチェーンバッファ52のアドレス「e」にはそれ
以後該当する文字が存在しないことを示す何らかのデー
タ、例えばその文字と同一のアドレスデータや先頭アド
レス「0」等が格納されており、それ以後の文字列の検
索が不要であることがわかるようになっている。The chain buffer 52 stores chain data indicating at which address the same character is stored next when the contents of the dictionary buffer 12 are viewed from the data buffer 10 side. For example,
Focusing on the character “C”, it is stored at the addresses “0”, “9”, and “e” of the dictionary buffer 12. Therefore, the addresses "0" and "9" of the chain buffer 52 respectively store the addresses "9" and "e" at which the character "C" appears next. Further, some data indicating that the corresponding character does not exist thereafter at the address "e" of the chain buffer 52 corresponding to the end side as viewed from the data buffer 10 side, for example, the same address data as that character or the start address " Since "0" and the like are stored, it is understood that the search for the character string after that is unnecessary.
【0077】例えば、データバッファ10に格納された
文字列の先頭「A」を辞書内で検索する場合、まずトッ
プバッファ50をアクセスすることにより、この文字
「A」に対応するアドレスデータ「1」が読み出され
る。このアドレスデータは、対応する文字「A」が辞書
バッファ12のどのアドレスに最初に格納されているか
を示すものであり、次にこのアドレスに対応してチェー
ンバッファ52をアクセスすることによりチェーンデー
タ「5」の読出しが行われる。以下同様にして、このチ
ェーンデータ「5」をアドレスとしてチェーンバッファ
52をアクセスすることにより次のチェーンデータ
「a」が読み出され、以下同様にしてチェーンデータ
「c」が読み出される。このようにして、文字「A」が
辞書バッファ12のアドレス「1」,「5」,「a」,
「c」のそれぞれに格納されていることが簡単にわかる
ようになっている。その後、このようにして読み出され
た各アドレスを先頭アドレスとして格納されている文字
列についてデータバッファ10内の文字列との一致判定
を行うことにより、何文字目までが一致しているかがわ
かるようになっている。For example, when searching for the beginning "A" of the character string stored in the data buffer 10 in the dictionary, the top buffer 50 is first accessed to access the address data "1" corresponding to this character "A". Is read. This address data indicates at which address of the dictionary buffer 12 the corresponding character "A" is first stored. Then, by accessing the chain buffer 52 corresponding to this address, the chain data " 5 ”is read. Similarly, the next chain data "a" is read by accessing the chain buffer 52 with the chain data "5" as an address, and the chain data "c" is read in the same manner. In this way, the character "A" corresponds to the addresses "1", "5", "a" of the dictionary buffer 12,
It can be easily understood that the data is stored in each "c". After that, the character string stored with the respective addresses thus read out as the start address is judged to be the same as the character string in the data buffer 10 to find out how many characters match. It is like this.
【0078】ところで、本実施例においてはこの文字列
の一致長判定も複数文字を同時に比較することにより高
速に行っている。By the way, in the present embodiment, the matching length judgment of the character string is also performed at high speed by simultaneously comparing a plurality of characters.
【0079】図11は、4文字同時に一致判定を行う場
合の辞書バッファ12の概略構成を示す図である。同図
に示すように、辞書バッファ12を並列読出しが可能な
4つのRAM54,56,58,60によって構成す
る。これら4つのRAM54〜60は、それぞれ連続し
たアドレスが割り振られており、辞書バッファ12の更
新を行う際には、連続した文字列を各文字単位で異なる
RAM54〜60に格納するようになっている。一方、
データバッファ10に格納された文字列と辞書バッファ
12の格納内容を比較する際には、これら4つのRAM
54〜60から同時に、すなわち4文字同時に読出し
て、この読出した4文字とデータバッファ10内の4文
字とを同時に比較できるようになっている。なお、この
辞書に対するデータの読み書き、および4文字同時の比
較動作の詳細については後述する。FIG. 11 is a diagram showing a schematic configuration of the dictionary buffer 12 in the case of determining the coincidence of four characters at the same time. As shown in the figure, the dictionary buffer 12 is composed of four RAMs 54, 56, 58, 60 capable of parallel reading. These four RAMs 54 to 60 are respectively assigned consecutive addresses, and when updating the dictionary buffer 12, consecutive character strings are stored in different RAMs 54 to 60 on a character-by-character basis. . on the other hand,
When comparing the character string stored in the data buffer 10 and the storage content of the dictionary buffer 12, these four RAMs are used.
54 to 60 can be read at the same time, that is, four characters at the same time, and the read four characters and the four characters in the data buffer 10 can be compared simultaneously. The details of the reading and writing of data from and to the dictionary and the comparison operation of simultaneous four characters will be described later.
【0080】図12は、データ圧縮装置の順位テーブル
27あるいはデータ伸張装置の順位テーブル41を更新
するための一例を示す図である。同図において、順位メ
モリ62は順位テーブル27あるいは順位テーブル41
が格納されている。例えば、順位を知りたい文字のアス
キーコードをアドレスとして順位データを格納する。ま
た、データメモリ64は、この順位データをアドレスと
して対応する文字のアスキーコードを格納するものであ
る。FIG. 12 is a diagram showing an example for updating the ranking table 27 of the data compression apparatus or the ranking table 41 of the data expansion apparatus. In the figure, the rank memory 62 is a rank table 27 or a rank table 41.
Is stored. For example, the rank data is stored with the ASCII code of the character whose rank is to be known as an address. Further, the data memory 64 stores the ASCII code of the corresponding character using the rank data as an address.
【0081】このような順位メモリ62およびデータメ
モリ64を用いて例えば文字「G」の順位を読み出すと
ともに、この順位を更新する場合について考える。Consider a case where the rank memory 62 and the data memory 64 are used to read the rank of the character "G" and update the rank.
【0082】 まず、文字「G」対応するアスキーコ
ード“47h ”をアドレスとして、順位メモリ62から順
位データ「8」の読出しが行われる。First, using the ASCII code “47h” corresponding to the letter “G” as an address, the rank data “8” is read from the rank memory 62.
【0083】 次に、この文字「G」の順位を上げる
ために、読出した順位「8」から1つだけ減算した順位
データ「7」を同一アドレスに書き込む。この状態で
は、順位データ「7」が2つ存在するので、もう一方の
順位データ「7」を「8」に変更する必要がある。Next, in order to raise the rank of this character “G”, the rank data “7” obtained by subtracting only one from the read rank “8” is written to the same address. In this state, since there are two rank data "7", it is necessary to change the other rank data "7" to "8".
【0084】 このため、この重複した順位データ
「7」をアドレスとしてデータメモリ64をアクセス
し、対応するデータ“54h ”(文字Tのアスキーコー
ド)の読出しを行う。そして、この読出したデータを一
旦保持するとともに、このアドレスに文字「G」のアス
キーコードである“47h ”を書き込む。Therefore, the data memory 64 is accessed by using the duplicated rank data “7” as an address, and the corresponding data “54h” (ASCII code of the character T) is read. Then, the read data is once held, and the ASCII code "47h" of the character "G" is written to this address.
【0085】 次に、下げたい順位データ「8」をア
ドレスとしてデータメモリ64をアクセスし、対応する
データとして上述したにおいて一旦保持したデータ
“54h”を格納する。Next, the data memory 64 is accessed by using the order data “8” to be lowered as an address, and the data “54h” temporarily held in the above described is stored as the corresponding data.
【0086】 最後に、において新たに書き込んだ
データ“54h ”をアドレスとして順位メモリ62をアク
セスし、その内容である順位データ「7」に1だけ加算
した新たな順位データ「8」を書き込む。Finally, the rank memory 62 is accessed using the newly written data “54h” as an address, and new rank data “8”, which is obtained by adding 1 to the rank data “7”, which is the content thereof, is written.
【0087】このようにして、順位メモリ62の内容で
ある順位テーブル27あるいは41の検索および更新が
行われる。In this way, the ranking table 27 or 41, which is the contents of the ranking memory 62, is searched and updated.
【0088】以下、このような各種の工夫を行ったデー
タ圧縮装置の具体的な構成について説明する。Hereinafter, a specific configuration of the data compression apparatus which has been devised in various ways will be described.
【0089】図13および図14は、本実施例のデータ
圧縮装置の詳細な構成を示す図である。同図に示す圧縮
制御部300は、このデータ圧縮装置の全体を制御する
ものである。13 and 14 are diagrams showing the detailed structure of the data compression apparatus of this embodiment. A compression control unit 300 shown in the figure controls the entire data compression apparatus.
【0090】このデータ圧縮装置に入力された非圧縮デ
ータ列は、まず最初に入力FIFO200に入力され
る。この入力FIFO200は、データの入力速度と処
理速度の違いを吸収するためのものであり、例えば51
2ワードの容量を有する。レジスタ(REG)202
は、入力FIFO200から出力される1ワード分の文
字を一時保持するものであり、この保持した文字が辞書
・データバッファ204に入力されるとともに、マルチ
プレクサ(MUX)206を介してトップアドレス演算
部207に入力される。The non-compressed data string input to this data compression device is first input to the input FIFO 200. The input FIFO 200 is for absorbing the difference between the data input speed and the processing speed, and for example, 51
It has a capacity of 2 words. Register (REG) 202
Is for temporarily holding a character of one word output from the input FIFO 200. The held character is input to the dictionary / data buffer 204, and the top address operation unit 207 is also passed through a multiplexer (MUX) 206. Entered in.
【0091】辞書・データバッファ204は、図1に示
したデータバッファ10と辞書バッファ12とを1つの
メモリで構成したものである。データバッファ10およ
び辞書バッファ12は、図2および図7に示すように連
続して入力される2つのデータ列をそれぞれ格納すると
ともに、符号化の進行にともなってその境界を次第に移
動させるようになっている。したがって、これら2つの
バッファ10,12を1つのメモリで構成し、2つのバ
ッファの境界を示すポインタを設けることにより実現す
ることができる。The dictionary / data buffer 204 comprises the data buffer 10 and the dictionary buffer 12 shown in FIG. 1 in one memory. As shown in FIGS. 2 and 7, the data buffer 10 and the dictionary buffer 12 respectively store two consecutively input data strings, and gradually move their boundaries along with the progress of encoding. ing. Therefore, it can be realized by configuring these two buffers 10 and 12 with one memory and providing a pointer indicating the boundary between the two buffers.
【0092】このようにして構成される辞書・データバ
ッファ204は、データバッファ10と辞書バッファ1
2とを合計した容量を有しており、例えば3文字分の圧
縮処理が終了した場合には、ポインタを3アドレス分進
めるとともに、データバッファ10の最後尾部分に相当
する3アドレスに新たな入力データ列を書き込めばよ
い。The dictionary / data buffer 204 configured in this way is composed of the data buffer 10 and the dictionary buffer 1.
2 has a total capacity, and, for example, when the compression process for three characters is completed, the pointer is advanced by three addresses and a new input is made at three addresses corresponding to the last part of the data buffer 10. Just write the data string.
【0093】また、マルチプレクサ206を介してトッ
プアドレス演算部207に入力される文字に基づいて、
トップバッファ208に対する新規登録処理あるいはチ
ェーンバッファ220に対する更新処理が行われる。す
なわち、図10に示したように、トップバッファ50
は、辞書バッファ内に最初に現れる文字のアドレスを格
納するものであり、辞書・データバッファ204が1文
字分更新されると、この1文字分のデータがデータバッ
ファから辞書バッファに移るため、この新規に移った文
字についてトップバッファ50に対する新規登録が行わ
れる。また、このようにトップバッファ50が更新され
ることにより、その更新情況に応じてチェーンバッファ
52も更新される。Further, based on the characters input to the top address calculation unit 207 via the multiplexer 206,
New registration processing for the top buffer 208 or update processing for the chain buffer 220 is performed. That is, as shown in FIG.
Stores the address of the first character that appears in the dictionary buffer. When the dictionary / data buffer 204 is updated by one character, this one character of data is transferred from the data buffer to the dictionary buffer. The newly transferred character is newly registered in the top buffer 50. Further, since the top buffer 50 is updated in this way, the chain buffer 52 is also updated according to the update situation.
【0094】このようにして、データ圧縮処理が終了し
た文字数分の新たな文字がレジスタ202を介して辞書
・データバッファ204に登録されるとともに、トップ
バッファ50およびチェーンバッファ52の更新処理が
行われる。In this way, new characters for the number of characters for which the data compression processing has been completed are registered in the dictionary / data buffer 204 via the register 202, and the top buffer 50 and chain buffer 52 are updated. .
【0095】次に、圧縮制御部300の制御により、辞
書・データバッファ204のデータ領域の先頭部分に位
置する1文字が読み出され、レジスタ208および21
0に一時保持される。このレジスタ210に保持された
1文字分のデータは、マルチプレクサ206を介してト
ップアドレス演算部207に入力され、トップバッファ
50およびチェーンバッファ52によりこの1文字に対
応する辞書・データバッファ204の辞書領域のアドレ
ス計算が行われる。計算されたアドレスは、レジスタ2
12に一時保持された後、マルチプレクサ214を介し
て辞書・データバッファ204に入力される。圧縮制御
部300は、このアドレスによって指定される辞書内の
1文字分のデータを読出し、この読み出されたデータが
コンパレータ(CMP)216に入力される。Next, under the control of the compression controller 300, one character located at the beginning of the data area of the dictionary / data buffer 204 is read out, and the registers 208 and 21 are read.
Temporarily held at 0. The data for one character held in the register 210 is input to the top address calculation unit 207 via the multiplexer 206, and the dictionary area of the dictionary / data buffer 204 corresponding to this one character by the top buffer 50 and the chain buffer 52. Address calculation is performed. The calculated address is in register 2
After being temporarily stored in 12, the data is input to the dictionary / data buffer 204 via the multiplexer 214. The compression control unit 300 reads the data for one character in the dictionary designated by this address, and the read data is input to the comparator (CMP) 216.
【0096】コンパレータ216は、先にレジスタ20
8に保持されたデータ領域の先頭に位置する1文字分の
データと、辞書領域の特定のアドレスから読み出された
1文字分のデータを比較し、一致した場合にはカウンタ
218の計数値を1だけ増加させる。コンパレータ21
6によって一致が検出されると、圧縮制御部300は、
辞書・データバッファ204のデータ領域および辞書領
域のアドレスをそれぞれ1ずつずらしていってコンパレ
ータ216によって不一致を検出するまで同様の処理を
繰り返す。したがって、コンパレータ216によって不
一致が検出された後カウンタ218の計数値を見ること
により辞書・データバッファ204のデータ領域に格納
された文字列の先頭から何文字までが一致しているかを
知ることができる。The comparator 216 has the register 20 first.
The data for one character located at the beginning of the data area held in 8 and the data for one character read from a specific address in the dictionary area are compared, and if they match, the count value of the counter 218 is determined. Increase by 1. Comparator 21
When a match is detected by 6, the compression control unit 300
The data area of the dictionary / data buffer 204 and the address of the dictionary area are each shifted by one, and the same processing is repeated until a mismatch is detected by the comparator 216. Therefore, by checking the count value of the counter 218 after the mismatch is detected by the comparator 216, it is possible to know how many characters from the beginning of the character string stored in the data area of the dictionary / data buffer 204 match. .
【0097】コンパレータ216によって一旦位置が検
出された後、不一致を検出した場合には、圧縮制御部3
00の制御によりレジスタ212の値によってチェーン
バッファ52のアドレス指定を行い、次に候補となる文
字の辞書領域のアドレスが読み出され、この値が再度レ
ジスタ212に保持される。このようにして、データ領
域の先頭に位置する文字と同一の文字が格納されている
辞書領域の各アドレスについて何文字目まで一致するか
の判定が行われ、カウンタ218にはその最大値が保持
されるようになっている。If a mismatch is detected after the position is once detected by the comparator 216, the compression controller 3
By controlling 00, the address of the chain buffer 52 is designated by the value of the register 212, the address of the dictionary area of the next candidate character is read, and this value is held in the register 212 again. In this way, it is determined how many characters match each address in the dictionary area in which the same character as the character at the beginning of the data area is stored, and the counter 218 holds the maximum value. It is supposed to be done.
【0098】また、このようにして最大一致長を求める
動作と並行して、対応する辞書領域内のアドレスの計算
が行われる。すなわち、チェーンバッファ52から出力
される値と1つ前にこのチェーンバッファ52から出力
されレジスタ212に保持された値との両方が減算器2
20に入力されており、その差分を加算器222および
レジスタ224によって累積している。また、カウンタ
218は最大値を検出した際にその旨の信号を出力する
機能を有しており、この信号が出力された場合にレジス
タ226にレジスタ224の内容を転送するようになっ
ている。したがって、レジスタ226には最大一致長を
有する文字列の辞書領域の先頭アドレスのみが保持され
る。Further, in parallel with the operation for obtaining the maximum match length in this way, the address in the corresponding dictionary area is calculated. In other words, both the value output from the chain buffer 52 and the value output from the chain buffer 52 immediately before and held in the register 212 are both subtracted.
20 and the difference is accumulated by the adder 222 and the register 224. Further, the counter 218 has a function of outputting a signal to that effect when the maximum value is detected, and when the signal is output, the content of the register 224 is transferred to the register 226. Therefore, the register 226 holds only the leading address of the dictionary area of the character string having the maximum matching length.
【0099】このようにして、カウンタ218から一致
した文字列の一致長が出力されるとともに、レジスタ2
26から辞書・データバッファ204の辞書領域内にお
ける位置(アドレス)が出力される。In this way, the match length of the matched character string is output from the counter 218 and the register 2
26 outputs the position (address) in the dictionary area of the dictionary / data buffer 204.
【0100】次に、一致長符号化部228は、一致長符
号テーブル18に基づいて、カウンタ218から出力さ
れた一致長に対応する一致長符号を読出して出力する。
また、位置符号化部230は、位置復号テーブル22に
基づいて、レジスタ226から出力された位置データに
対応する位置符号を読出して出力する。この出力はマル
チプレクサ232を介してバイト変換部234に入力さ
れており、バイト変換部234ではそれぞれが可変長符
号である一致長符号と、位置符号とをバイト単位でまと
めて出力する。この出力が、出力FIFO236に一旦
保持された後圧縮データ列として外部に出力される。Next, the match length coding section 228 reads out and outputs the match length code corresponding to the match length output from the counter 218 based on the match length code table 18.
The position encoding unit 230 also reads out and outputs the position code corresponding to the position data output from the register 226 based on the position decoding table 22. This output is input to the byte conversion unit 234 via the multiplexer 232, and the byte conversion unit 234 collectively outputs the matching length code, which is a variable length code, and the position code in byte units. This output is once held in the output FIFO 236 and then output to the outside as a compressed data string.
【0101】上述したデータ圧縮動作は、コンパレータ
216によって一旦一致が検出された後、不一致を検出
した場合の動作であるが、一度も一致を検出しなかった
場合には以下に示す処理が行われる。The above-described data compression operation is an operation in the case where the comparator 216 detects a match once and then a mismatch is detected. However, if no match is detected, the following processing is performed. .
【0102】コンパレータ216によって一致が検出さ
れない場合には、カウンタ218による計数動作が行わ
れないため、カウンタ218から計数値「0」が出力さ
れる。このとき、一致長符号化部228からはこの計数
値「0」に対応する一致長符号“00”が出力され、バイ
ト変換部234に入力される。If no match is detected by the comparator 216, the counter 218 does not perform the counting operation, so that the counter 218 outputs the count value "0". At this time, the match length coding unit 228 outputs the match length code “00” corresponding to the count value “0”, and the match length code “00” is input to the byte conversion unit 234.
【0103】また、この動作と並行して辞書内に存在し
ない先頭文字の符号化処理が行われる。すなわち、辞書
・データバッファ204のデータ領域の先頭に位置する
文字が出力されたときに、レジスタ238はこの1文字
を保持する。そして、この保持された文字データがマル
チプレクサ240を介して順位メモリ62にアドレスと
して入力される。順位メモリ62は、図12に示したよ
うに、この入力された文字データをアドレスとして、こ
の文字の出現頻度を出力する。この順位メモリ62の出
力は、レジスタ242に一旦保持された後、順位符号化
部252に入力される。In parallel with this operation, the encoding process of the first character that does not exist in the dictionary is performed. That is, when the character located at the head of the data area of the dictionary / data buffer 204 is output, the register 238 holds this one character. Then, the held character data is input as an address to the rank memory 62 via the multiplexer 240. As shown in FIG. 12, the rank memory 62 outputs the frequency of appearance of this character using the input character data as an address. The output of the rank memory 62 is temporarily held in the register 242 and then input to the rank coding unit 252.
【0104】順位符号化部252は、順位符号テーブル
26に基づいて、順位メモリ62から出力された出現頻
度に対応する順位符号を読出して、マルチプレクサ23
2を介してバイト変換部234に向け出力する。バイト
変換部234は、一致長符号化部228から出力される
一致長符号“00”と順位符号化部252から出力される
順位符号とをバイト単位で出力し、この出力が出力FI
FO236を介して圧縮データ列として外部に出力され
る。The rank coding section 252 reads the rank code corresponding to the appearance frequency output from the rank memory 62 based on the rank code table 26, and the multiplexer 23
It outputs to the byte conversion part 234 via 2. The byte conversion unit 234 outputs the match length code “00” output from the match length encoding unit 228 and the rank code output from the rank coding unit 252 in byte units, and this output is the output FI.
It is output to the outside as a compressed data string via the FO 236.
【0105】また、順位メモリ62の内容は、順位メモ
リ62がアクセスされる毎に更新される。具体的には、
図12に示した〜の手順に従って更新が行われる。
そのために、データメモリ64およびレジスタ224が
設けられている。すなわち、順位メモリ62から順位
を読み出すと同時に、この読み出した順位から1だけ
減算した値を再度順位メモリ62に書き込む。次に、
順位メモリ62に書き込まれた更新後の順位をアドレス
としてデータメモリ64をアクセスし、レジスタ238
に保持されている文字データの書き込みを行う。次
に、更新前の順位をアドレスとしてデータメモリ64を
再度アクセスし、更新後の順位に対応して格納されてい
たデータをこのアドレスに書き込む。最後に、この書
き込んだ文字データをレジスタ224に一旦保持した
後、この文字データによって順位メモリ62を再度アク
セスし、該当する領域に更新前の順位の書込みを行う。
このようにして、順位メモリ62とてデータメモリ64
の内容の変更が行われる。The contents of the rank memory 62 are updated each time the rank memory 62 is accessed. In particular,
The update is performed according to the procedures (1) to (2) shown in FIG.
Therefore, the data memory 64 and the register 224 are provided. That is, at the same time as reading the rank from the rank memory 62, a value obtained by subtracting 1 from the read rank is written again in the rank memory 62. next,
The data memory 64 is accessed using the updated rank written in the rank memory 62 as an address, and the register 238
Write the character data stored in. Next, the data memory 64 is accessed again using the rank before the update as an address, and the data stored corresponding to the rank after the update is written to this address. Finally, after the written character data is once held in the register 224, the rank memory 62 is accessed again by this character data to write the rank before update to the corresponding area.
In this way, the order memory 62 and the data memory 64
The content of is changed.
【0106】図15は、辞書・データバッファ204の
辞書領域の詳細な構成を示す図である。同図に示す構成
は、図11に示した複数のRAMからの文字の同時読出
しを可能とするための詳細な構成である。FIG. 15 is a diagram showing the detailed structure of the dictionary area of the dictionary / data buffer 204. The configuration shown in the figure is a detailed configuration for enabling simultaneous reading of characters from the plurality of RAMs shown in FIG.
【0107】同図において、書込信号制御部262は、
4つのRAM254,256,258,260に対して
択一的な書込信号WE0 〜WE3 を入力するためのもの
である。書込信号制御部262にはNビットの書込アド
レスWAの内の下位2ビットが入力されており、アドレ
スが1更新される毎に、書込信号WE0〜WE3が入力
されるRAMが1つずつ巡回するようになっている。ま
た、4つのRAM254〜260のそれぞれには、Nビ
ットの書込アドレスWAの内の上位N−2ビットが入力
されており、書込信号制御部262から書込信号が入力
されたもののみに対する書込みが許可されるようになっ
ている。In the figure, the write signal controller 262 is
It is for inputting alternative write signals WE0 to WE3 to the four RAMs 254, 256, 258, 260. The lower 2 bits of the N-bit write address WA are input to the write signal control unit 262, and one RAM to which the write signals WE0 to WE3 are input each time the address is updated. It is designed to make patrols one by one. Further, the upper N−2 bits of the N-bit write address WA are input to each of the four RAMs 254 to 260, and only the one to which the write signal is input from the write signal control unit 262 is input. Writing is allowed.
【0108】また、読出アドレス制御部264は、入力
される読出アドレスRAに基づいて、4つのRAM25
4〜260を同時にアクセスして、4つの文字データを
同時に読み出すものである。例えば、入力される読出ア
ドレスRAが3番目のRAM258のあるアドレスに対
応しているものとすれば、RAM258,260に対し
て読出アドレスiが入力されると同時に、RAM25
4,256に対して読出アドレスi+1が入力される。
このようにしてアドレス指定が行われた4つのRAM2
54〜260に対して読出信号SIGRDが入力され、
4文字分のデータが同時に読み出される。読出データ並
替部266は、このようにして読み出された4文字デー
タを、適宜並び替える動作を行う。上述した例では、R
AM258,260,254,256の順に並べ替えを
行い、4文字分の読出データRD0〜RD3 として出力
する。Further, the read address control section 264 determines the four RAMs 25 based on the input read address RA.
4 to 260 are simultaneously accessed to read out four character data at the same time. For example, if the input read address RA corresponds to an address in the third RAM 258, the read address i is input to the RAMs 258 and 260 and at the same time the RAM 25 is read.
The read address i + 1 is input to 4,256.
Four RAMs 2 addressed in this way
The read signal SIGRD is input to 54 to 260,
Data for four characters are read at the same time. The read data rearrangement unit 266 performs an operation of rearranging the thus read 4-character data as appropriate. In the example above, R
AM 258, 260, 254, 256 are rearranged in this order and output as read data RD0 to RD3 for four characters.
【0109】なお、このようにして辞書・データバッフ
ァ204から4文字分のデータを読出した場合には、4
文字同時に比較動作が行えるコンパレータ216を用い
るとともに、このコンパレータ出力を累積して加算する
機能をカウンタ218にもたせるようにすればよい。そ
して、コンパレータ216によって4文字の全てにおい
て一致検出を行った場合には、次に4文字についてこの
文字データの読出しおよび比較動作を継続すればよい。
このようにして、コンパレータ216によって4文字の
いずれかが一致しなくなるまで比較処理が繰り返され、
それまでの一致長が累積された後カウンタ218から出
力される。When the data of 4 characters is read from the dictionary / data buffer 204 in this way, 4
It suffices to use the comparator 216 capable of simultaneously performing the character comparison operation, and also provide the counter 218 with a function of accumulating and adding the outputs of the comparator. Then, when the comparator 216 detects a match in all four characters, the reading and comparison operation of the character data for the next four characters may be continued.
In this manner, the comparator 216 repeats the comparison process until one of the four characters does not match,
It is output from the counter 218 after the matching lengths up to that time are accumulated.
【0110】このように、4文字同時にデータの読出し
を行って比較することにより、1文字毎に読出して比較
する場合に比べると約4倍の高速処理が可能となる。In this way, by reading out data for four characters at the same time and making a comparison, it is possible to perform high-speed processing which is about four times as high as that in the case of reading out and comparing each character.
【0111】次に、上述したデータ圧縮装置に対応する
動作を行うデータ伸張装置の詳細について説明する。Next, details of the data decompression device that performs the operation corresponding to the above-described data compression device will be described.
【0112】図16は、データ伸張装置の詳細な構成を
示す図である。同図に示す伸長制御部400は、このデ
ータ伸長装置の全体を制御するものである。FIG. 16 is a diagram showing the detailed structure of the data decompression device. The decompression control unit 400 shown in the figure controls the entire data decompression device.
【0113】入力FIFO500は、入力された圧縮デ
ータ列を一旦保持した後、ビット列変換部502に向け
出力する。このビット列変換部502は、入力される1
バイトあるいは数バイトのデータから可変長符号である
一致長符号を抽出するとともに、この一致長符号に続く
位置符号あるいは順位符号を抽出する。分離された一致
長符号は一致長復号化部504に、位置符号は位置復号
化部506に、順位符号は順位復号化部508にそれぞ
れ入力される。The input FIFO 500 temporarily holds the input compressed data string and then outputs it to the bit string converter 502. This bit string conversion unit 502 inputs 1
A match length code, which is a variable length code, is extracted from byte or several bytes of data, and a position code or rank code following this match length code is extracted. The separated match length code is input to the match length decoding unit 504, the position code is input to the position decoding unit 506, and the rank code is input to the rank decoding unit 508.
【0114】一致長が「0」でない場合には、アドレス
制御部510は、一致長復号化部504から出力される
一致長と、位置復号化部506から出力される位置デー
タとに基づいて辞書バッファ512から必要な文字デー
タの読出しを行う。すなわち、位置復号化部506から
出力される位置データによって先頭アドレスが指定さ
れ、このアドレス以降に格納された一致長分の文字デー
タが読み出される。読み出された一連の文字データは、
マルチプレクサ514を介して出力FIFO516に入
力され、一旦保持された後非圧縮データ列として出力さ
れる。If the match length is not “0”, the address control unit 510 determines the dictionary based on the match length output from the match length decoding unit 504 and the position data output from the position decoding unit 506. The necessary character data is read from the buffer 512. That is, the start address is designated by the position data output from the position decoding unit 506, and the character data of the matching length stored after this address is read. The read series of character data is
It is input to the output FIFO 516 via the multiplexer 514, temporarily held and then output as an uncompressed data string.
【0115】一方、一致長が「0」の場合には、順位復
号化部508から出力される順位データに基づいて文字
データの復元が行われる。具体的には、この順位データ
がマルチプレクサ518を介してデータメモリ520に
アドレスとして入力される。データメモリ520は、順
位データに対応する文字データを出力し、この文字デー
タがレジスタ522に一旦保持された後、マルチプレク
サ514および出力FIFO516を介して非圧縮デー
タ列として出力される。On the other hand, when the match length is "0", the character data is restored based on the rank data output from the rank decoding unit 508. Specifically, this rank data is input as an address to the data memory 520 via the multiplexer 518. The data memory 520 outputs character data corresponding to the order data, the character data is temporarily held in the register 522, and then output as a non-compressed data string via the multiplexer 514 and the output FIFO 516.
【0116】また、このデータメモリ520を更新する
ために順位メモリ524およびレジスタ526が設けら
れている。レジスタ522に一旦保持した文字データを
アドレスとして順位メモリ524がアクセスされ、対応
する順位データの更新が行われる。この更新された順位
データは、レジスタ526に一旦保持された後、マルチ
プレクサ518を介して再度データメモリ520にアド
レスとして入力され、今度は更新後の順位に対応して格
納されていたデータメモリ520の内容が読み出されて
レジスタ522に保持されるとともに、この内容が、デ
ータメモリ520から先に読み出した文字データによっ
て更新される。その後、再度レジスタ522に保持され
た文字データをアドレスとして順位メモリ524がアク
セスされ、順位が下がった文字データの正しい順位デー
タが書き込まれる。このようにして、順位メモリ524
およびデータメモリ520の内容変更が行われる。A rank memory 524 and a register 526 are provided to update the data memory 520. The rank memory 524 is accessed using the character data once held in the register 522 as an address, and the corresponding rank data is updated. The updated rank data is once held in the register 526 and then input again as an address to the data memory 520 via the multiplexer 518. This time, the updated rank data of the data memory 520 corresponding to the rank is updated. The content is read and held in the register 522, and the content is updated by the character data previously read from the data memory 520. After that, the rank memory 524 is accessed again using the character data held in the register 522 as an address, and the correct rank data of the character data whose rank is lowered is written. In this way, the rank memory 524
And the contents of the data memory 520 are changed.
【0117】このようにして非圧縮データの伸長が行わ
れると、伸長されたデータがレジスタ528に一旦保持
された後、辞書バッファ512に入力され、伸長制御部
400による辞書バッファ512の更新が行われる。When the uncompressed data is decompressed in this way, the decompressed data is once held in the register 528 and then input to the dictionary buffer 512, and the expansion buffer 400 updates the dictionary buffer 512. Be seen.
【0118】なお、本発明は上記実施例に限定されるも
のではなく、本発明の要旨の範囲内で種々の変形実施が
可能である。The present invention is not limited to the above embodiments, but various modifications can be made within the scope of the gist of the present invention.
【0119】例えば、上述した実施例においては、辞書
内に存在しない文字に対する符号化処理を行った場合
に、その出現頻度の順位を1だけ更新する場合を例にと
り説明したが、2あるいは3順位をあげるようにしても
よい。For example, in the above-described embodiment, the case where the rank of the appearance frequency is updated by 1 when the encoding process is performed on the character that does not exist in the dictionary has been described. May be given.
【0120】また、上述した実施例では、1ワードに1
文字を対応させて説明したが1ワードを2文字以上で構
成する場合や、文字とは直接関連のないビットデータを
対応させる場合等が考えられ、データの内容は特に限定
されるものではない。In addition, in the above-described embodiment, one word is used for one word.
Although the description has been made by associating characters with each other, one word may be composed of two or more characters, bit data not directly related to characters may be associated, and the content of the data is not particularly limited.
【0121】[0121]
【発明の効果】上述したように、請求項1の発明によれ
ば、順次入力されるデータによって辞書が作成されるた
め、リアルタイムのデータ圧縮処理が可能となる。ま
た、辞書内に該当するデータが存在しない場合であって
も、出現確率の高いものほど短い符号を割り当てた圧縮
処理が行われるため、元データよりも短いビット長で符
号化処理を行うことができ、全入力データに対して常に
高い圧縮率を維持したデータ圧縮を行うことが可能とな
る。As described above, according to the first aspect of the invention, since the dictionary is created by the sequentially input data, the real-time data compression processing becomes possible. Further, even if there is no corresponding data in the dictionary, the compression process is performed by assigning a shorter code to a data item having a higher appearance probability. Therefore, the encoding process can be performed with a bit length shorter than that of the original data. It is possible to perform data compression that maintains a high compression rate for all input data.
【0122】また、請求項2の発明によれば、一致長符
号化手段をトップバッファとチェーンバッファとを含ん
で構成しており、データバッファ内の各ワードを辞書内
で検索する場合に、これらのトップバッファとチェーン
バッファをアクセスすることにより、辞書の該当アドレ
スを速やかに知ることができ、処理の高速化が可能とな
る。According to the second aspect of the present invention, the match length coding means is configured to include the top buffer and the chain buffer, and when each word in the data buffer is searched in the dictionary, these By accessing the top buffer and the chain buffer of, the corresponding address of the dictionary can be quickly known, and the processing speed can be increased.
【0123】また、請求項3の発明によれば、辞書バッ
ファを複数のメモリ素子によって構成しており、これら
メモリ素子から同時にデータの読出しを行っているた
め、メモリ素子の個数分のワード長を同時に比較するこ
とができ、一致長が長い場合の一致長判定を高速に処理
することができる。According to the third aspect of the present invention, the dictionary buffer is composed of a plurality of memory elements, and data is read from these memory elements at the same time. It is possible to compare at the same time, and it is possible to process the match length determination when the match length is long at a high speed.
【0124】また、請求項4の発明によれば、入力され
る圧縮データの先頭部分に位置する一致長符号が一致を
示している場合には、その次に位置する位置符号を復号
化することにより、辞書内の格納アドレスが得られ、こ
のアドレスを先頭アドレスとして一致長の分だけ辞書の
データの読出しを行うことにより伸張が行われる。ま
た、上述した一致長符号が不一致を示している場合に
は、順位テーブルを検索することによりデータの伸張が
行われる。このように、上述した請求項1〜3のデータ
圧縮装置によって圧縮されたデータをリアルタイムで伸
張処理することができる。Further, according to the invention of claim 4, when the matching length code located at the head portion of the input compressed data indicates matching, the position code located next to the matching length code is decoded. Thus, the storage address in the dictionary is obtained, and the address is used as the start address to expand the dictionary by reading the data of the dictionary for the matching length. Further, when the above-mentioned matching length code indicates a mismatch, the data is expanded by searching the rank table. In this way, the data compressed by the data compressing device according to the first to third aspects can be expanded in real time.
【図1】本発明を適用した一実施例のデータ圧縮装置の
概略構成を示す図である。FIG. 1 is a diagram showing a schematic configuration of a data compression apparatus of an embodiment to which the present invention is applied.
【図2】データバッファおよび辞書バッファと入力デー
タ列との関係を概略的に示す図である。FIG. 2 is a diagram schematically showing a relationship between a data buffer and a dictionary buffer and an input data string.
【図3】一致長符号テーブルの具体例を示す図である。FIG. 3 is a diagram showing a specific example of a match length code table.
【図4】位置符号テーブルの具体例を示す図である。FIG. 4 is a diagram showing a specific example of a position code table.
【図5】順位符号テーブルの具体例を示す図である。FIG. 5 is a diagram showing a specific example of a rank code table.
【図6】順位テーブルの更新を説明するための図であ
る。FIG. 6 is a diagram for explaining updating of a ranking table.
【図7】データバッファと辞書バッファの更新を説明す
るための図である。FIG. 7 is a diagram for explaining updating of a data buffer and a dictionary buffer.
【図8】一実施例のデータ伸張装置の概略構成を示す図
である。FIG. 8 is a diagram showing a schematic configuration of a data decompression device according to an embodiment.
【図9】辞書バッファの内容の一例を示す図である。FIG. 9 is a diagram showing an example of contents of a dictionary buffer.
【図10】トップバッファおよびチェーンバッファの内
容およびその使い方を説明するための図である。FIG. 10 is a diagram for explaining the contents of a top buffer and a chain buffer and how to use them.
【図11】4文字同時に一致判定を行う場合の辞書バッ
ファの概略構成を示す図である。FIG. 11 is a diagram showing a schematic configuration of a dictionary buffer in the case of determining a match of four characters simultaneously.
【図12】順位テーブルの更新を具体的に説明するため
の図である。FIG. 12 is a diagram for specifically explaining an update of a ranking table.
【図13】一実施例のデータ圧縮装置の詳細な構成を示
す図である。FIG. 13 is a diagram showing a detailed configuration of a data compression apparatus according to an embodiment.
【図14】一実施例のデータ圧縮装置の詳細な構成を示
す図である。FIG. 14 is a diagram showing a detailed configuration of a data compression apparatus according to an embodiment.
【図15】一実施例の辞書・データバッファ内のデータ
領域の詳細な構成を示す図である。FIG. 15 is a diagram showing a detailed configuration of a data area in a dictionary / data buffer according to an embodiment.
【図16】一実施例のデータ伸張装置の詳細な構成を示
す図である。FIG. 16 is a diagram showing a detailed configuration of a data decompression device according to an embodiment.
【図17】従来例の説明図である。FIG. 17 is an explanatory diagram of a conventional example.
【図18】従来例の説明図である。FIG. 18 is an explanatory diagram of a conventional example.
10 データバッファ 12 辞書バッファ 14 バッファ更新部 16 一致長符号化部 18 一致長符号テーブル 20 位置符号化部 22 位置符号テーブル 24 順位符号化部 26 順位符号テーブル 27 順位テーブル 28 テーブル更新部 10 data buffer 12 dictionary buffer 14 buffer update unit 16 match length coding unit 18 match length code table 20 position coding unit 22 position code table 24 rank coding unit 26 rank code table 27 rank table 28 table updating unit
Claims (4)
尾に位置する所定ワード長のデータ列を処理データとし
て、およびその前に位置する所定ワード長のデータ列を
辞書としてそれぞれ格納するデータバッファおよび辞書
バッファと、 前記データバッファ内の処理データを構成する各ワード
について、前記辞書を構成する各ワードと一致するもの
があるか否かを検索し、その最も長い一致長を符号化し
た一致長符号を出力する一致長符号化手段と、 前記一致長符号化手段によって一致の判定が行われた場
合に、一致したワード列の中で最もワード長が長いもの
の前記辞書内の位置を符号化した位置符号を出力する位
置符号化手段と、 非圧縮データの各ワードについて存在確率の高い順にビ
ット長が短い順位符号を対応させた順位テーブルを有し
ており、前記一致長符号化手段によって不一致の判定が
行われた場合に、前記順位テーブルを検索することによ
り前記データバッファ内の処理データの先頭ワードに対
応する順位符号を出力する順位符号化手段と、 前記順位符号化手段による符号化処理が行われた場合
に、符号化の対象となった前記処理データの先頭ワード
を考慮して前記順位テーブルを更新するテーブル更新手
段と、 前記位置符号化手段あるいは前記順位符号化手段による
符号化が行われたときに、符号化が終了した前記処理デ
ータの一部あるいは全部を前記辞書バッファ内の辞書に
移すとともに、この移した分の非圧縮データを前記デー
タバッファに追加して格納する処理を行うバッファ更新
手段と、 を備え、前記辞書内に処理データの各ワードと一致した
ワードがある場合には一致長とその位置とをそれぞれ符
号化し、一致したワードがない場合にはその旨を示す一
致長と処理データの先頭ワードとをそれぞれ符号化する
ことにより圧縮データを得ることを特徴とするデータ圧
縮装置。1. Data for storing a data string of a predetermined word length located at the end of the sequentially input uncompressed data as processing data and a data string of a predetermined word length positioned before it as a dictionary, respectively. The buffer and the dictionary buffer, and for each word forming the processing data in the data buffer, it is searched whether or not there is a match with each word forming the dictionary, and a match obtained by encoding the longest match length. When the match length coding means outputs a long code and the match length coding means determines a match, the position in the dictionary of the longest word length in the matched word string is coded. A position table that outputs a position code that outputs a position code, and a rank table that associates a rank code with a shorter bit length with a higher existence probability for each word of uncompressed data. A rank code that has the rank code and outputs a rank code corresponding to the first word of the processed data in the data buffer by searching the rank table when the match length coding means determines a mismatch. Encoding means, table updating means for updating the ranking table in consideration of the first word of the processed data that has been encoded when the encoding processing is performed by the encoding means, and the position When the encoding is performed by the encoding means or the rank encoding means, a part or all of the encoded processing data is transferred to the dictionary in the dictionary buffer, and the transferred data is not compressed. Buffer updating means for performing a process of additionally storing data in the data buffer, and a word matching each word of the processed data in the dictionary In some cases, the match length and its position are encoded respectively, and when there is no matched word, the match length indicating that fact and the first word of the processed data are encoded respectively to obtain compressed data. And a data compression device.
ていった場合に、異なるワード毎に先頭アドレスを格納
するトップバッファと、 前記辞書バッファ内の辞書の各ワードを先頭から順に見
ていった場合に、同じワードが次に前記辞書内のどのア
ドレスに格納されているかを示すデータを格納するチェ
ーンバッファと、 を含み、前記データバッファ内の処理データの先頭ワー
ドに基づいて前記トップバッファおよび前記チェーンバ
ッファを検索することにより、該当する前記辞書内のア
ドレスを特定することを特徴とするデータ圧縮装置。2. The top buffer according to claim 1, wherein the match length encoding means stores a top address for each different word when each word of the dictionary in the dictionary buffer is viewed in order from the top. A chain buffer that stores data indicating at which address in the dictionary the same word is stored next when each word of the dictionary in the dictionary buffer is sequentially viewed from the beginning, A data compression apparatus characterized in that an address in the corresponding dictionary is specified by searching the top buffer and the chain buffer based on the first word of the processed data in the data buffer.
が互いに連続している複数のメモリ素子により構成され
ており、 前記バッファ更新手段は、符号化が終了した前記処理デ
ータの一部あるいは全部を構成する各ワードを、前記複
数のメモリ素子のそれぞれに分散して格納し、 前記一致長符号化手段は、前記複数のメモリ素子のそれ
ぞれから同時にデータを読み出すことにより、前記一致
検索を行うことを特徴とするデータ圧縮装置。3. The dictionary buffer and the data buffer according to claim 1, wherein the dictionary buffer and the data buffer are composed of a plurality of memory elements whose addresses are continuous with each other, and the buffer updating unit is the processed data that has been encoded. And storing each word constituting a part or all of the plurality of memory elements in a distributed manner in each of the plurality of memory elements, and the coincidence length encoding means reads data from each of the plurality of memory elements at the same time, A data compression device characterized by performing a match search.
ータの中の最後尾に位置する所定ワード長のデータ列を
辞書として格納する辞書バッファと、 順次入力される圧縮データの先頭部分に位置する一致長
符号を復号化して具体的な一致長データを出力する一致
長復号化手段と、 前記圧縮データの先頭部分に位置する一致長符号が一致
を示している場合に、その次に位置する位置符号を復号
化して、前記辞書内の格納位置を示すデータを出力する
位置復号化手段と、 前記圧縮データの先頭部分に位置する一致長符号が一致
を示している場合に、前記位置復号化手段から出力され
るデータに基づいて前記辞書内の格納位置を特定し、こ
の格納位置を先頭アドレスとして前記一致長データの分
だけ前記辞書からデータの読出しを行って、非圧縮デー
タを出力する辞書読出し制御手段と、 前記非圧縮データの各ワードについて存在確率の高い順
に短い順位符号を対応させた順位テーブルを有してお
り、前記圧縮データの先頭部分に位置する一致長符号が
不一致を示している場合に、その次に位置する順位符号
に基づいて前記順位テーブルを検索することにより前記
非圧縮データの復号化を行う順位復号化を行う順位復号
化手段と、 前記順位復号化手段により復号化処理が行われたとき
に、復号化された非圧縮データを考慮して前記順位テー
ブルを更新するテーブル更新手段と、 前記位置復号化手段あるいは前記順位復号化手段による
復号化が行われたときに、復号化が終了した非圧縮デー
タを含ませるように前記辞書の更新を行う辞書更新手段
と、 を備え、一致長符号と位置符号および順位符号のいずれ
か一方とを組み合わせた圧縮データを復号化することに
より伸張データを得ることを特徴とするデータ伸張装
置。4. A dictionary buffer for storing a data string of a predetermined word length, which is located at the end of uncompressed data obtained by decompressing compressed data, as a dictionary, and is located at the beginning of sequentially input compressed data. If the match length decoding means for decoding the match length code that matches and outputs concrete match length data, and the match length code located at the beginning of the compressed data indicate a match, the match length decoding means is positioned next to the match length decoding means. If the position decoding means for decoding the position code and outputting the data indicating the storage position in the dictionary and the matching length code located at the beginning of the compressed data indicate matching, the position decoding is performed. The storage position in the dictionary is specified based on the data output from the means, and the storage position is used as the start address to read the data from the dictionary by the amount corresponding to the matching length data. A dictionary read control means for outputting data, and a rank table in which each word of the uncompressed data is associated with a short rank code in descending order of existence probability, and a matching length located at the beginning of the compressed data. A rank decoding means for performing rank decoding for decoding the non-compressed data by searching the rank table based on the rank code positioned next when the codes indicate disagreement; Table updating means for updating the rank table in consideration of the decoded non-compressed data when the decoding processing is performed by the decoding means, and decoding by the position decoding means or the rank decoding means And a dictionary update means for updating the dictionary so as to include the uncompressed data that has been decoded, when the match length code and the position code and A data decompression device, characterized in that decompressed data is obtained by decoding compressed data combined with either one of the rank codes.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP30335593A JPH07135471A (en) | 1993-11-09 | 1993-11-09 | Data compressor and data expander |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP30335593A JPH07135471A (en) | 1993-11-09 | 1993-11-09 | Data compressor and data expander |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH07135471A true JPH07135471A (en) | 1995-05-23 |
Family
ID=17919986
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP30335593A Withdrawn JPH07135471A (en) | 1993-11-09 | 1993-11-09 | Data compressor and data expander |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH07135471A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006332982A (en) * | 2005-05-25 | 2006-12-07 | Sony Corp | Decoder circuit and decoding method |
JP2011114525A (en) * | 2009-11-26 | 2011-06-09 | Dainippon Printing Co Ltd | Method and device for encoding/decoding numerical data string |
JP2011199782A (en) * | 2010-03-23 | 2011-10-06 | Fujitsu Toshiba Mobile Communications Ltd | Communication apparatus |
JP2012134929A (en) * | 2010-12-24 | 2012-07-12 | Ricoh Co Ltd | Image processing system and image processing method |
KR101705461B1 (en) * | 2015-08-28 | 2017-02-09 | 서울과학기술대학교 산학협력단 | Method and apparatus for encoding and decoding strings |
JP2017169117A (en) * | 2016-03-17 | 2017-09-21 | 株式会社東芝 | Data compression system and method |
JP2024540871A (en) * | 2021-10-15 | 2024-11-06 | ログノベーションズ ホールディングス, エルエルシー | Encoding/Decoding System and Method |
-
1993
- 1993-11-09 JP JP30335593A patent/JPH07135471A/en not_active Withdrawn
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006332982A (en) * | 2005-05-25 | 2006-12-07 | Sony Corp | Decoder circuit and decoding method |
JP2011114525A (en) * | 2009-11-26 | 2011-06-09 | Dainippon Printing Co Ltd | Method and device for encoding/decoding numerical data string |
JP2011199782A (en) * | 2010-03-23 | 2011-10-06 | Fujitsu Toshiba Mobile Communications Ltd | Communication apparatus |
JP2012134929A (en) * | 2010-12-24 | 2012-07-12 | Ricoh Co Ltd | Image processing system and image processing method |
KR101705461B1 (en) * | 2015-08-28 | 2017-02-09 | 서울과학기술대학교 산학협력단 | Method and apparatus for encoding and decoding strings |
JP2017169117A (en) * | 2016-03-17 | 2017-09-21 | 株式会社東芝 | Data compression system and method |
JP2024540871A (en) * | 2021-10-15 | 2024-11-06 | ログノベーションズ ホールディングス, エルエルシー | Encoding/Decoding System and Method |
JP2024541836A (en) * | 2021-10-15 | 2024-11-13 | ログノベーションズ ホールディングス, エルエルシー | Encoding/Decoding System and Method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2915568B2 (en) | Adaptive data compression system for tape drive systems. | |
US5870036A (en) | Adaptive multiple dictionary data compression | |
KR100214055B1 (en) | Data Compressor and Method for Indexed Color Image Data | |
US8838551B2 (en) | Multi-level database compression | |
US9509334B2 (en) | Non-transitory computer-readable recording medium, compression method, decompression method, compression device and decompression device | |
CN1868127B (en) | Data compression system and method | |
CN107305586B (en) | Index generation method, index generation device, and search method | |
KR101748982B1 (en) | Program stored in medium | |
JPH0682370B2 (en) | Character processor | |
JP2000082967A (en) | Data compression method and data compression device | |
JPH05233212A (en) | Device and method for compressing data, and data processing system | |
US7375660B1 (en) | Huffman decoding method | |
US9479195B2 (en) | Non-transitory computer-readable recording medium, compression method, decompression method, compression device, and decompression device | |
JPWO2015019484A1 (en) | Data compression device and data decompression device | |
JPH07135471A (en) | Data compressor and data expander | |
US6404362B1 (en) | Method and apparatus for reducing the time required for decompressing compressed data | |
JP2729416B2 (en) | How to restore text data | |
KR20070011490A (en) | Method and apparatus for compressing and decompressing MBL data in structured block units | |
JPH0628149A (en) | Data compression method for multiple types of data | |
CN117200805B (en) | Compression and decompression method and device with low memory occupation of MCU | |
JP3236747B2 (en) | Data decompression method | |
JP3038234B2 (en) | Dictionary search method for data compression equipment | |
CN114637459B (en) | Device for processing received data | |
US20040258316A1 (en) | Method of digital image data compression and decompression | |
JPH0964753A (en) | Data compression device and data decompression device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20010130 |