JP2010136417A - Data compression device and data decompression device - Google Patents

Data compression device and data decompression device Download PDF

Info

Publication number
JP2010136417A
JP2010136417A JP2010010949A JP2010010949A JP2010136417A JP 2010136417 A JP2010136417 A JP 2010136417A JP 2010010949 A JP2010010949 A JP 2010010949A JP 2010010949 A JP2010010949 A JP 2010010949A JP 2010136417 A JP2010136417 A JP 2010136417A
Authority
JP
Japan
Prior art keywords
data
compression
code
frequency
output
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2010010949A
Other languages
Japanese (ja)
Other versions
JP4905562B2 (en
Inventor
Mitsuyoshi Sasakura
三好 笹倉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Casio Computer Co Ltd
Casio Electronics Co Ltd
Original Assignee
Casio Computer Co Ltd
Casio Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Casio Computer Co Ltd, Casio Electronics Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP2010010949A priority Critical patent/JP4905562B2/en
Publication of JP2010136417A publication Critical patent/JP2010136417A/en
Application granted granted Critical
Publication of JP4905562B2 publication Critical patent/JP4905562B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

<P>PROBLEM TO BE SOLVED: To provide a high-speed and high compression rate data compression device and a data decompression device regarding a compression device and a decompression device for various data such as character data, image data, etc. <P>SOLUTION: The compression device and the decompression device for probability-statistical encoded data on which variable length coding is performed in accordance with an appearance frequency, in which, in an order starting from the maximum appearance frequency, characters are represented with different numbers of bits and registered in distinguishable tables so as to be easily specified, thereby performing compression and decompression at high speed and with high efficiency. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は文字データや画像データ等の各種のデータの圧縮装置、及び、復元装置に関する。   The present invention relates to a compression device and a restoration device for various data such as character data and image data.

今日のコンピュータの急速な進歩に伴い、文字情報や、ベクトル情報、画像情報など、様々な情報がコンピュータで扱われ、扱われるデータ量も急速に増加している。このような現状において、伝送時間の短縮や記憶装置の記憶容量を効率的に利用するため、データに含まれる冗長な部分を省いてデータ量を圧縮するデータ圧縮方法、及びその復元方法が提案されている。   With the rapid progress of today's computers, various types of information such as character information, vector information, and image information are handled by computers, and the amount of data handled is rapidly increasing. Under such circumstances, in order to shorten the transmission time and to efficiently use the storage capacity of the storage device, a data compression method for compressing the data amount by omitting redundant portions included in the data and a restoration method thereof have been proposed. ing.

また、データを圧縮する際に使用される符号化方法として、文字情報、ベクトル情報、画像情報などの様々なデータに適用可能なユニバーサル符号化の手法が採用されている。さらに、ユニバーサル符号化には、文字列の類似性を利用する辞書型符号化方式と、文字の出現頻度を利用する確率統計型符号化方式がある。   Further, as an encoding method used when compressing data, a universal encoding method applicable to various data such as character information, vector information, and image information is adopted. Furthermore, universal encoding includes a dictionary-type encoding method that uses character string similarity and a probability statistical encoding method that uses character appearance frequency.

辞書型符号化方式の代表的な例としてLempel−Ziv符号化があり、この符号化では、更にスライド辞書型(ユニバーサル型)と、動的辞書型(増分分解型)の2つのアルゴリズムが提案されている。スライド辞書型アルゴリズムの改良として、LZSS符号化や1/4インチ・カートリッジ磁気テープの標準圧縮方式であるQICー122符号化等が知られている。一方、動的辞書型アルゴリズムの改良としては、LZW(Lempel-Ziv-Welch)符号化等が知られている。   A typical example of a dictionary-type encoding method is Lempel-Ziv encoding. In this encoding, two algorithms of a slide dictionary type (universal type) and a dynamic dictionary type (incremental decomposition type) have been proposed. ing. As an improvement of the slide dictionary type algorithm, LZSS encoding, QIC-122 encoding, which is a standard compression method for 1/4 inch cartridge magnetic tape, and the like are known. On the other hand, LZW (Lempel-Ziv-Welch) coding or the like is known as an improvement of the dynamic dictionary type algorithm.

また、確率統計型圧縮方式は、統計的な各文字の出現頻度(出現確率)に従い、出現確率の高い文字に対して短い符号長を割り振ることによって圧縮効果を図る方式である。この確率統計型符号化方式の代表的なものとして、例えば算術符号化方式や、ハフマン符号化方式が知られている。ハフマン符号化方式では、各文字に対する符号として、その文字の出現頻度に逆比例した符号長を有する符号(ハフマン符号)が使用される。   Further, the probability statistical compression method is a method for achieving a compression effect by assigning a short code length to characters having a high appearance probability according to the statistical appearance frequency (appearance probability) of each character. As a representative example of this probability statistical coding method, for example, an arithmetic coding method and a Huffman coding method are known. In the Huffman coding method, a code having a code length inversely proportional to the appearance frequency of a character (Huffman code) is used as a code for each character.

一方、上記辞書型符号化方式と確率統計型圧縮方式を併せ持つ複合型のデータ圧縮方法もあり、例えば前述のLZSS法で圧縮したデータをハフマン法で圧縮するLZH法等の方法である。LZSS法が文字列を単位として圧縮する方法であり、ハフマン法は1文字単位の圧縮であるため、互いに補完し合うことが期待できる方法である。   On the other hand, there is also a composite data compression method having both the dictionary coding method and the probability statistical compression method, such as the LZH method for compressing the data compressed by the LZSS method by the Huffman method. The LZSS method is a method of compressing a character string as a unit, and the Huffman method is a method of compressing one character unit, and can be expected to complement each other.

ここで、従来のスライド辞書型アルゴリズム(LZ1)を説明する。このアルゴリズムは、演算量は多いが、高圧縮率が得られる方法である。すなわち、符号化データを過去のデータ系列の任意の位置から一致する最長の系列に区切り(部分列)、過去の文字列の複製として符号化する。図27はこの原理を説明する図である。   Here, a conventional slide dictionary type algorithm (LZ1) will be described. This algorithm is a method that requires a large amount of computation but can provide a high compression rate. That is, the encoded data is divided into a longest sequence that matches from an arbitrary position in the past data series (partial string), and encoded as a copy of the past character string. FIG. 27 is a diagram for explaining this principle.

同図に示すPバッファには符号化済みの入力データが格納されており、Qバッファには符号化前のデータが入力する。この状態で、Qバッファに入力した文字列は、順次Pバッファに格納された文字列と照合され、Pバッファの中に一致する最長の文字列を求め、Pバッファの中に対応する最長文字列が存在すると、符号化処理を行う。例えば、同図に示すように、Pバッファに一致する文字列が存在する場合、[Pバッファの中の最長一致系列(部分文字列)の開始位置p1]、[Qバッファ内の一致する最大の長さq1]として、圧縮データを生成する。尚、この符号化処理により、例えば文字コードの文書情報は1/2程度に圧縮可能である。また、上記スライド辞書型アルゴリズムを用いた発明として、特許文献1がある。   The P buffer shown in the figure stores encoded input data, and the pre-encoded data is input to the Q buffer. In this state, the character string input to the Q buffer is sequentially compared with the character string stored in the P buffer to obtain the longest character string that matches in the P buffer, and the corresponding longest character string in the P buffer. If exists, an encoding process is performed. For example, as shown in the figure, when there is a matching character string in the P buffer, [start position p1 of the longest matching sequence (partial character string) in the P buffer], [maximum matching in the Q buffer] The compressed data is generated as the length q1]. By this encoding process, for example, the document information of the character code can be compressed to about ½. Moreover, there exists patent document 1 as invention which used the said slide dictionary type | mold algorithm.

次に、確率統計型符号化について説明する。確率統計型符号化方法は、図28に示すように入力バッファ、統計モデル部、頻度テーブル、及びエントロピー符号化部で構成され、統計モデル部は最初に全文字列を走査して各文字の出現頻度を算出し、エントロピー符号化部は統計モデル部で求められた出現確率に基づき作成した符号を各文字に割り当てる。   Next, probability statistical coding will be described. The probability statistical coding method is composed of an input buffer, a statistical model section, a frequency table, and an entropy coding section, as shown in FIG. 28. The statistical model section first scans all character strings and the appearance of each character. The frequency is calculated, and the entropy encoding unit assigns a code created based on the appearance probability obtained by the statistical model unit to each character.

統計モデル部において求める出現頻度は、予め各文字の生起確率が求まる静的符号化方式と、最初に全文字列を走査して各文字の生起確率を得る準適応型符号化方式、及び各文字が出現する毎に頻度を取り生起確率を再計算する適応型符号化方式に分類される。尚、上記確率統計型符号化方式を使用した発明として特許文献2が開示されている。   The appearance frequency obtained in the statistical model section includes a static encoding method in which the occurrence probability of each character is obtained in advance, a semi-adaptive encoding method that first obtains the occurrence probability of each character by scanning all character strings, and each character Is classified into an adaptive coding system that takes the frequency and recalculates the probability of occurrence each time. Incidentally, Patent Document 2 is disclosed as an invention using the probability statistical coding system.

特許第3241788号公報Japanese Patent No. 3241788 特許第3276860号公報Japanese Patent No. 3276860

しかしながら、上記圧縮方法では以下の問題がある。
先ず、辞書型符号化方式では、前述のように符号化済みの文字列の中から符号化対象の文字列に最大長に一致する文字部分列を検索し、その文字部分列を複製として符号化を実行する方式であり、高いデータ圧縮率が実現できる。この様なアルゴリズムを実装するには、データの圧縮率をより高めていく構成を採用する必要があると共に、符号化されたデータを利用し易い形式とする必要がある。
However, the above compression method has the following problems.
First, in the dictionary-type encoding method, as described above, a character substring that matches the maximum length of the character string to be encoded is searched from the encoded character string, and the character substring is encoded as a copy. And a high data compression rate can be realized. In order to implement such an algorithm, it is necessary to adopt a configuration in which the data compression rate is further increased, and it is necessary to make the encoded data easy to use.

例えば、前述の例でデータ圧縮率を高めるためには、Pバッファの格納文字数や、Qバッファの格納文字数も増加する必要がある。しかし、PバッファやQバッファの格納文字数を増加すると、符号化データが8ビットの倍数でなくなる。この場合、データを転送する際にビット詰め等の面倒な処理が必要となり、極めて処理効率の悪いデータ圧縮方法となる。   For example, in order to increase the data compression rate in the above example, it is necessary to increase the number of characters stored in the P buffer and the number of characters stored in the Q buffer. However, if the number of characters stored in the P buffer or Q buffer is increased, the encoded data is not a multiple of 8 bits. In this case, troublesome processing such as bit padding is required when transferring data, resulting in a data compression method with extremely low processing efficiency.

また、ハードウエアで実現する場合、より大きなウィンドウサイズとなり、圧縮及び復元回路が単一の集積回路上に配置される場合問題となる。すなわち、回路が膨大になり、必要なハードウエアのコストが非常に高くなる。また、ウィンドウサイズを大きくすると、比較演算量が膨大になり、性能劣化を引き起す。   Also, when implemented in hardware, the window size is larger, which is a problem when the compression and decompression circuits are arranged on a single integrated circuit. That is, the circuit becomes enormous and the required hardware cost becomes very high. Further, when the window size is increased, the amount of comparison calculation becomes enormous and causes performance degradation.

一方、確率統計型符号化方式では、1文字を符号化すると、整数ビットからなる符号が生成される。これに対し、算術符号化では一文字に対して端数ビットを割り当てることができる。算術符号化では、0以上、1未満の区間が、符号化すべきデータを構成する各文字の出現頻度に応じて順次狭められる。そして、全ての文字に対する処理が終了したとき、狭められた区間内の1点を表す数値が符号として出力される。   On the other hand, in the probability statistical encoding method, when one character is encoded, a code composed of integer bits is generated. On the other hand, in arithmetic coding, fractional bits can be assigned to one character. In arithmetic coding, the interval from 0 to less than 1 is sequentially narrowed according to the appearance frequency of each character constituting the data to be encoded. When processing for all characters is completed, a numerical value representing one point in the narrowed section is output as a code.

したがって、確率統計型符号化では、統計モデル部とエントロピー符号化部の2パスで符号化するため、処理速度が低速となる。また、可変長符号化のため、ソフトウエア的には、ビット操作を行う必要があり、この処理に時間を要する。   Therefore, in the stochastic statistical coding, the processing speed is low because the coding is performed in two passes of the statistical model unit and the entropy coding unit. Also, because of variable length coding, it is necessary to perform bit operations in software, and this processing takes time.

そこで、本発明は確率統計型符号化のデータ圧縮装置によって、より高速で且つ圧縮効率の高い、データ圧縮、及び復元装置、を提供するものである。   Therefore, the present invention provides a data compression and decompression device that is faster and has a higher compression efficiency by using a data compression device of probability statistical coding.

上記課題は本発明によれば、出現頻度に応じて可変長符号化する確率統計型符号化のデータ圧縮装置において、出現頻度が最も多いデータの抽出を行う情報を第1のテーブルと第2のテーブルに2ビットで記録し、次に多い2個のデータの抽出を行う情報を第1乃至第3のテーブル及び第5のテーブルに4ビットで記録し、更に次に多い4個のデータの抽出を行う情報を第1乃至第4のテーブル及び第6のテーブルに6ビットで記録し、更に次に多い16個のデータの抽出を行う情報を第1乃至第4のテーブル及び第7のテーブルに8ビットで記録し、その他のデータを第8のテーブルに9ビットで記録する手段と、前記出現頻度の順位に対応するデータコードをコードテーブルに記録する手段とを有するデータ圧縮装置を提供することによって達成できる。   According to the present invention, according to the present invention, in the data compression apparatus of probability statistical coding that performs variable length coding according to the appearance frequency, information for extracting data having the highest appearance frequency is stored in the first table and the second table. Information is recorded in 2 bits in the table, and the next two pieces of data are extracted in 4 bits in the first to third tables and the fifth table, and the next four pieces of data are extracted. Is recorded in 6 bits in the first to fourth tables and the sixth table, and information for extracting the next 16 data is recorded in the first to fourth tables and the seventh table. To provide a data compression apparatus having means for recording 8 bits and recording other data in the eighth table in 9 bits and means for recording data codes corresponding to the ranks of the appearance frequencies in the code table By It can be achieved Te.

このように構成することにより、確率統計型符号化のデータ圧縮装置によってもデータ圧縮処理を行うことができる。
尚、出現頻度が最も多いデータとその他のデータのみである場合、圧縮データであるか否かの情報を前記第1のテーブルに記録し、前記コードテーブルには前記出現頻度が最も多いデータのコードが記録される。
With this configuration, data compression processing can be performed also by a data compression apparatus using probability statistical coding.
If only the most frequently appearing data and other data are included, information indicating whether the data is compressed data is recorded in the first table, and the code of the most frequently occurring data is recorded in the code table. Is recorded.

また、上記課題は本発明によれば、出現頻度に応じて可変長符号化された確率統計型符号化データの復元装置において、第1のテーブルを参照して圧縮データであるか否かの情報を取得し、圧縮データではない場合第8のテーブルに記録されたコードデータを読み出し、圧縮データであれば第2のテーブルを参照して出現頻度が最も多いデータであるか否かの情報を取得し、出現頻度が最も多いデータであれば、コードテーブルから対応する出現頻度のコードデータを読み出す手段と、前記出現頻度が最も多いデータでない場合、更に第3のテーブルを参照し、出現頻度が次に多い2個のデータであるか否かの情報を取得し、出現頻度が次に多い2個のデータであれば、更に第5のテーブルを参照し、出現頻度が2番目に多いデータであるか3番目に多いデータであるかの情報を取得し、前記コードテーブルから対応する出現頻度のコードデータを読み出す手段と、前記出現頻度が次に多い2個のデータでない場合、更に第4のテーブルを参照し、出現頻度が次に多い4個のデータであるか否かの情報を取得し、出現頻度が次に多い4個のデータであれば、更に第6のテーブルを参照し、出現頻度が4番目乃至7番目に多いデータであるかの情報を取得し、前記コードテーブルから対応する出現頻度のコードデータを読み出す手段と、前記出現頻度が次に多い4個のデータでない場合、更に第7のテーブルを参照し、出現頻度が次に多い16個のデータの情報を取得し、前記コードテーブルから対応する出現頻度のコードデータを読み出す手段とを有するデータ復元装置を提供することによって達成できる。   Further, according to the present invention, in the restoration apparatus for probability statistical type encoded data that is variable length encoded according to the appearance frequency, the above-described problem is information regarding whether or not the data is compressed data with reference to the first table. If the data is not compressed data, the code data recorded in the eighth table is read. If the data is compressed data, the second table is referenced to obtain information on whether or not the data has the highest frequency of appearance. If the data has the highest frequency of appearance, means for reading out the code data of the corresponding frequency of appearance from the code table, and if the data does not have the highest frequency of appearance, the third table is further referred to Information about whether or not there are two more frequently-occurring data, and if the two most frequently appearing data, the fifth table is referred to and the data that has the second most frequently appearing data. Or Means for reading out the information indicating whether the data is the second largest number of data, and reading out the code data of the corresponding appearance frequency from the code table; and, if the two occurrence data are not the second most frequent data, further refer to the fourth table Then, information on whether or not there are four pieces of data having the next highest appearance frequency is acquired, and if the four pieces of data having the next highest occurrence frequency, the sixth table is further referred to, and the appearance frequency is 4 Means for obtaining information on whether the data is the seventh to seventh most frequent data, and reading out the code data of the corresponding appearance frequency from the code table; There is provided a data restoration device having means for referring to a table, obtaining information of 16 pieces of data having the next highest appearance frequency, and reading out code data of the corresponding appearance frequency from the code table. It can be achieved by the.

このように構成することにより、確率統計型符号化データの復元装置を実現することができる。
尚、出現頻度が最も多いデータとその他のデータのみである場合、前記第1のテーブルを参照して圧縮データであるか否かの情報を取得し、圧縮データではない場合コードテーブルから対応するコードデータを読み出す構成である。
With this configuration, it is possible to realize a probability statistical type encoded data restoration apparatus.
If only the most frequently appearing data and other data are present, the first table is referred to obtain information on whether or not the data is compressed data. If the data is not compressed data, the corresponding code is read from the code table. This is a configuration for reading data.

本発明によれば、確率統計型符号化のデータ圧縮装置によって、より高速で且つ圧縮効率の高い、データ圧縮、及び復元装置を提供することができる。   ADVANTAGE OF THE INVENTION According to this invention, the data compression and decompression | restoration apparatus of higher speed and high compression efficiency can be provided by the data compression apparatus of a stochastic statistical type encoding.

また、確率統計型符号化のデータ圧縮装置により圧縮されたデータの復元を高速且つ高効率に行うことができる。   In addition, the data compressed by the data compressing apparatus of the probability statistical coding can be restored at high speed and with high efficiency.

実施形態1のデータ圧縮装置のシステム構成図である。1 is a system configuration diagram of a data compression apparatus according to Embodiment 1. FIG. (a)は、入力データの構成を説明する図であり、(b)は、圧縮データの具体的な構成を示す図であり、(c)及び(d)は、フラグデータの構成を説明する図であり、(e)は、非圧縮データの構成を説明する図であり、(f)は、圧縮データの構成を説明する図である。(A) is a figure explaining the structure of input data, (b) is a figure which shows the specific structure of compressed data, (c) And (d) demonstrates the structure of flag data. (E) is a figure explaining the structure of uncompressed data, (f) is a figure explaining the structure of compressed data. 実施形態2の構成を説明する図である。6 is a diagram illustrating a configuration of Embodiment 2. FIG. 実施形態3の圧縮処理を説明する図である。It is a figure explaining the compression process of Embodiment 3. FIG. 識別データの例を示す図である。It is a figure which shows the example of identification data. 実施形態4の圧縮処理を説明する図である。It is a figure explaining the compression process of Embodiment 4. FIG. 識別データの例を示す図である。It is a figure which shows the example of identification data. 実施形態5の圧縮処理を説明する図である。FIG. 10 is a diagram illustrating compression processing according to a fifth embodiment. 準備処理部の構成を説明する図である。It is a figure explaining the structure of a preparation process part. 準備処理部が行う処理を説明するフローチャートである。It is a flowchart explaining the process which a preparation process part performs. 圧縮フォーマットの例を示す図である。It is a figure which shows the example of a compression format. エントロピー符号化処理部が行う処理を説明するフローチャートである。It is a flowchart explaining the process which an entropy encoding process part performs. 実施形態6の圧縮処理を説明する図であるFIG. 10 is a diagram illustrating compression processing according to a sixth embodiment. 判定パターンの例を示す図である。It is a figure which shows the example of a determination pattern. 圧縮効率判定部が計算結果から判定して出力する圧縮フォーマットの出力形式を示す図である。It is a figure which shows the output format of the compression format which a compression efficiency determination part determines and outputs from a calculation result. 圧縮フォーマットの構成を示す図である。It is a figure which shows the structure of a compression format. エントロピー符号化処理部が行う処理を示すフローチャートである。It is a flowchart which shows the process which an entropy encoding process part performs. 実施形態8を説明する図である。FIG. 10 is a diagram for explaining an eighth embodiment. (a)は、圧縮データの構成を説明する図であり、(c)及び(d)は、フラグデータの構成を説明する図であり、(e)は、非圧縮データの構成を説明する図であり、(f)は、圧縮データの構成を説明する図であり、(g)は、連長圧縮の識別情報を説明する図である。(A) is a figure explaining the structure of compressed data, (c) and (d) are figures explaining the structure of flag data, (e) is a figure explaining the structure of non-compressed data. (F) is a figure explaining the structure of compression data, (g) is a figure explaining the identification information of continuous length compression. 実施形態9を説明する図である。It is a figure explaining Embodiment 9. FIG. 実施形態10を説明する図である。It is a figure explaining Embodiment 10. FIG. 実施形態11のデータ復元装置を説明する図である。It is a figure explaining the data decompression | restoration apparatus of Embodiment 11. FIG. 実施形態12のデータ復元装置を説明する図である。It is a figure explaining the data decompression | restoration apparatus of Embodiment 12. 実施形態13のデータ復元装置を説明するフローチャートである。18 is a flowchart illustrating a data restoration device according to a thirteenth embodiment. 実施形態14のデータ復元処理を説明する図である。FIG. 20 is a diagram illustrating data restoration processing according to the fourteenth embodiment. 実施形態15のデータ復元処理を説明する図である。FIG. 20 is a diagram illustrating data restoration processing according to the fifteenth embodiment. 従来例のデータ圧縮処理を説明する図である。It is a figure explaining the data compression process of a prior art example. 従来例のデータ圧縮処理を説明する図である。It is a figure explaining the data compression process of a prior art example.

以下、本発明の実施の形態を図面を参照しながら説明する。
(実施形態1)
図1は、本実施形態のデータ圧縮装置のシステム構成図である。
Embodiments of the present invention will be described below with reference to the drawings.
(Embodiment 1)
FIG. 1 is a system configuration diagram of a data compression apparatus according to the present embodiment.

同図において、圧縮手段1は適応型の辞書型符号化方法(Lempel-Ziv法)を用いた第1の圧縮手段であり、圧縮手段2は準適応型(semi-adaptive)確率統計型符号化方法を用いた第2の圧縮手段である。入力データ列は、圧縮手段1に入力し、圧縮手段1によって符号化処理を行う。圧縮手段1によって符号化されたデータは中間データバッファ(RAM)13に供給され、更に後述する圧縮手段2によって圧縮処理が行われる。   In the figure, compression means 1 is a first compression means using an adaptive dictionary-type coding method (Lempel-Ziv method), and compression means 2 is a semi-adaptive probability statistical coding. It is the 2nd compression means using the method. The input data string is input to the compression unit 1 and encoded by the compression unit 1. The data encoded by the compression means 1 is supplied to an intermediate data buffer (RAM) 13 and further compressed by the compression means 2 described later.

圧縮手段1に入力するデータ列は、例えば文字データ、ベクトルデータ、画像データ等のデータであり、圧縮手段1は入力データを符号化済データの部分列のうち、最長一致するものを検索して符号化する、適応型の辞書型符号化方法であって、その識別フラグを除く符号データを1バイトデータとして出力し、また識別フラグ(1ビット)は8個まとめて1バイトデータとして出力することにより、全てバイト単位の出力とする。   The data string input to the compression means 1 is, for example, data such as character data, vector data, and image data. The compression means 1 searches the input data for the longest match among the partial strings of encoded data. An adaptive dictionary encoding method for encoding, wherein code data excluding the identification flag is output as 1-byte data, and eight identification flags (1 bit) are output collectively as 1-byte data. As a result, the output is in byte units.

図2は上記構成を具体的に説明する図である。先ず、同図(a)に示すように、入力データバッファ3はPバッファ4とQバッファ5で構成され、Pバッファ4は履歴バッファであり、32バイトで構成されている。また、Qバッファ5には入力文字列が供給され、9バイトで構成されている。また、同図に示す太枠Aはスライディング・ウィンドウであり、同図に示す矢印c方向にスライド可能に構成されている。   FIG. 2 is a diagram for specifically explaining the above configuration. First, as shown in FIG. 2A, the input data buffer 3 is composed of a P buffer 4 and a Q buffer 5, and the P buffer 4 is a history buffer and is composed of 32 bytes. An input character string is supplied to the Q buffer 5 and is composed of 9 bytes. A thick frame A shown in the figure is a sliding window, and is configured to be slidable in the direction of arrow c shown in the figure.

入力文字列は、前述のように文字データ、ベクトルデータ、画像データ等のデータであり、具体的にはスライディング・ウィンドウAを矢印c方向にスライドすることによって、Qバッファ5への入力データの取り込みを行う。   As described above, the input character string is data such as character data, vector data, and image data. Specifically, the input character string is input to the Q buffer 5 by sliding the sliding window A in the direction of arrow c. I do.

図2(b)は、圧縮データの具体的な構成を示す図である。最初の1バイトはフラグデータであり、フラグデータの後に8個の圧縮データ(及び非圧縮データ)が記録されている。フラグデータは同図(c)に示すように、1バイト8ビットのデータであり、データ“0”が非圧縮データを示し、データ“1”が圧縮データを示す。また、同図(c)に示す#1〜#8は、フラグデータに続く圧縮データ(及び非圧縮データ)に付された#1〜#8に対応する。   FIG. 2B is a diagram showing a specific configuration of the compressed data. The first byte is flag data, and eight compressed data (and uncompressed data) are recorded after the flag data. The flag data is 1-byte 8-bit data as shown in FIG. 5C, where data “0” indicates uncompressed data and data “1” indicates compressed data. Also, # 1 to # 8 shown in FIG. 6C correspond to # 1 to # 8 attached to the compressed data (and uncompressed data) following the flag data.

例えば、最初のフラグデータ(#1)がフラグ“1”である場合、8個の圧縮データ及び非圧縮データの最初の(#1)のデータは、1バイト(8ビット)の圧縮データである。同図(f)に示すデータ構成は、上記圧縮データの例を示し、上位5ビットが一致開始位置のデータを記録し、下位3ビットが一致文字列の長さデータを記録する。したがって、Pバッファ4は5ビットで表せる容量を有するバッファであり、また9バイトの文字列のデータの一致検索を行うことができる。   For example, when the first flag data (# 1) is the flag “1”, the first (# 1) data of the 8 compressed data and the uncompressed data is 1-byte (8-bit) compressed data. . The data structure shown in FIG. 5F shows an example of the compressed data, in which the upper 5 bits record the data at the match start position, and the lower 3 bits record the length data of the matched character string. Therefore, the P buffer 4 is a buffer having a capacity that can be expressed by 5 bits, and can perform a matching search of data of a 9-byte character string.

一方、最初のフラグデータ(#1)がフラグ“0”である場合、8個の圧縮データ(及び非圧縮データ)の最初の(#1)のデータは、1バイト(8ビット)の非圧縮データである。同図(e)に示すデータ構成は、この非圧縮データの例を示し、原データのまま記述される。   On the other hand, when the first flag data (# 1) is the flag “0”, the first (# 1) data of the eight compressed data (and uncompressed data) is 1 byte (8 bits) uncompressed. It is data. The data structure shown in FIG. 5 (e) shows an example of the uncompressed data, and is described as the original data.

尚、#2以降の圧縮データ(及び非圧縮データ)についても同様であり、フラグデータに記録されたフラグの状態に対応した圧縮データ、又は非圧縮データが記録されている。尚、上記8個の圧縮データ(及び非圧縮データ)に続くフラグデータは、同図(d)に示すように、次の#9〜#16の圧縮データ(及び非圧縮データ)の情報が記録されている。   The same applies to the compressed data (and uncompressed data) after # 2, and compressed data or non-compressed data corresponding to the state of the flag recorded in the flag data is recorded. The flag data following the above eight compressed data (and uncompressed data) is recorded with information of the following compressed data (and uncompressed data) # 9 to # 16 as shown in FIG. Has been.

本例では、スライド辞書のPバッファ(履歴バッファ)とQバッファを小さくし、その文字列参照の符号化データ(その識別フラグを除く)を1バイトデータとして全てバイト単位の出力としている。   In this example, the P buffer (history buffer) and Q buffer of the slide dictionary are made small, and the encoded data (excluding the identification flag) of the character string reference is output as byte data as 1 byte data.

したがって、本例によれば、第1の圧縮手段のスライド辞書を小さくしたことにより、圧縮効果はやや低下するが、処理の高速化を図ることができる。また、ハード構成においても、履歴アレイやシフトレジスタの「スライド辞書のPバッファ」と、比較器等が非常に少なくすることができ、回路規模を小さくすることもできる。   Therefore, according to this example, by reducing the slide dictionary of the first compression means, the compression effect is slightly reduced, but the processing speed can be increased. Also in the hardware configuration, the “slide dictionary P-buffer” of the history array and the shift register, the comparators, and the like can be greatly reduced, and the circuit scale can be reduced.

また、第2の圧縮手段を備えたことにより、圧縮効率が低下した分、第2の圧縮処理によりカバーでき、高圧縮、高効率の圧縮装置を実現できる。
また、第1の圧縮手段を全てバイトデータで取り扱うことにより、第1、第2の圧縮手段共に、全てバイト単位で扱うことができ、ビット操作を極力少なくでき、高速化を図ることができる。
(実施形態2)
次に、本発明の実施形態2について説明する。
In addition, since the second compression means is provided, the amount of compression efficiency can be reduced by the second compression process, and a high-compression and high-efficiency compression apparatus can be realized.
In addition, by handling all the first compression means with byte data, both the first and second compression means can be handled in units of bytes, bit operations can be reduced as much as possible, and high speed can be achieved.
(Embodiment 2)
Next, Embodiment 2 of the present invention will be described.

図3は、本実施形態の圧縮装置を説明するシステム構成図である。同図も前述の図1と同様、圧縮手段11は適応型の辞書型符号化方法(Lempel-Ziv法)を用いた第1の圧縮手段であり、圧縮手段12は準適応型(semi-adaptive)確率統計型符号化方法を用いた第2の圧縮手段である。但し、本例の圧縮手段11は圧縮手段12で使用する出現頻度の計数処理も同時に行う構成である。以下、具体的に説明する。   FIG. 3 is a system configuration diagram illustrating the compression device according to the present embodiment. As in FIG. 1, the compression means 11 is a first compression means using an adaptive dictionary type encoding method (Lempel-Ziv method), and the compression means 12 is a semi-adaptive type. ) Second compression means using a probability statistical type encoding method. However, the compression means 11 of this example is configured to simultaneously perform the appearance frequency counting process used by the compression means 12. This will be specifically described below.

本例においても、前述の実施形態例と同様、入力データは圧縮手段1に入力し、符号化処理が行われる。圧縮手段1に入力するデータ列は、例えば文字データ等であり、圧縮手段1は入力データを辞書内の符号化済データの部分列のうち、最長一致するものを検索して符号化する。この符号化されたデータは、RAMで構成される中間データバッファ13に供給され、所定量の符号化データが入力すると、圧縮手段12に出力する。   Also in this example, as in the above-described embodiment, input data is input to the compression unit 1 and subjected to encoding processing. The data string input to the compression unit 1 is, for example, character data, and the compression unit 1 searches for and encodes the longest matching partial sequence of encoded data in the dictionary. The encoded data is supplied to an intermediate data buffer 13 composed of a RAM, and when a predetermined amount of encoded data is input, it is output to the compression means 12.

一方、圧縮手段11は圧縮手段12で行う圧縮処理に必要な出現頻度の計数処理を行い、計数結果を頻度テーブル14に出力する。すなわち、圧縮手段12で使用する頻度テーブルを生成し、圧縮手段12が行う確率統計型符号化方法を用いた圧縮処理を効率よく行えるように構成する。   On the other hand, the compression unit 11 performs a count process of the appearance frequency necessary for the compression process performed by the compression unit 12 and outputs the count result to the frequency table 14. That is, a frequency table used by the compression unit 12 is generated, and a compression process using the probability statistical coding method performed by the compression unit 12 is configured to be performed efficiently.

このように、本例によれば第1の圧縮手段である圧縮手段11により符号データを生成する際、出現頻度の計数も同時に行うことにより、第2の圧縮手段である圧縮手段12は頻度テーブルのデータを使用して圧縮処理を行うことができ、圧縮処理の高速化を図ることができる。
(実施形態3)
次に、本発明の実施形態3について説明する。
As described above, according to this example, when the code data is generated by the compression unit 11 as the first compression unit, the appearance frequency is counted at the same time, so that the compression unit 12 as the second compression unit can perform the frequency table. The data can be used for compression processing, and the compression processing can be speeded up.
(Embodiment 3)
Next, a third embodiment of the present invention will be described.

図4は、本実施形態の圧縮処理を説明する図である。同図において、入力バッファ20には前述の文字データ等の入力データ列が供給され、この入力データは入力バッファ20から更に第1の圧縮手段である圧縮手段21に供給される。圧縮手段21は前述と同様、適応型の辞書型符号化方法を用いた圧縮手段であり、出現頻度の計数処理も行う。   FIG. 4 is a diagram for explaining the compression processing of this embodiment. In the figure, an input data string such as the aforementioned character data is supplied to the input buffer 20, and this input data is further supplied from the input buffer 20 to the compression means 21 which is the first compression means. The compression means 21 is a compression means using an adaptive dictionary type encoding method as described above, and also performs appearance frequency counting processing.

圧縮手段21では、入力データの符号化を行い、中間データバッファ23に出力すると共に、上記のように第1のデータ圧縮手段の出力データのサイズの計数、及び符号化データを生成する際の出現頻度の計数も同時に行う。   The compression means 21 encodes the input data, outputs it to the intermediate data buffer 23, counts the size of the output data of the first data compression means, and appears when generating the encoded data as described above. Count the frequency at the same time.

頻度テーブル24は、上記出現頻度を記録するテーブルであり、上記圧縮手段21から出力される計数データをカウンタアップし、例えば文字コード毎に出現頻度のデータを記録する。サイズ算出・判定手段25は、第2の圧縮手段である圧縮手段22が圧縮処理を行った場合の圧縮データサイズ(圧縮率)を計算し、第1の圧縮後のサイズよりも出力データ量が増加するか判定する。   The frequency table 24 is a table for recording the appearance frequency, counts up the count data output from the compression means 21, and records the data of the appearance frequency for each character code, for example. The size calculation / determination unit 25 calculates a compressed data size (compression ratio) when the compression unit 22 as the second compression unit performs the compression process, and the output data amount is larger than the size after the first compression. Determine if it increases.

そして、出力データ量が増加すると判定する場合には、識別データとしてマジックナンバー1を出力する。一方、出力データ量が増加しないと判定する場合には、識別データとしてマジックナンバー2を出力する。   When it is determined that the amount of output data increases, magic number 1 is output as identification data. On the other hand, when it is determined that the amount of output data does not increase, magic number 2 is output as identification data.

また、サイズ算出・判定手段25は、出力データ量が増加すると判定する場合、第2の圧縮処理を行うことなく、元データ出力手段26に対して中間データバッファ23に記録された第1の圧縮結果を出力データバッファ27に出力するよう指示する。一方、出力データ量が増加しないと判定する場合、第2の圧縮手段である圧縮手段22に対し、中間データバッファ23に記録された第1の圧縮結果のデータ列を入力し、第2の圧縮処理を行うよう指示する。   When the size calculation / determination unit 25 determines that the amount of output data increases, the first compression recorded in the intermediate data buffer 23 with respect to the original data output unit 26 without performing the second compression process. Instructs the output data buffer 27 to output the result. On the other hand, when it is determined that the amount of output data does not increase, the data string of the first compression result recorded in the intermediate data buffer 23 is input to the compression unit 22 as the second compression unit, and the second compression is performed. Instruct to process.

図5は上記識別データの例を示す図であり、マジックナンバーを2つ用意し、同図(a)に示すマジックナンバー1は第1の圧縮方法で圧縮処理し、第2の圧縮方法での処理を行わなかった場合の識別データを示す。一方、図(b)に示すマジックナンバー2は第1の圧縮方法で圧縮処理し、更に第2の圧縮方法で圧縮処理を実施したことを示す。尚、上記識別データについては、2つのマジックナンバーに代えて、本圧縮方法で圧縮したことを示すマジックナンバーと、第2の圧縮を行ったか/行わなかったかを示すフラグで構成してもよい。   FIG. 5 is a diagram showing an example of the identification data. Two magic numbers are prepared. The magic number 1 shown in FIG. 5A is compressed by the first compression method, and the second compression method is used. The identification data when processing is not performed is shown. On the other hand, magic number 2 shown in FIG. 5B indicates that the compression processing is performed by the first compression method and the compression processing is further performed by the second compression method. The identification data may be composed of a magic number indicating that compression is performed by the present compression method and a flag indicating whether or not the second compression is performed, instead of the two magic numbers.

上記処理により、出力データバッファ27には、識別データに対応する出力が供給され、出力データバッファ27から圧縮処理されたデータが出力される。
以上のように、本例によれば第1の圧縮処理を行った後、第2の圧縮処理を行った場合の圧縮データサイズ(圧縮率)を計算し、第1の圧縮処理後の出力データサイズよりデータ量が増加する場合第2の圧縮を行うことなく、第1の圧縮処理の結果よりサイズが増大する圧縮処理を行うことを回避できる。また、無駄な第2の圧縮処理を行わずに済み、効率のよい圧縮処理が可能となる。
(実施形態4)
次に、本発明の実施形態4について説明する。
Through the above processing, an output corresponding to the identification data is supplied to the output data buffer 27, and the compressed data is output from the output data buffer 27.
As described above, according to this example, after performing the first compression process, the compressed data size (compression ratio) when the second compression process is performed is calculated, and the output data after the first compression process is calculated. When the data amount increases from the size, it is possible to avoid performing the compression process in which the size increases from the result of the first compression process without performing the second compression. Further, it is not necessary to perform the useless second compression process, and an efficient compression process is possible.
(Embodiment 4)
Next, a fourth embodiment of the present invention will be described.

図6は、本実施形態の圧縮処理を説明する図である。本例は前述の実施形態3に対して、更にもう1つ出現頻度テーブルを設け、より効率のよい圧縮処理を可能とする構成である。以下、具体的に説明する。尚、前述の図4と同じ構成部分には同じ番号を使用して説明する。   FIG. 6 is a diagram for explaining the compression processing of this embodiment. In this example, another appearance frequency table is provided with respect to the above-described third embodiment to enable more efficient compression processing. This will be specifically described below. The same components as those in FIG. 4 will be described using the same numbers.

前述と同様、入力データバッファ20には文字データ等の入力データ列が供給され、更に入力データバッファ20に供給された入力データは、第1の圧縮手段である圧縮手段21に供給される。圧縮手段21は適応型の辞書型符号化方法を用いた圧縮手段であり、入力データの圧縮処理を行い、中間データバッファ23に符号化データを出力する。また、前述と同様、入力データ列及び第1圧縮後の符号化データ列の各サイズの計数と各データ列のデータの出現頻度の計数も同時に行う。   As described above, an input data string such as character data is supplied to the input data buffer 20, and the input data supplied to the input data buffer 20 is further supplied to the compression means 21 which is the first compression means. The compression unit 21 is a compression unit using an adaptive dictionary type encoding method, performs compression processing of input data, and outputs encoded data to the intermediate data buffer 23. Further, as described above, the count of each size of the input data string and the encoded data string after the first compression and the appearance frequency of the data of each data string are simultaneously performed.

本例において、頻度テーブルは24a、24bの2つの頻度テーブルを有し、頻度テーブル24a、24bは前述と同様、例えば文字コード毎に出現頻度のデータを記録する。また、サイズ算出・判定手段25は、第2の圧縮手段である圧縮手段22が圧縮処理を行った場合の圧縮データサイズ(圧縮率)を計算し、第1の圧縮後のサイズよりも出力データ量が増加するか判定する。   In this example, the frequency table has two frequency tables 24a and 24b, and the frequency tables 24a and 24b record appearance frequency data for each character code, for example, as described above. The size calculation / determination unit 25 calculates a compressed data size (compression ratio) when the compression unit 22 as the second compression unit performs the compression process, and outputs the output data from the size after the first compression. Determine if the amount increases.

サイズ算出・判定手段25は、以下(1)〜(4)のサイズを知り、以下の処理を行う。すなわち、(1)入力(原)データ列のサイズ、(2)第1の圧縮手段の出力サイズ、(3)入力(原)データ列を第2の圧縮手段のみで圧縮した場合の出力サイズ、(4)第1の圧縮手段の出力データ列を第2の圧縮手段で更に圧縮した場合の出力サイズ。   The size calculation / determination means 25 knows the sizes (1) to (4) below and performs the following processing. That is, (1) the size of the input (original) data string, (2) the output size of the first compression means, (3) the output size when the input (original) data string is compressed only by the second compression means, (4) Output size when the output data string of the first compression means is further compressed by the second compression means.

先ず、上記(1)が最小となる場合、入力データをそのまま出力する。すなわち、サイズ算出・判定手段25は、識別データとしてマジックナンバー1を出力し、元データ出力手段26に対して、入力データバッファ20に入力したデータ列を出力するように指示する。したがって、第1の圧縮処理、及び第2の圧縮処理を行うことなく、入力バッファ20に供給された入力データを元データ出力手段26に出力し、更に元データ出力手段26から出力データバッファ27介して出力を行う。   First, when (1) is minimized, the input data is output as it is. That is, the size calculation / determination means 25 outputs magic number 1 as identification data, and instructs the original data output means 26 to output the data string input to the input data buffer 20. Therefore, the input data supplied to the input buffer 20 is output to the original data output means 26 without performing the first compression process and the second compression process, and further from the original data output means 26 via the output data buffer 27. Output.

次に、上記(2)が最小となる場合、第1の圧縮処理を行い、第2の圧縮処理を行うことなく、データ列の出力を行う。すなわち、この場合、サイズ算出・判定手段25は、識別データとしてマジックナンバー2を出力し、元データ出力手段26に対し、中間データバッファ23に記録されたデータ列の出力を行うように指示する。したがって、この場合、中間データバッファ23に格納された符号化データは元データ出力手段26、出力データバッファ27を介して出力される。   Next, when (2) is minimized, the first compression process is performed, and the data string is output without performing the second compression process. That is, in this case, the size calculation / determination means 25 outputs the magic number 2 as the identification data and instructs the original data output means 26 to output the data string recorded in the intermediate data buffer 23. Therefore, in this case, the encoded data stored in the intermediate data buffer 23 is output via the original data output means 26 and the output data buffer 27.

次に、上記(3)が最小となる場合、入力データを第2の圧縮処理のみを行い出力する。すなわち、この場合、サイズ算出・判定手段25は識別データとしてマジックナンバー3を出力し、第2の圧縮手段22に対し、入力データバッファ20からデータ列の入力を行わせ、第2の圧縮処理を施すよう指示する。したがって、この指示に基づき、第2の圧縮手段22は、入力データバッファ20のデータ列を入力し、第2の圧縮処理を施し、出力データバッファ27にデータ出力を行う。   Next, when the above (3) is minimum, the input data is output after being subjected only to the second compression process. That is, in this case, the size calculation / determination means 25 outputs the magic number 3 as identification data, causes the second compression means 22 to input the data string from the input data buffer 20, and performs the second compression processing. Instruct to apply. Therefore, based on this instruction, the second compression means 22 inputs the data string of the input data buffer 20, performs the second compression process, and outputs the data to the output data buffer 27.

次に、上記(4)が最小となる場合、入力データに対して第1、第2の圧縮処理を行い出力する。すなわち、この場合、サイズ算出・判定手段25は識別データとしてマジックナンバー4を出力し、第2の圧縮手段22に対し、圧縮処理を指示する。したがって、この指示に基づき、圧縮手段22は、中間データバッファ23に記録された符号化データに対して、更に圧縮処理を施し、出力データバッファ27を介して圧縮データの出力を行う。   Next, when (4) is minimized, the first and second compression processes are performed on the input data and output. That is, in this case, the size calculation / determination means 25 outputs the magic number 4 as the identification data, and instructs the second compression means 22 to perform compression processing. Therefore, based on this instruction, the compression means 22 further compresses the encoded data recorded in the intermediate data buffer 23 and outputs the compressed data via the output data buffer 27.

尚、識別データの各マジックナンバーの意味は図7(a)に示す通りであり、マジックナンバーを4つ用意し、マジックナンバー1は本圧縮方法で圧縮したことと第1、第2の圧縮共に未実施を示し、マジックナンバー2は本圧縮方法で圧縮したことと第1の圧縮は実施、第2の圧縮は未実施を示し、マジックナンバー3は本圧縮方法で圧縮したことと第1の圧縮は未実施、第2の圧縮は実施したことを示し、マジックナンバー4は本圧縮方法で圧縮したことと第2の圧縮共に実施した意味を持つ。   The meaning of each magic number in the identification data is as shown in FIG. 7A. Four magic numbers are prepared. Magic number 1 is compressed by this compression method and both the first and second compressions are performed. Indicates that the compression is not performed, magic number 2 is compressed by the present compression method and the first compression is performed, second compression is not performed, and magic number 3 is compressed by the present compression method and the first compression. Indicates that the compression has not been performed and the second compression has been performed, and the magic number 4 has the meaning that the compression has been performed by the present compression method and the second compression has been performed.

また、識別データについては、同図(b)に示すように、4つのマジックナンバーの代わりに、本圧縮方法で圧縮したことを示すマジックナンバーと、第1の圧縮を行ったか/行わなかったかを示すフラグ、及び第2の圧縮を行ったか/行わなかったかを示すフラグで構成される構成としてもよい。   As for identification data, as shown in FIG. 4B, instead of the four magic numbers, a magic number indicating that compression has been performed by this compression method and whether or not the first compression has been performed. It is good also as a structure comprised with the flag which shows whether the flag shown and the 2nd compression were performed / not performed.

以上のように、本例によれば、第1及び第2の圧縮の2つの手段を組み合わせ、最も圧縮効率のよい圧縮結果を提供でき、かつ最悪の場合でも入力データサイズより増大することを防止できる。
(実施形態5)
次に、本発明の実施形態5について説明する。
As described above, according to this example, the two means of the first and second compression can be combined to provide the compression result with the highest compression efficiency, and the worst case prevents the increase from the input data size. it can.
(Embodiment 5)
Next, a fifth embodiment of the present invention will be described.

図8は、本実施形態の圧縮処理を説明する図である。本例は前述の実施形態1乃至4と異なり、準適応型の確率統計型符号化による圧縮処理を説明するものであり、本例の圧縮手段31は統計モデル処理手段32とエントロピー符号化手段34とで構成される。以下、具体的に説明する。   FIG. 8 is a diagram for explaining the compression processing of the present embodiment. Unlike the first to fourth embodiments described above, this example describes compression processing by semi-adaptive stochastic statistical coding. The compression means 31 of this example includes a statistical model processing means 32 and an entropy coding means 34. It consists of. This will be specifically described below.

先ず、入力データバッファ30には、前述の文字データ等の入力データが供給され、例えば前述の第1の圧縮手段によって圧縮処理された圧縮データが供給される。入力データバッファ30に供給された入力データは、統計モデル処理手段32に供給される。統計モデル処理手段32は、各バイトデータの出現頻度を計数する。この出現頻度の計数結果は頻度テーブル33に供給され、頻度テーブル33に出現頻度の計数結果を記憶する。   First, input data such as the above-described character data is supplied to the input data buffer 30 and, for example, compressed data compressed by the above-described first compression unit is supplied. The input data supplied to the input data buffer 30 is supplied to the statistical model processing means 32. The statistical model processing means 32 counts the appearance frequency of each byte data. The count result of the appearance frequency is supplied to the frequency table 33, and the count result of the appearance frequency is stored in the frequency table 33.

エントロピー符号化手段34は、準備処理部35、エントロピー符号化処理部36、出力データバッファ1(F1テーブル)〜出力データバッファ8(F8テーブル)、及び符号データ出力処理手段37で構成されている。   The entropy encoding unit 34 includes a preparation processing unit 35, an entropy encoding processing unit 36, an output data buffer 1 (F1 table) to an output data buffer 8 (F8 table), and a code data output processing unit 37.

準備処理部35は圧縮データサイズの計算を行い、出力データバッファ1(F1テーブル)〜出力データバッファ8(F8テーブル)の割当て処理、及び後述するベストモード1〜23のコード等をヘッダ部に出力する処理を行う。また、エントロピー符号化処理部36は、上記準備処理部35によって作成されたベストモードの情報に基づいて圧縮フォーマットを生成する。   The preparation processing unit 35 calculates the compressed data size and outputs the allocation process of the output data buffer 1 (F1 table) to the output data buffer 8 (F8 table) and the codes of the best modes 1 to 23 described later to the header unit. Perform the process. The entropy encoding processing unit 36 generates a compression format based on the best mode information created by the preparation processing unit 35.

先ず、準備処理部35の処理について説明する。尚、図9は準備処理部35の構成及び処理概要を説明する図であり、同図のaは、前述の頻度テーブル33である。頻度テーブル33は文字コード(バイトデータ(00〜FF))に対応するカウンタ値(頻度)が格納されており、準備処理部35は、このカウンタ値(頻度)をもとに、ベスト(以下、Bestで示す)23より頻度の多いコードと、該コードの頻度(カウンタ)を格納する記憶エリアbを作成する。   First, the processing of the preparation processing unit 35 will be described. FIG. 9 is a diagram for explaining the configuration and processing outline of the preparation processing unit 35, and a in FIG. 9 is the frequency table 33 described above. The frequency table 33 stores a counter value (frequency) corresponding to the character code (byte data (00 to FF)), and the preparation processing unit 35 uses the counter value (frequency) to determine the best (hereinafter, A storage area b for storing a code having a higher frequency than 23 (indicated by “Best”) and the frequency (counter) of the code is created.

図10は、準備処理部35が行う処理を説明するフローチャートである。先ず、記憶エリアa、及びbに記憶されたコードテーブルや頻度テーブルの初期化を行い、総頻度数を0クリアする(ステップ(以下、STで示す)1)。次に、頻度テーブルのデータが0であるか判断し(ST2)、頻度テーブル33にデータが存在することを確認して(ST2がNO)、頻度テーブル33からデータを取り出す(ST3)。   FIG. 10 is a flowchart for explaining processing performed by the preparation processing unit 35. First, the code table and frequency table stored in the storage areas a and b are initialized, and the total frequency number is cleared to 0 (step (hereinafter referred to as ST) 1). Next, it is determined whether the data in the frequency table is 0 (ST2), it is confirmed that the data exists in the frequency table 33 (ST2 is NO), and the data is extracted from the frequency table 33 (ST3).

次に、取り出した頻度データを総頻度数に累計する(ST4)。そして、Best23のコードの頻度が0であるか判断する(ST5)。ここで、Best23のコードの頻度が0でない場合(ST5がNO)、Best23のコードの頻度と比較し(ST6)、Best23の頻度より少ない場合、頻繁に出現する文字コードではないものと判断し、判断(ST2)に戻る。一方、Best23の頻度より多い場合、処理(ST7)に移行する。   Next, the extracted frequency data is accumulated in the total frequency number (ST4). Then, it is determined whether the code frequency of Best 23 is 0 (ST5). Here, when the code frequency of Best23 is not 0 (ST5 is NO), it is compared with the code frequency of Best23 (ST6), and when it is less than the frequency of Best23, it is determined that the character code does not appear frequently, Return to the decision (ST2). On the other hand, if the frequency is more than the frequency of Best 23, the process proceeds to processing (ST7).

また、Best23のコードと頻度が一致する場合、Best23のコードより大きいか判断する(ST8)。すなわち、同じ出現頻度であっても、文字コードのコード番号が若いコードを採用するため、Best23のコード番号よりが大きい場合、判断(ST2)に戻る。一方、Best23のコード番号より小さい(若い)場合、処理(ST7)に移行する。   If the frequency matches the code of Best 23, it is determined whether it is larger than the code of Best 23 (ST8). That is, even if the appearance frequency is the same, since the code number of the character code is a young code, if it is larger than the code number of Best 23, the process returns to the determination (ST2). On the other hand, if it is smaller (younger) than the code number of Best 23, the process proceeds to processing (ST7).

処理(ST7)では、取り出した頻度とコードをBest1〜23の頻度テーブルとコードテーブルに頻度の昇順に挿入する。この処理によって、図9のaの記憶エリアに格納されたデータは、頻度順に並べ替えられ、同図のbに示すBest1〜23の頻度カウンタ及びコードに格納される。   In the process (ST7), the extracted frequency and code are inserted into the frequency table and code table of Best 1 to 23 in ascending order of frequency. By this processing, the data stored in the storage area of FIG. 9A is rearranged in order of frequency and stored in the frequency counters and codes of Best 1 to 23 shown in FIG.

次に、頻度テーブルのデータが全て読み出され、エンドになると(ST2がYES)、更にBest8〜23のコードを昇順に並べ替える(ST9)。さらに、出力データバッファ1(F1テーブル)〜出力データバッファ8(F8テーブル)のサイズ計算を行う(ST10)。   Next, when all the data of the frequency table is read and the end is reached (YES in ST2), the codes of Best 8 to 23 are further rearranged in ascending order (ST9). Further, the size calculation of the output data buffer 1 (F1 table) to the output data buffer 8 (F8 table) is performed (ST10).

例えば、各テーブルのサイズは以下の計算に基づいて計算される。すなわち、
F1テーブルサイズ=(入力データ数+7)/8バイト
F2テーブルサイズ=(Best1〜23の頻度の和+7)/8バイト
F3テーブルサイズ=(Best2〜23の頻度の和+7)/8バイト
F4テーブルサイズ=(Best4〜23の頻度の和+7)/8バイト
F5テーブルサイズ=(Best2〜3の頻度の和+7)/8バイト
F6テーブルサイズ=(Best4〜7の頻度の和+3)/4バイト
F7テーブルサイズ=(Best8〜23の頻度の和+1)/2バイト
F8テーブルサイズ=入力データ数−Best1〜23の頻度の和
次に、上記計算結果から出力データバッファ1(F1テーブル)〜出力データバッファ8(F8テーブル)を圧縮フォーマットに割り当てる(ST11)。また、Best1〜23のコード情報を含むデータを圧縮フォーマットのヘッダ部に出力する(ST12、ST13)。
For example, the size of each table is calculated based on the following calculation. That is,
F1 table size = (number of input data + 7) / 8 bytes
F2 table size = (sum of frequencies from 1 to 23 + 7) / 8 bytes
F3 table size = (sum of frequencies from 2 to 23 + 7) / 8 bytes
F4 table size = (sum of frequencies from 4 to 23 + 7) / 8 bytes
F5 table size = (sum of frequencies from 2 to 3 + 7) / 8 bytes
F6 table size = (sum of frequencies from 4 to 7 + 3) / 4 bytes
F7 table size = (sum of frequencies of Best 8 to 23 + 1) / 2 bytes
F8 table size = number of input data−sum of frequencies of Best 1 to 23 Next, output data buffer 1 (F1 table) to output data buffer 8 (F8 table) are assigned to compression formats from the above calculation results (ST11). Also, data including code information of Best 1 to 23 is output to the header portion of the compressed format (ST12, ST13).

図11は、圧縮フォーマットの例である。この圧縮フォーマットは、ヘッダ部とF1〜F8テーブルで構成され、ヘッダ部は圧縮総容量、F1〜F7テーブルのビット数、生データのバイト数、及びBest1〜23のコードテーブルで構成される。   FIG. 11 is an example of a compression format. This compression format is composed of a header part and F1 to F8 tables, and the header part is composed of a total compression capacity, the number of bits of the F1 to F7 tables, the number of bytes of raw data, and the code tables of Best1 to 23.

エントロピー符号化処理部36は、上記準備処理部35から供給されるデータをもとに、以下の図12に示すフローチャートに従って上記圧縮フォーマットに具体的数値を設定する。   Based on the data supplied from the preparation processing unit 35, the entropy encoding processing unit 36 sets specific numerical values for the compression format according to the flowchart shown in FIG.

先ず、入力バッファ30に供給される入力データを1バイト読み出し(ステップ(以下、STPで示す)1)、データエンドであるか判断する(STP2)。ここで、入力データが存在すれば(STP2がYES)、読み出したデータの出現頻度の情報を取り出す(STP3)。   First, 1 byte of the input data supplied to the input buffer 30 is read (step (hereinafter referred to as STP) 1), and it is determined whether it is a data end (STP2). If input data exists (STP2 is YES), information on the appearance frequency of the read data is extracted (STP3).

次に、読み出した1バイトデータがBest1コードであるか判断する(STP4)。ここで、読み出した1バイトデータがBest1コードである場合(STP4がYES)、Best1コードの処理を行う(STP5)。すなわち、出力データバッファ1(F1テーブル)のビットをオンし、出力データバッファ2(F2テーブル)のビットをオフする。   Next, it is determined whether the read 1-byte data is a Best1 code (STP4). Here, when the read 1-byte data is the Best1 code (STP4 is YES), the Best1 code is processed (STP5). That is, the bit of the output data buffer 1 (F1 table) is turned on, and the bit of the output data buffer 2 (F2 table) is turned off.

また、読み出した1バイトデータがBest1コードではない場合(STP4がNO)、Best2のコードと一致するか判断する(STP6)。ここで、Best2のコードと一致する時、Best2のコード処理を行い、出力データバッファ5(F5テーブル)のビットをオフする(STP7)。また、出力データバッファ1(F1テーブル)のビットをオンし、出力データバッファ2(F2テーブル)のビットをオンし、更に出力データバッファ3(F3テーブル)のビットをオフする(STP8)。   When the read 1-byte data is not the Best1 code (STP4 is NO), it is determined whether or not it matches the code of Best2 (STP6). Here, when the code matches the code of Best2, the code process of Best2 is performed and the bit of the output data buffer 5 (F5 table) is turned off (STP7). Further, the bit of the output data buffer 1 (F1 table) is turned on, the bit of the output data buffer 2 (F2 table) is turned on, and the bit of the output data buffer 3 (F3 table) is turned off (STP8).

以下、同図に示すフローチャートに従って、順位Best3、Best4、Best5、Best6、Best7のコードとの一致を判断し、同じコードであれば対応する処理(STP9〜STP19)を実行する。   Hereinafter, according to the flowchart shown in the figure, it is determined whether or not the codes of the rankings Best3, Best4, Best5, Best6, and Best7 match, and if they are the same code, the corresponding processing (STP9 to STP19) is executed.

次に、Best23のコードの頻度と読み出したコードの頻度を比較し(STP20)、Best23の頻度より少ない場合、頻繁に出現する文字コードではないものと判断し、非圧縮データ処理を行う(STP21)。すなわち、出力データバッファ1(F1テーブル)のビットをオフし、出力データバッファ8(F8テーブル)に読み出したコードデータをセットする。   Next, the code frequency of Best23 is compared with the frequency of the read code (STP20), and if it is less than the frequency of Best23, it is determined that the character code does not appear frequently, and uncompressed data processing is performed (STP21). . That is, the bit of the output data buffer 1 (F1 table) is turned off, and the read code data is set in the output data buffer 8 (F8 table).

一方、Best23のコードの頻度より多い場合、Best8〜22のコードテーブルを2分検索し、一致したコードのテーブルNo.を出力データバッファ7(F7テーブル)にセットする(STP22)。   On the other hand, if the frequency of the code of Best 23 is greater, the code table of Best 8 to 22 is searched for 2 minutes, and the table No. Is set in the output data buffer 7 (F7 table) (STP22).

また、Best23のコードの頻度と一致する場合、Best23のコードとコードの比較を行い(STP23)、一致すればBest23のコード番号を出力データバッファ7(F7テーブル)にセットする(STP24)。   If the frequency of the code of Best 23 matches, the code of Best 23 is compared with the code (STP 23). If they match, the code number of Best 23 is set in the output data buffer 7 (F7 table) (STP 24).

次に、Best8〜23のコード処理を行う(STP25)。すなわち、出力データバッファ1(F1テーブル)のビットをオンし、出力データバッファ2(F2テーブル)のビットをオンし、出力データバッファ3(F3テーブル)のビットをオンし、出力データバッファ4(F4テーブル)のビットをオンする。   Next, code processing of Best 8 to 23 is performed (STP25). That is, the bit of the output data buffer 1 (F1 table) is turned on, the bit of the output data buffer 2 (F2 table) is turned on, the bit of the output data buffer 3 (F3 table) is turned on, and the output data buffer 4 (F4) Turn on the table bit.

以上の処理を入力データがエンドになるまで繰り返し、最後に符号データの出力処理手段37は、出力データバッファ1(F1テーブル)〜出力データバッファ8(F8テーブル)を順次出力する。   The above processing is repeated until the input data reaches the end, and finally the code data output processing means 37 sequentially outputs the output data buffer 1 (F1 table) to the output data buffer 8 (F8 table).

以上のように処理することによって、出力形式をBest1コードが2bit、Best2〜3コードが4bit、Best4〜7コードが6bit、Best8〜23コードが8bit、非圧縮データ9bitの可変長符号化とし、かつ出力データ領域を出力データバッファ1(F1テーブル)〜出力データバッファ8(F8テーブル)の8つの領域に分離し、可変長符号でありながら、符号化および復号化のためのメモリアクセスが1bit単位と2bit単位と4bit単位のビットアクセスと、1バイトデータのバイトアクセスで可能となり、非常に高速な圧縮処理を行うことができる。
(実施形態6)
次に、本発明の実施形態6について説明する。
By processing as described above, the output format is variable length encoding of 2 bits for the Best 1 code, 4 bits for the Best 2 to 3 code, 6 bits for the Best 4 to 7 code, 8 bits for the Best 8 to 23 code, and 9 bits for the uncompressed data, and The output data area is divided into eight areas of output data buffer 1 (F1 table) to output data buffer 8 (F8 table), and memory access for encoding and decoding is made in 1-bit units while being a variable length code. It is possible to perform bit access in units of 2 bits and 4 bits and byte access of 1-byte data, and very high-speed compression processing can be performed.
(Embodiment 6)
Next, a sixth embodiment of the present invention will be described.

図13は、本実施形態の圧縮処理を説明する図である。尚、本例は上記実施形態5において確率統計型符号化による圧縮処理を説明したが、本例では各出力形式ごとの圧縮サイズを計算で求め、圧縮効率の最も優れた場合を判定する圧縮効率判定部を備えた点が特徴である。以下、具体的に説明する。   FIG. 13 is a diagram for explaining the compression processing of the present embodiment. In addition, although this example demonstrated the compression process by stochastic statistical type encoding in the said Embodiment 5, in this example, the compression efficiency which calculates | requires the compression size for every output format by calculation, and determines the case where compression efficiency is the best The point provided with the determination part is the feature. This will be specifically described below.

図13は本例を説明する図であり、前述の図8と同じ構成部分には同じ番号を付して説明する。先ず、入力データバッファ30には、前述の文字データ等の入力データが供給され、更に入力データバッファ30に供給された入力データは、統計モデル処理手段32に供給される。統計モデル処理手段32は、各バイトデータの出現頻度を計数する。この出現頻度の計数結果は頻度テーブル33に供給され、頻度テーブル33に出現頻度の計数結果を記憶する。   FIG. 13 is a diagram for explaining this example, and the same components as those in FIG. First, input data such as the aforementioned character data is supplied to the input data buffer 30, and the input data supplied to the input data buffer 30 is supplied to the statistical model processing means 32. The statistical model processing means 32 counts the appearance frequency of each byte data. The count result of the appearance frequency is supplied to the frequency table 33, and the count result of the appearance frequency is stored in the frequency table 33.

エントロピー符号化手段34は、準備処理部35、エントロピー符号化処理部36、圧縮効率判定部39、出力データバッファ1(F1テーブル)〜出力データバッファ8(F8テーブル)、及び符号データ出力処理手段37で構成されている。   The entropy encoding unit 34 includes a preparation processing unit 35, an entropy encoding processing unit 36, a compression efficiency determination unit 39, an output data buffer 1 (F1 table) to an output data buffer 8 (F8 table), and a code data output processing unit 37. It consists of

準備処理部35は圧縮データサイズの計算を行い、出力データバッファ1(F1テーブル)〜出力データバッファ8(F8テーブル)の割当て処理、後述するベストモード1〜23のコード等をヘッダ部に出力する処理を行う。また、エントロピー符号化処理部36は、上記準備処理部35によって作成されたベストモードの情報に基づいて入力データを各データ毎に後述する処理を行う。   The preparation processing unit 35 calculates the compressed data size, and outputs the allocation process of the output data buffer 1 (F1 table) to the output data buffer 8 (F8 table), the codes of the best modes 1 to 23 described later, and the like to the header part. Process. Further, the entropy encoding processing unit 36 performs a process to be described later for each data on the input data based on the best mode information created by the preparation processing unit 35.

圧縮効率判定部39は頻度テーブル33から供給されるデータに基づいて各圧縮形式毎の圧縮データサイズを計算し、最小のサイズとなる出力形式を判別する。尚、準備処理部35が行う準備処理は、前述の図11に示すフローチャートに従って実行される。また、圧縮効率判定部39はエントロピー符号化処理部36が行う処理と同様の処理を行い、各圧縮形式毎の圧縮データサイズを計算し、最小のサイズとなる出力形式を判別する。   The compression efficiency determination unit 39 calculates the compressed data size for each compression format based on the data supplied from the frequency table 33, and determines the output format having the minimum size. The preparation processing performed by the preparation processing unit 35 is executed according to the flowchart shown in FIG. Further, the compression efficiency determination unit 39 performs the same processing as the processing performed by the entropy encoding processing unit 36, calculates the compressed data size for each compression format, and determines the output format having the minimum size.

図14は判定パターンの例を示す図であり、
(1)Best1コードとそれ以外のコードの場合、Best1は1bitで、他は9bitで符号化され、
(2)Best1と次のBest2とそれ以外のコードの場合、Best1は2bitで、Best2は3bitで、他は9bitで符号化され、
(3)Best1と次のBest4とそれ以外のコードの場合、Best1は2bitで、Best4は4bitで、他は9bitで符号化され、
(4)Best1と次のBest16とそれ以外のコードの場合、Best1は2bitで、Best16は6bitで、他は9bitで符号化され、
(5)Best1と次のBest2と次のBest4とそれ以外のコードの場合、Best1は2bitで、Best2は4bitで、Best4は5bitで、他は9bitで符号化される。
FIG. 14 is a diagram illustrating an example of a determination pattern.
(1) In the case of the Best1 code and other codes, Best1 is encoded by 1 bit, and the others are encoded by 9 bits.
(2) In the case of Best1, next Best2, and other codes, Best1 is encoded by 2 bits, Best2 is encoded by 3 bits, and others are encoded by 9 bits.
(3) In the case of Best1, next Best4, and other codes, Best1 is encoded with 2 bits, Best4 is encoded with 4 bits, and others are encoded with 9 bits.
(4) For Best1, next Best16, and other codes, Best1 is encoded with 2 bits, Best16 is encoded with 6 bits, and others are encoded with 9 bits.
(5) For Best1, next Best2, next Best4, and other codes, Best1 is 2 bits, Best2 is 4 bits, Best4 is 5 bits, and others are 9 bits.

(6)Best1と次のBest2と次のBest16とそれ以外のコードの場合、Best1は2bitで、Best2は4bitで、Best16は7bitで、他は9bitで符号化され、
(7)Best1と次のBest4と次のBest16とそれ以外のコードの場合、Best1は2bitで、Best4は5bitで、Best16は7bitで、他は9bitで符号化され、
(8)Best1と次のBest2と次のBest4と次のBest16とそれ以外のコードの場合、Best1は2bitで、Best2は4bitで、Best4は6bitで、Best16は8bitで、他は9bitで符号化される。
(6) In the case of Best1, next Best2, next Best16, and other codes, Best1 is 2 bits, Best2 is 4 bits, Best16 is 7 bits, and the others are 9 bits.
(7) In the case of Best1, next Best4, next Best16 and other codes, Best1 is 2 bits, Best4 is 5 bits, Best16 is 7 bits, and others are 9 bits.
(8) For Best1, next Best2, next Best4, next Best16 and other codes, Best1 is 2 bits, Best2 is 4 bits, Best4 is 6 bits, Best16 is 8 bits, others are 9 bits Is done.

尚、具体的なビット内容は、それぞれ同図に示すデータ及びコードであり、例えば、(1)Best1コードとそれ以外の場合、Best1コードと一致するバイトデータは出力データバッファ1(F1テーブル)の1bitの記憶エリアにBest1コードを示すフラグとして記憶し、1bitで符号化する。Best1コード以外の他のデータは、出力データバッファ1(F1テーブル)の1bitの記憶エリアに非圧縮データを示すフラグとして記憶し、かつ出力データバッファ8(F8テーブル)の生データの記憶エリアにそのデータ(8bit)を記憶し、合計9bitで符号化する。以下、(2)Best1と次のBest2とそれ以外のコードの場合等についても同図に示す通りである。   The specific bit contents are the data and code shown in the figure, respectively. For example, (1) Best1 code and otherwise, byte data matching the Best1 code is stored in the output data buffer 1 (F1 table). It is stored as a flag indicating the Best1 code in a 1-bit storage area, and is encoded with 1 bit. Data other than the Best1 code is stored as a flag indicating uncompressed data in the 1-bit storage area of the output data buffer 1 (F1 table), and is stored in the raw data storage area of the output data buffer 8 (F8 table). Data (8 bits) is stored and encoded with a total of 9 bits. Hereinafter, (2) Best1, next Best2, and other codes are also shown in the figure.

図15は圧縮効率判定部39が計算結果から判定して出力する圧縮フォーマットの出力形式を示す。上記計算結果から、例えば「(1)Best1コードとそれ以外のコードの場合」の出力形式が判定され、選択された場合には最もサイズの小さい圧縮フォーマットを使用することができる。例えば、同じ色の画像情報等の場合であり、極めて入力データの特性に合わせた圧縮フォーマットの選択を行うことができる。   FIG. 15 shows the output format of the compression format that the compression efficiency determination unit 39 determines and outputs from the calculation result. From the calculation result, for example, the output format of “(1) Best1 code and other codes” is determined, and when selected, the compression format with the smallest size can be used. For example, in the case of image information of the same color, it is possible to select a compression format that is extremely suited to the characteristics of the input data.

したがって、本例によれば入力データに対応した圧縮効率の最も優れた出力形式を選択して圧縮処理を行うことができ、圧縮処理時間や圧縮データの転送時間を短縮することができ、極めて効率のよい出力圧縮処理を行うことができる。
(実施形態7)
次に、本発明の実施形態7について説明する。尚、本例は上記圧縮効率判定部39によって判定された出力形式4(つまり、(4)Best1と次のBest16とそれ以外の場合)を使用したものである。準備処理部35によってBest1〜Best17までの頻度データを作成した場合の例であり、圧縮フォーマットは図16に示す構成である。したがって、前述の実施形態6における出力データバッファ(Fテーブル)に対して、本例においてテーブル番号は一致しない。
Therefore, according to this example, it is possible to select the output format having the best compression efficiency corresponding to the input data and perform the compression processing, and it is possible to shorten the compression processing time and the transfer time of the compressed data, which is extremely efficient. Output compression processing can be performed.
(Embodiment 7)
Next, a seventh embodiment of the present invention will be described. In this example, the output format 4 determined by the compression efficiency determination unit 39 (that is, (4) Best1, next Best16, and other cases) is used. This is an example in the case where frequency data from Best 1 to Best 17 is created by the preparation processing unit 35, and the compression format has the configuration shown in FIG. Therefore, the table numbers in this example do not match the output data buffer (F table) in the sixth embodiment.

図17は、本例におけるエントロピー符号化処理部36が行う処理を示すフローチャートである。先ず、入力データバッファ30に供給される入力データを1バイト読み出し(ステップ(以下、Wで示す)1)、データエンドであるか判断する(W2)。この最初の処理では、入力データは充分存在し(W2がYES)、読み出したデータの出現頻度の情報を取り出す(W3)。すなわち、本例の出力データバッファ1(F1テーブル)を検索し、読み出した1バイトデータがBest1コードであるか判断する(W4)。   FIG. 17 is a flowchart showing processing performed by the entropy encoding processing unit 36 in this example. First, one byte is read from the input data supplied to the input data buffer 30 (step (hereinafter referred to as W) 1), and it is determined whether it is a data end (W2). In this first process, there is sufficient input data (W2 is YES), and information on the appearance frequency of the read data is extracted (W3). That is, the output data buffer 1 (F1 table) of this example is searched to determine whether the read 1-byte data is the Best1 code (W4).

ここで、読み出した1バイトデータがBest1コードである場合(W4がYES)、Best1コード処理を行う(W5)。すなわち、本例の出力データバッファ1(F1テーブル)のビットをオンし、出力データバッファ2(F2テーブル)のビットをオフする。   Here, when the read 1-byte data is the Best1 code (W4 is YES), the Best1 code processing is performed (W5). That is, the bit of the output data buffer 1 (F1 table) of this example is turned on, and the bit of the output data buffer 2 (F2 table) is turned off.

また、読み出した1バイトデータがBest1コードではない場合(W4がNO)、Best17のコードと比較処理を行う(W6)。ここで、Best17のコードの頻度より少ない場合、非圧縮データ処理を行い、本例の出力データバッファ1(F1テーブル)のビットをオフし、出力データバッファ4(F4テーブル)に読み出したデータをセットする(W7)。一方、Best17のコードの頻度より多い場合、Best12〜16のコードテーブルを2分検索し、一致したコードのテーブルナンバーを出力データバッファ3(F3テーブル)にセットする(W8)。   Further, when the read 1-byte data is not the Best1 code (W4 is NO), a comparison process with the code of Best17 is performed (W6). If the code frequency of Best 17 is less, uncompressed data processing is performed, the bit of the output data buffer 1 (F1 table) of this example is turned off, and the read data is set in the output data buffer 4 (F4 table). (W7). On the other hand, if the frequency of the code of Best 17 is higher, the code table of Best 12 to 16 is searched for 2 minutes, and the table number of the matched code is set in the output data buffer 3 (F3 table) (W8).

また、Best17のコードの頻度と一致する場合、Best17のコードとコードの比較を行い(W9)、一致すればBest17のコードの値を出力データバッファ3(F3テーブル)にセットする(W10)。そして、Best12〜17のコード処理を行う。すなわち、出力データバッファ1(F1テーブル)にビットオンし、出力データバッファ2(F2テーブル)のビットをオンする。   If the frequency of the code of Best17 matches, the code of Best17 is compared with the code (W9), and if it matches, the value of the code of Best17 is set in the output data buffer 3 (F3 table) (W10). And the code processing of Best12-17 is performed. That is, the output data buffer 1 (F1 table) is turned on, and the output data buffer 2 (F2 table) is turned on.

以上のように、本例によれば入力データに対応した圧縮効率の最も優れた出力形式を選択して圧縮処理を行うことができ、圧縮処理時間や圧縮データの転送時間を短縮することができる。尚、本例は文字コードの出現頻度をBest1〜17までの例で説明したが、出現頻度は前述の実施形態6に示すようにBest1〜23までとしてもよく、更に他の数の例で説明してもよい。
(実施形態8)
次に、本発明の実施形態8について説明する。
As described above, according to this example, it is possible to select the output format having the best compression efficiency corresponding to the input data and perform the compression processing, and it is possible to shorten the compression processing time and the compressed data transfer time. . In this example, the appearance frequency of the character code has been described in the examples from Best 1 to 17. However, the appearance frequency may be from Best 1 to 23 as shown in the above-described sixth embodiment, and will be described in other examples. May be.
(Embodiment 8)
Next, an eighth embodiment of the present invention will be described.

図18は、本実施形態を説明する図であり、前述の最長一致の文字列の探索の前に、直前の文字と同一の文字の連続であるか否かを判断し、同一の文字の連続である場合、連長文字圧縮の処理を実行する。例えば、同図(a)は、連続する文字“a”が8個連続する場合であり、この場合、フラグ+長さの圧縮データを使用する。また、フラグは最長一致の文字列参照と兼用し、図19(g)に示すように、文字列参照の符号コードの「一致開始位置」の部分に連長圧縮の識別情報を入れる。尚、18図(b)は、前述の図2(a)と同じであり、説明を省略する。また、図19(b)〜(f)の構成は、前述の図2(b)〜(f)の構成と同じであり、説明を省略する。   FIG. 18 is a diagram for explaining the present embodiment. Before searching for the longest matching character string, it is determined whether or not the same character as the immediately preceding character is continuous. If it is, the process of compressing the run length character is executed. For example, FIG. 5A shows a case where eight consecutive characters “a” are consecutive, and in this case, compressed data of flag + length is used. Further, the flag is also used as the longest matching character string reference, and as shown in FIG. 19 (g), identification information for continuous length compression is entered in the "matching start position" portion of the character string reference code code. Note that FIG. 18B is the same as FIG. 2A described above, and a description thereof will be omitted. Also, the configurations of FIGS. 19B to 19F are the same as the configurations of FIGS. 2B to 2F described above, and a description thereof will be omitted.

例えば、画像データに白の部分が多い場合、この部分は同じ値の連続である。したがって、このような入力データに対し、本例の連長文字圧縮を付加することにより、圧縮効率を向上することができる。
(実施形態9)
次に、本発明の実施形態9について説明する。
For example, when there are many white parts in the image data, these parts are continuous with the same value. Therefore, compression efficiency can be improved by adding the continuous length character compression of this example to such input data.
(Embodiment 9)
Next, a ninth embodiment of the present invention will be described.

図20は、本実施形態を説明する図である。本例は膨大な入力データの対応として、入力データ列を分割制御する原データ分割・入力手段40を備え、入力ファイル41に記憶された入力データを原データ分割・入力手段40によって分割して入力データバッファ43に出力する構成である。   FIG. 20 is a diagram illustrating this embodiment. This example includes original data division / input means 40 for dividing and controlling an input data string as a response to a large amount of input data, and the input data stored in the input file 41 is divided and input by the original data division / input means 40. It is configured to output to the data buffer 43.

このように構成することにより、膨大な入力データに対してもデータを分割して入力データバッファ43に供給することによって容易に対応することができるものである。
尚、同図に示す他の構成は、前述の図6の構成と同じであり、説明を省略する。そして、出力データバッファ27に格納された圧縮データは、圧縮結果データ出力手段44によって、出力ファイルに順次出力される。
(実施形態10)
次に、本発明の実施形態10について説明する。
With this configuration, it is possible to easily cope with a large amount of input data by dividing the data and supplying it to the input data buffer 43.
The other configuration shown in the figure is the same as the configuration shown in FIG. The compressed data stored in the output data buffer 27 is sequentially output to an output file by the compression result data output means 44.
(Embodiment 10)
Next, a tenth embodiment of the present invention will be described.

上記実施形態1〜9は入力データの圧縮処理について説明したが、以下の実施形態は、前述の圧縮処理によって圧縮されたデータの復元処理について説明する。以下、具体的に説明する。   In the first to ninth embodiments described above, the compression processing of input data has been described. In the following embodiments, the decompression processing of data compressed by the above-described compression processing will be described. This will be specifically described below.

図21において、第1の復元手段51は準適応型(semi-adaptive)確率統計型符号化データの復号処理を行い、第2の復元手段52は適応型の辞書型符号化データ(Lempel-Ziv法)の復号処理を行う。すなわち、前述の実施形態1乃至9で行われた圧縮データの復元処理を行う構成である。   In FIG. 21, the first restoration means 51 decodes semi-adaptive probability statistical type encoded data, and the second restoration means 52 uses adaptive dictionary type encoded data (Lempel-Ziv). Method). That is, the compressed data decompression process performed in the first to ninth embodiments is performed.

したがって、前述の実施形態1乃至9で行われた圧縮データは、入力データ列として第1の復元手段51に入力し、前述の第2の圧縮手段の確率統計型符号化方法で圧縮されたデータ列を復号する。また、第2の復元手段52は前述の第1の圧縮手段の適応型の辞書型符号化方法(Lempel-Ziv法)で圧縮されたデータ列を復号する。   Therefore, the compressed data performed in the above-described first to ninth embodiments is input to the first decompression unit 51 as an input data string, and is compressed by the probability statistical encoding method of the above-described second compression unit. Decrypt the column. The second restoration means 52 decodes the data string compressed by the adaptive dictionary type encoding method (Lempel-Ziv method) of the first compression means.

このように構成することにより、可逆的に(無損失)復号化が行われ、圧縮処理に対応する複合処理を行うことができる。
(実施形態11)
次に、本発明の実施形態11について説明する。
With this configuration, reversible (lossless) decoding is performed, and composite processing corresponding to compression processing can be performed.
(Embodiment 11)
Next, an eleventh embodiment of the present invention will be described.

本実施形態もデータの復元処理について説明するものである。以下、具体的に説明する。
図22は本例のデータ復元装置を説明する図である。同図において、第1の復元手段51は、前述と同様準適応型(semi-adaptive)確率統計型符号化データの復号処理を行い、第2の復元手段52は適応型の辞書型符号化データ(Lempel-Ziv法)の復号処理を行う。また、同図において、入力切換手段53は前述の実施形態3の処理によって符号化された(圧縮処理された)データ列を入力し、識別データ判定手段54、又は第1の復号手段51、又は第2の復号手段52のいずれかにデータを受け渡す入力データの切り換え手段である。尚、入力切換手段53は初期状態において、識別データ判定手段54に入力データを受け渡す設定が行われている。
This embodiment also explains data restoration processing. This will be specifically described below.
FIG. 22 is a diagram for explaining the data restoration apparatus of this example. In the figure, a first restoration means 51 performs a decoding process of semi-adaptive probability statistical type encoded data as described above, and a second restoration means 52 performs adaptive dictionary type encoded data. (Lempel-Ziv method) decryption processing is performed. In the same figure, the input switching means 53 inputs the data string encoded (compressed) by the processing of the third embodiment, and the identification data determination means 54, the first decoding means 51, or This is input data switching means for transferring data to one of the second decoding means 52. In the initial state, the input switching means 53 is set to pass input data to the identification data determination means 54.

ここで、本例で使用する識別データは前述の実施形態3で説明したマジックナンバーであり、識別データ判定手段54は、受け取った入力データを前述の識別データとして判別する。すなわち、前述のマジックナンバー1又は2と比較し、以下の判定を行う。   Here, the identification data used in this example is the magic number described in the third embodiment, and the identification data determination unit 54 determines the received input data as the identification data. That is, the following determination is made in comparison with the magic number 1 or 2 described above.

例えば、マジックナンバー1であれば、入力切換手段53を切り換えて、切換手段55を介して第2の復号手段52に入力データを供給する。また、この時第2の復号手段52に対して復号処理の開始を指示する。   For example, if the magic number is 1, the input switching means 53 is switched and the input data is supplied to the second decoding means 52 via the switching means 55. At this time, the second decoding means 52 is instructed to start the decoding process.

また、マジックナンバー2ならば、入力切換手段53を切り換え、入力データを第1の復号手段51に供給し、更に切換手段55を切り換え、第1の復号手段51の出力データが第2の復号手段52に供給されるように制御する。そして、第1の復号手段51に対して復号処理の開始を指示する。また、第2の復号手段52に対しても復号処理の開始を指示する。   If the magic number is 2, the input switching means 53 is switched, the input data is supplied to the first decoding means 51, the switching means 55 is further switched, and the output data of the first decoding means 51 is the second decoding means. Control is performed so as to be supplied to 52. Then, the first decoding means 51 is instructed to start the decoding process. The second decoding unit 52 is also instructed to start the decoding process.

したがって、本例によれば圧縮時に設定されたマジックナンバーに基づいて復号処理を行うことができ、圧縮方式に対応する復号方式を使用して効率よく圧縮データの復号処理を行うことができる。
(実施形態12)
次に、本発明の実施形態12について説明する。
Therefore, according to this example, the decoding process can be performed based on the magic number set at the time of compression, and the decoding process of the compressed data can be efficiently performed using the decoding method corresponding to the compression method.
Embodiment 12
Next, a twelfth embodiment of the present invention will be described.

本実施形態もデータの復元処理について説明するものである。以下、具体的に説明する。
図23は本例のデータ復元装置を説明する図である。同図において、第1の復元手段51は、前述と同様準適応型(semi-adaptive)確率統計型符号化データの復号処理を行い、第2の復元手段52は適応型の辞書型符号化データ(Lempel-Ziv法)の復号処理を行う。また、同図において、入力切換手段53、識別データ判定手段54は前述の同じ構成であるが、識別データ判定手段54は後述する4種類のマジックナンバーの識別を行う。すなわち、本例は前述の実施形態4の圧縮装置による圧縮データを復元する構成であり、識別データは前述の4種類のマジックナンバー1〜4の判断を行う。
This embodiment also explains data restoration processing. This will be specifically described below.
FIG. 23 is a diagram for explaining the data restoration apparatus of this example. In the figure, a first restoration means 51 performs a decoding process of semi-adaptive probability statistical type encoded data as described above, and a second restoration means 52 performs adaptive dictionary type encoded data. (Lempel-Ziv method) decryption processing is performed. In the same figure, the input switching means 53 and the identification data determination means 54 have the same configuration as described above, but the identification data determination means 54 identifies four types of magic numbers described later. That is, this example is a configuration that restores the compressed data by the compression device of the above-described fourth embodiment, and the identification data performs the determination of the above-described four types of magic numbers 1 to 4.

また、本例においては2つの切換手段55a、55bが使用され、更に出力切換手段58も設けられている。
上記構成において、先ず識別データ判定手段54に入力する識別データがマジックナンバー1である場合、識別データ判定手段54は、判定した識別データを除いて、そのまま受け渡されたデータ列をデータエンドまで出力する。
In this example, two switching means 55a and 55b are used, and an output switching means 58 is also provided.
In the above configuration, when the identification data to be input to the identification data determination unit 54 is the magic number 1, the identification data determination unit 54 outputs the data string passed as it is to the data end, excluding the determined identification data. To do.

また、マジックナンバー2であれば、識別データ判定手段54は入力データを第2の復号手段52に供給するよう、入力切換手段53に指示し、入力切換手段53と切換手段55aを切換える。また、第2の復号手段52からのデータ列を出力切換手段58に出力するよう指示する。したがって、この処理により、入力データは第2の復号手段52によって復号処理が行われ、出力切換手段58を介して復号データが出力される。   If the magic number is 2, the identification data determination unit 54 instructs the input switching unit 53 to supply the input data to the second decoding unit 52, and switches the input switching unit 53 and the switching unit 55a. Further, it instructs the output switching means 58 to output the data string from the second decoding means 52. Therefore, by this process, the input data is decoded by the second decoding means 52 and the decoded data is output via the output switching means 58.

また、マジックナンバー3である場合、識別データ判定手段54は、入力切換手段53を切り換え、第1の復号手段51に入力データを供給するよう指示する。また、切換手段55bと出力切換手段58を切り換え、第1の復号手段51に対して復号開始の指示を行う。したがって、このように制御することにより、第1の復号手段51は復号処理を開始し、切換手段55b、出力切換手段58を介して復号データが出力される。   If the magic number is 3, the identification data determination unit 54 switches the input switching unit 53 and instructs the first decoding unit 51 to supply the input data. Further, the switching means 55b and the output switching means 58 are switched to instruct the first decoding means 51 to start decoding. Therefore, by controlling in this way, the first decoding unit 51 starts the decoding process, and the decoded data is output via the switching unit 55b and the output switching unit 58.

さらに、マジックナンバー4であれば、識別データ判定手段54は、第1の復号手段51によって復号したデータ列を、更に第2の復号手段52で復号するように入力切換手段53、切換手段55a、55b、及び出力切換手段58を切り換える。そして、第1の復号手段51と第2の復号手段52に対して復号開始の指示を行う。したがって、この指示に基づき、第1の復号手段51及び第2の復号手段52は復号処理を開始し、両復号手段51及び52によって復号処理された復号データは出力切換手段58を介して出力される。   Further, if the magic number is 4, the identification data determination unit 54 is further configured to use the input switching unit 53, the switching unit 55a, and the second decoding unit 52 to decode the data string decoded by the first decoding unit 51. 55b and the output switching means 58 are switched. Then, the first decoding unit 51 and the second decoding unit 52 are instructed to start decoding. Therefore, based on this instruction, the first decoding means 51 and the second decoding means 52 start the decoding process, and the decoded data decoded by both the decoding means 51 and 52 is output via the output switching means 58. The

尚、マジックナンバー1〜4ではない場合、識別データ判定手段53は、判定した識別データも含めて、そのまま入力データ列を出力する。但し、この場合、エラー応答する構成としてもよい。   If the magic numbers are not 1 to 4, the identification data determination unit 53 outputs the input data string as it is, including the determined identification data. However, in this case, an error response may be adopted.

以上のように処理することによって、圧縮時に設定されたマジックナンバー1〜4に基づいて復号処理を行うことができ、圧縮方式に対応する適切な復号方式を選択して効率よい復号処理を行うことができる。
(実施形態13)
次に、本発明の実施形態13について説明する。
By performing the processing as described above, decoding processing can be performed based on the magic numbers 1 to 4 set at the time of compression, and efficient decoding processing is performed by selecting an appropriate decoding method corresponding to the compression method. Can do.
(Embodiment 13)
Next, a thirteenth embodiment of the present invention will be described.

本実施形態もデータの復元処理について説明するものである。尚、本例は前述の実施形態5乃至7による確率統計型符号化方法で圧縮されたデータ列を復元するものである。以下、具体的に説明する。   This embodiment also explains data restoration processing. In this example, the data string compressed by the probability statistical encoding method according to the fifth to seventh embodiments is restored. This will be specifically described below.

図24は本例の復号アルゴリズムを示すフローチャートである。符号化データ列は、前述の圧縮フォーマットに含まれるF1〜F8テーブル、フラグとデータを8つのエリア(又は4つのエリア)に分けて出力する。   FIG. 24 is a flowchart showing the decoding algorithm of this example. The encoded data string is output by dividing the F1 to F8 table, flag, and data included in the above-described compression format into eight areas (or four areas).

先ず、F1〜F8テーブルからデータを取り出す準備を行う(ステップ(以下、Vで示す)1)。次に、F1テーブルのデータエンドを判断し(V2)、データが存在すればF1テーブルから1ビットのデータを取り出し(V3)、非圧縮データであるか、又は圧縮データであるか判断する(V4)。   First, preparation is made to extract data from the F1 to F8 tables (step (hereinafter referred to as V) 1). Next, the data end of the F1 table is determined (V2). If data exists, 1-bit data is extracted from the F1 table (V3), and it is determined whether the data is uncompressed data or compressed data (V4). ).

ここで、非圧縮データであれば、F8テーブルから1バイトのデータを取り出し、出力する(V5)。一方、圧縮データである場合には(V4がYES)、F2テーブルから1ビットのデータを取り出し、出現頻度が最も多いデータであるか判断する(V7)。そして、出現頻度が最も多いデータである場合、Best1のコードを参照し、Best1コードを出力する(V8)。   If the data is uncompressed data, 1-byte data is extracted from the F8 table and output (V5). On the other hand, if the data is compressed data (V4 is YES), 1-bit data is extracted from the F2 table, and it is determined whether the data has the highest appearance frequency (V7). If the data has the highest appearance frequency, the Best1 code is output with reference to the Best1 code (V8).

また、Best1コードではない場合、F3テーブルをビット単位に参照し、出現頻度がその次に多いBest2〜3のコードであるか判断する(V10)。ここで、出現頻度が次に多いBest2〜3のコードである場合(V10がYES)、F5テーブルをビット単位に参照し、Best2のコードか、又はBest3のコードか判断する(V12)。そして、Best2のコードであれば、コード表を参照しBest2のコードを出力し(V12がYES、V13)、Best3のコードであればコード表を参照し、Best3のコードを出力する(V12がNO、V14)。   If the code is not the Best1 code, the F3 table is referred to in units of bits, and it is determined whether the code is the Best2-3 code having the next highest appearance frequency (V10). Here, when it is a code of Best 2 to 3 having the next highest appearance frequency (V10 is YES), the F5 table is referred to bit by bit to determine whether it is a code of Best 2 or a code of Best 3 (V12). If it is the code of Best2, the code table is referenced and the code of Best2 is output (V12 is YES, V13). If it is the code of Best3, the code table is referenced and the code of Best3 is output (V12 is NO) V14).

一方、F3テーブルの判断において、出現頻度がBest2〜3のコードではない場合、F4テーブルをビット単位に参照し、出現頻度がその次に多いBest4〜7のコードの判断を行う(V15、V16)。そして、Best4〜7のコードである場合、F6テーブルを2ビット単位にアクセスし、その2ビットが示すBest4〜7のコード表の該当データを出力する(V16がYES、V17)。一方、Best4〜7のコードではない場合、F7テーブルを4ビット単位にアクセスし、その4ビットが示すBest8〜23のコード表の該当データを出力する(V16がNO、V18)。   On the other hand, in the determination of the F3 table, when the appearance frequency is not the code of Best 2 to 3, the F4 table is referred to in bit units, and the code of Best 4 to 7 with the next highest appearance frequency is determined (V15, V16). . When the code is Best 4-7, the F6 table is accessed in units of 2 bits, and the corresponding data in the code table of Best 4-7 indicated by the 2 bits is output (V16 is YES, V17). On the other hand, if it is not the code of Best 4-7, the F7 table is accessed in units of 4 bits, and the corresponding data in the code table of Best 8-23 indicated by the 4 bits is output (V16 is NO, V18).

以上のようにデータの復元処理を行うことによって、確率統計型符号化方法によって圧縮されたデータ列を復元することができ、圧縮処理に対応したデータの復元処理を行うことができる。
(実施形態14)
次に、本発明の実施形態14について説明する。
By performing the data restoration process as described above, the data string compressed by the probability statistical coding method can be restored, and the data restoration process corresponding to the compression process can be performed.
(Embodiment 14)
Next, a fourteenth embodiment of the present invention will be described.

本実施形態もデータの復元処理について説明するものである。尚、本例は前述の実施形態9に対応するものである。
図25は本実施形態を説明する図である。本例は膨大な入力データを分割して圧縮処理した圧縮データを復元する処理を説明するものである。同図において、原データ分割・入力手段60は、入力ファイル61に記憶された入力データを分割して入力データバッファ63に出力する。このように構成することにより、圧縮データは分割され入力データバッファ63に供給され、以後識別データを識別データ判定手段65によって識別し、第1の復号手段66、第2の復号手段67、又は元データ出力手段68を選択して圧縮データの復号処理を行うことができる。
This embodiment also explains data restoration processing. This example corresponds to the ninth embodiment described above.
FIG. 25 is a diagram for explaining this embodiment. In this example, a process for restoring compressed data obtained by dividing and compressing a large amount of input data will be described. In the figure, the original data dividing / inputting means 60 divides the input data stored in the input file 61 and outputs it to the input data buffer 63. With this configuration, the compressed data is divided and supplied to the input data buffer 63, and thereafter the identification data is identified by the identification data determination unit 65, and the first decoding unit 66, the second decoding unit 67, or the original data is identified. The data output means 68 can be selected to decode the compressed data.

また、本例の復号処理によって復号されたデータは、出力データバッファ69を介して出力され、この出力処理の際、復号データは復号結果データ出力手段70によって、出力されるファイル71に順次出力されて記憶される。   Further, the data decoded by the decoding process of this example is output via the output data buffer 69. During this output process, the decoded data is sequentially output to the output file 71 by the decoding result data output means 70. Is remembered.

以上のようにデータの復元処理を行うことによって、膨大な大きさのデータについても、圧縮時と同じ長さに分割された状態で復元出力を得ることができる。
(実施形態15)
次に、本発明の実施形態15について説明する。
By performing the data restoration process as described above, it is possible to obtain a restoration output in a state where even a huge amount of data is divided into the same length as that at the time of compression.
(Embodiment 15)
Next, a fifteenth embodiment of the present invention is described.

本実施形態は前述の実施形態10の復号処理の変形例であり、図26に本例の構成を示す。同図において、第1の復元手段71は準適応型(semi-adaptive)確率統計型符号化データの復号処理を行い、第2の復元手段72は適応型の辞書型符号化データ(Lempel-Ziv法)の復号処理を行う。さらに、本例においては、FIFO(first-in first-out)メモリ73が実装され、第1の復元手段71によって1バイトの圧縮データを復号すると、FIFOメモリ73に1バイトの復号データが入力し、この1バイトのデータはFIFOメモリ73から第2の復元手段72に出力され、復号処理される。   The present embodiment is a modification of the decoding process of the tenth embodiment, and FIG. 26 shows the configuration of this example. In the figure, a first restoration means 71 performs a decoding process of semi-adaptive probability statistical coding data, and a second restoration means 72 performs adaptive dictionary-type coded data (Lempel-Ziv). Method). Further, in this example, a first-in first-out (FIFO) memory 73 is mounted, and when 1-byte compressed data is decoded by the first decompression means 71, 1-byte decoded data is input to the FIFO memory 73. The 1-byte data is output from the FIFO memory 73 to the second restoring means 72 and decrypted.

したがって、本例によれば、第1の復元処理と第2の復元処理を並行動作させることができ、データの復元(復号化)の高速化が図れる。   Therefore, according to this example, the first restoration process and the second restoration process can be operated in parallel, and the speed of data restoration (decoding) can be increased.

1、2・・・圧縮手段
3・・・入力データバッファ
4・・・Pバッファ
5・・・Qバッファ
11、12・・・圧縮手段
13・・・中間データバッファ
14・・・頻度テーブル
20・・・入力バッファ
21、22・・・圧縮手段
23・・・中間データバッファ
24、24a、24b・・・頻度テーブル
25・・・サイズ算出・判定手段
26・・・元データ出力手段
27・・・出力データバッファ
30・・・入力バッファ
31・・・圧縮手段
32・・・統計モデル処理手段
33・・・頻度テーブル
34・・・エントロピー符号化手段
35・・・準備処理部
36・・・エントロピー符号化処理部
37・・・出力処理手段
39・・・圧縮効率判定部
40・・・原データ分割・入力手段
41・・・入力ファイル
43・・・入力データバッファ
44・・・圧縮結果データ出力手段
51、52・・・復元手段
53・・・入力切換手段
54・・・識別データ判定手段
55、55a、55b・・・切換手段
56・・・切換手段、
58・・・出力切換手段
60・・・原データ分割・入力手段
63・・・入力データバッファ
65・・・識別データ判定手段
66、67・・・復号手段
68・・・元データ出力手段
69・・・出力データバッファ
70・・・復号結果データ出力手段
71、72・・・復元手段
73・・・FIFOメモリ
74・・・出力ファイル
DESCRIPTION OF SYMBOLS 1, 2 ... Compression means 3 ... Input data buffer 4 ... P buffer 5 ... Q buffer 11, 12 ... Compression means 13 ... Intermediate data buffer 14 ... Frequency table 20. .. Input buffers 21, 22 ... Compression means 23 ... Intermediate data buffers 24, 24a, 24b ... Frequency table 25 ... Size calculation / determination means 26 ... Original data output means 27 ... Output data buffer 30 ... Input buffer 31 ... Compression means 32 ... Static model processing means 33 ... Frequency table 34 ... Entropy encoding means 35 ... Preparation processing unit 36 ... Entropy code Conversion processing unit 37... Output processing unit 39... Compression efficiency determination unit 40... Original data division / input unit 41... Input file 43. Buffer 44: Compression result data output means 51, 52 ... Restoration means 53 ... Input switching means 54 ... Identification data determination means 55, 55a, 55b ... Switching means 56 ... Switching means,
58 ... Output switching means 60 ... Original data division / input means 63 ... Input data buffer 65 ... Identification data determination means 66, 67 ... Decoding means 68 ... Original data output means 69 ..Output data buffer 70: Decoding result data output means 71, 72 ... Restore means 73 ... FIFO memory 74 ... Output file

Claims (4)

出現頻度に応じて可変長符号化する確率統計型符号化のデータ圧縮装置において、
出現頻度が最も多いデータの抽出を行う情報を第1のテーブルと第2のテーブルに2ビットで記録し、次に多い2個のデータの抽出を行う情報を第1乃至第3のテーブル及び第5のテーブルに4ビットで記録し、更に次に多い4個のデータの抽出を行う情報を第1乃至第4のテーブル及び第6のテーブルに6ビットで記録し、更に次に多い16個のデータの抽出を行う情報を第1乃至第4のテーブル及び第7のテーブルに8ビットで記録し、その他のデータを第1及び第8のテーブルに9ビットで記録する手段と、
前記出現頻度の順位に対応するデータコードをコードテーブルに記録する手段と、
を有することを特徴とするデータ圧縮装置。
In a data compression apparatus of probability statistical coding that performs variable length coding according to the appearance frequency,
The information for extracting the data with the highest appearance frequency is recorded in the first table and the second table with 2 bits, and the information for extracting the next two pieces of data is recorded with the first to third tables and the first table. Record 4 bits in the table 5 and extract the next 4 more data in 6 bits in the 1st to 4th tables and the 6th table, and the next 16 more Information for extracting data is recorded in the first to fourth tables and the seventh table in 8 bits, and other data is recorded in the first and eighth tables in 9 bits,
Means for recording a data code corresponding to the rank of the appearance frequency in a code table;
A data compression apparatus comprising:
出現頻度が最も多いデータとその他のデータのみである場合、圧縮データであるか否か
の情報を前記第1のテーブルに記録し、前記コードテーブルには前記出現頻度が最も多い
データのコードが記録されていることを特徴とする請求項1記載のデータ圧縮装置。
When only the most frequently appearing data and other data are included, information indicating whether the data is compressed data is recorded in the first table, and the code of the most frequently occurring data is recorded in the code table. 2. The data compression apparatus according to claim 1, wherein the data compression apparatus is provided.
出現頻度に応じて可変長符号化された確率統計型符号化データの復元装置において、
第1のテーブルを参照して圧縮データであるか否かの情報を取得し、圧縮データではない場合第8のテーブルに記録されたコードデータを読み出し、圧縮データであれば第2の
テーブルを参照して出現頻度が最も多いデータであるか否かの情報を取得し、出現頻度が
最も多いデータであれば、コードテーブルから対応する出現頻度のコードデータを読み出
す手段と、
前記出現頻度が最も多いデータではない場合、更に第3のテーブルを参照し、出現頻度
が次に多い2個のデータであるか否かの情報を取得し、出現頻度が次に多い2個のデータ
であれば、更に第5のテーブルを参照し、出現頻度が2番目に多いデータであるか3番目
に多いデータであるかの情報を取得し、前記コードテーブルから対応する出現頻度のコー
ドデータを読み出す手段と、
前記出現頻度が次に多い2個のデータではない場合、更に第4のテーブルを参照し、出
現頻度が次に多い4個のデータであるか否かの情報を取得し、出現頻度が次に多い4個の
データであれば、更に第6のテーブルを参照し、出現頻度が4番目乃至7番目に多いデー
タであるかの情報を取得し、前記コードテーブルから対応する出現頻度のコードデータを
読み出す手段と、
前記出現頻度が次に多い4個のデータではない場合、更に第7のテーブルを参照し、出
現頻度が次に多い16個のデータの情報を取得し、前記コードテーブルから対応する出現
頻度のコードデータを読み出す手段と、
を有することを特徴とするデータ復元装置。
In a restoration apparatus for probability statistical type encoded data that is variable length encoded according to the appearance frequency,
Refers to the first table to obtain information on whether or not the data is compressed data. If the data is not compressed data, the code data recorded in the eighth table is read. If the data is compressed data, the second table is referred to. Information on whether or not the data has the highest appearance frequency, and if the data has the highest appearance frequency, means for reading out the code data of the corresponding appearance frequency from the code table;
If it is not the data with the highest frequency of appearance, further refer to the third table to obtain information on whether or not the two data with the next highest frequency of appearance, If it is data, further refer to the fifth table, obtain information on whether the data is the second most frequently occurring data or the third most frequently occurring data, and code data of the corresponding appearing frequency from the code table Means for reading
If the two occurrence frequencies are not the next most frequent data, further refer to the fourth table to obtain information on whether or not the four occurrence data is the next most frequent occurrence frequency. If there are a large number of four data, further refer to the sixth table to obtain information on whether the appearance frequency is the fourth to seventh most frequent data, and obtain the code data of the corresponding appearance frequency from the code table. Means for reading;
If the data is not the next most frequently occurring 4 data, further refer to the seventh table, obtain information of 16 data having the next most frequently occurring frequency, and code corresponding to the appearing frequency from the code table Means for reading data;
A data restoration apparatus comprising:
出現頻度が最も多いデータとその他のデータのみである場合、前記第1のテーブルを参
照して圧縮データであるか否かの情報を取得し、圧縮データではない場合コードテーブル
から対応するコードデータを読み出すことを特徴とする請求項3記載のデータ復元装置。
When only the most frequently appearing data and other data are present, the first table is referred to obtain information on whether or not the data is compressed data, and if the data is not compressed data, the corresponding code data is obtained from the code table. 4. The data restoration device according to claim 3, wherein the data restoration device is read out.
JP2010010949A 2004-12-28 2010-01-21 Data compression apparatus and data restoration apparatus Expired - Fee Related JP4905562B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010010949A JP4905562B2 (en) 2004-12-28 2010-01-21 Data compression apparatus and data restoration apparatus

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2004379814 2004-12-28
JP2004379814 2004-12-28
JP2010010949A JP4905562B2 (en) 2004-12-28 2010-01-21 Data compression apparatus and data restoration apparatus

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2005039807A Division JP4479530B2 (en) 2004-12-28 2005-02-16 Data compression apparatus and data restoration apparatus

Publications (2)

Publication Number Publication Date
JP2010136417A true JP2010136417A (en) 2010-06-17
JP4905562B2 JP4905562B2 (en) 2012-03-28

Family

ID=38992628

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010010949A Expired - Fee Related JP4905562B2 (en) 2004-12-28 2010-01-21 Data compression apparatus and data restoration apparatus

Country Status (2)

Country Link
JP (1) JP4905562B2 (en)
CN (1) CN101095284B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2397994A2 (en) 2010-06-15 2011-12-21 Nintendo Co., Ltd. Information processing system for superimposing a virtual object on a real space correcting deviations caused by error in detection of marker in a photographed image.
TWI490855B (en) * 2013-04-02 2015-07-01 Mstar Semiconductor Inc Decoding circuit and associated decoding method
JP2016213806A (en) * 2015-05-11 2016-12-15 ヴィア アライアンス セミコンダクター カンパニー リミテッド Hardware data compressor that maintains sorted symbol list concurrently with input block scanning
US9589496B2 (en) 2013-08-27 2017-03-07 Samsung Display Co., Ltd. Temporal dithering technique used in accumulative data compression
US9695043B2 (en) 2012-10-01 2017-07-04 Intelligent Energy Inc. Fuel unit, gas generator and system
US10027346B2 (en) 2015-05-11 2018-07-17 Via Alliance Semiconductor Co., Ltd. Hardware data compressor that maintains sorted symbol list concurrently with input block scanning
KR20180127085A (en) * 2017-05-19 2018-11-28 삼성전자주식회사 Electronic device for compressing data and method for operation thereof
CN111294053A (en) * 2018-12-06 2020-06-16 英韧科技(上海)有限公司 Hardware-friendly data compression method, system and device
CN112100455A (en) * 2020-08-18 2020-12-18 北京理工大学 LZW dictionary searching method based on character string parallel search
CN116886104A (en) * 2023-09-08 2023-10-13 西安小草植物科技有限责任公司 Intelligent medical data analysis method based on artificial intelligence

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101547010B (en) * 2008-03-24 2011-07-06 华为技术有限公司 System, method and device for coding and decoding
CN102457283B (en) * 2010-10-28 2015-10-14 阿里巴巴集团控股有限公司 A kind of data compression, decompression method and equipment
EP2720376A1 (en) * 2012-10-09 2014-04-16 Alcatel Lucent Secure and lossless data compression
CN104424900B (en) * 2013-09-05 2018-03-30 联咏科技股份有限公司 Data compression system and its electricity saving method for liquid crystal display
US9219499B2 (en) * 2014-05-16 2015-12-22 Robert Bosch Gmbh Run time compression method for a vehicle communication bus
CN107065687B (en) * 2017-05-26 2019-07-26 西安工程大学 Embedded knitting system based on LZHUF controls data compression method
CN107911570B (en) * 2017-11-27 2019-11-29 公安部交通管理科学研究所 The method that a kind of pair of picture feature is compressed and decompressed
CN108427704B (en) * 2018-01-05 2022-08-09 平安科技(深圳)有限公司 Compression tool calling method and device and storage medium
JP6775558B2 (en) * 2018-09-18 2020-10-28 キヤノン株式会社 Image stretcher and its control method and program
CN110518917B (en) * 2019-07-17 2023-01-03 华东计算技术研究所(中国电子科技集团公司第三十二研究所) LZW data compression method and system based on Huffman coding
CN111464187B (en) * 2020-04-17 2023-04-28 北京百瑞互联技术有限公司 Host control interface command event coding method, storage medium and computer equipment
TWI758897B (en) * 2020-10-08 2022-03-21 大陸商星宸科技股份有限公司 Convolution calculation apparatus and method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61284119A (en) * 1985-06-11 1986-12-15 インタ−ナショナル ビジネス マシ−ンズ コ−ポレ−ション Compression system for data
JPH0661870A (en) * 1992-08-12 1994-03-04 Mitsubishi Electric Corp Variable length coder decoder
JPH07212243A (en) * 1994-01-13 1995-08-11 Fuji Photo Film Co Ltd Method and device for encoding variable length code
JPH10294670A (en) * 1997-04-18 1998-11-04 Fuji Xerox Co Ltd Encoding device, decoding device, encoding/decoding device and method for the same
JP2001044849A (en) * 1999-07-27 2001-02-16 Canon Inc Decoder and method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5861827A (en) * 1996-07-24 1999-01-19 Unisys Corporation Data compression and decompression system with immediate dictionary updating interleaved with string search
US5964842A (en) * 1997-01-31 1999-10-12 Network Computing Devices, Inc. Method and apparatus for scaling data compression based on system capacity

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61284119A (en) * 1985-06-11 1986-12-15 インタ−ナショナル ビジネス マシ−ンズ コ−ポレ−ション Compression system for data
JPH0661870A (en) * 1992-08-12 1994-03-04 Mitsubishi Electric Corp Variable length coder decoder
JPH07212243A (en) * 1994-01-13 1995-08-11 Fuji Photo Film Co Ltd Method and device for encoding variable length code
JPH10294670A (en) * 1997-04-18 1998-11-04 Fuji Xerox Co Ltd Encoding device, decoding device, encoding/decoding device and method for the same
JP2001044849A (en) * 1999-07-27 2001-02-16 Canon Inc Decoder and method

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2397994A2 (en) 2010-06-15 2011-12-21 Nintendo Co., Ltd. Information processing system for superimposing a virtual object on a real space correcting deviations caused by error in detection of marker in a photographed image.
US9695043B2 (en) 2012-10-01 2017-07-04 Intelligent Energy Inc. Fuel unit, gas generator and system
TWI490855B (en) * 2013-04-02 2015-07-01 Mstar Semiconductor Inc Decoding circuit and associated decoding method
US9589496B2 (en) 2013-08-27 2017-03-07 Samsung Display Co., Ltd. Temporal dithering technique used in accumulative data compression
JP2016213806A (en) * 2015-05-11 2016-12-15 ヴィア アライアンス セミコンダクター カンパニー リミテッド Hardware data compressor that maintains sorted symbol list concurrently with input block scanning
US10027346B2 (en) 2015-05-11 2018-07-17 Via Alliance Semiconductor Co., Ltd. Hardware data compressor that maintains sorted symbol list concurrently with input block scanning
KR20180127085A (en) * 2017-05-19 2018-11-28 삼성전자주식회사 Electronic device for compressing data and method for operation thereof
KR102337966B1 (en) 2017-05-19 2021-12-13 삼성전자주식회사 Electronic device for compressing data and method for operation thereof
CN111294053A (en) * 2018-12-06 2020-06-16 英韧科技(上海)有限公司 Hardware-friendly data compression method, system and device
CN111294053B (en) * 2018-12-06 2023-06-16 英韧科技(上海)有限公司 Hardware-friendly data compression method, system and device
CN112100455A (en) * 2020-08-18 2020-12-18 北京理工大学 LZW dictionary searching method based on character string parallel search
CN112100455B (en) * 2020-08-18 2022-09-20 北京理工大学 LZW dictionary searching method based on character string parallel search
CN116886104A (en) * 2023-09-08 2023-10-13 西安小草植物科技有限责任公司 Intelligent medical data analysis method based on artificial intelligence
CN116886104B (en) * 2023-09-08 2023-11-21 西安小草植物科技有限责任公司 Intelligent medical data analysis method based on artificial intelligence

Also Published As

Publication number Publication date
JP4905562B2 (en) 2012-03-28
CN101095284B (en) 2012-04-18
CN101095284A (en) 2007-12-26

Similar Documents

Publication Publication Date Title
JP4479530B2 (en) Data compression apparatus and data restoration apparatus
JP4905562B2 (en) Data compression apparatus and data restoration apparatus
US5818877A (en) Method for reducing storage requirements for grouped data values
US7894532B2 (en) Variable-length encoding apparatus and method
US6650261B2 (en) Sliding window compression method utilizing defined match locations
US5001478A (en) Method of encoding compressed data
US8456332B2 (en) Systems and methods for compression of logical data objects for storage
US5010345A (en) Data compression method
US5673042A (en) Method of and an apparatus for compressing/decompressing data
US20100321218A1 (en) Lossless content encoding
JP2006093958A (en) Progressive jpeg decoding system
EP2962396A1 (en) Entropy modifier and method
EP0438954B1 (en) Method of decoding compressed data
EP0435802B1 (en) Method of decompressing compressed data
Moussalli et al. A high throughput no-stall golomb-rice hardware decoder
Haque et al. Study on data compression technique
CN1656688B (en) Processing digital data prior to compression
JP3266419B2 (en) Data compression / decompression method
EP0494038A2 (en) Run-length encoding in extensible character sets
KR100686354B1 (en) Huffman decoding method and device for using variable length tree
Mesut et al. ISSDC: Digram coding based lossless data compression algorithm
JPH07298062A (en) Data compression decoding system
Robert et al. New algorithms for random access text compression
JPH03209923A (en) Data compressing system
Pannirselvam et al. A Comparative Analysis on Different Techniques in Text Compression

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110427

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110517

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110719

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110920

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20111121

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20111213

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20111226

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

Free format text: PAYMENT UNTIL: 20150120

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4905562

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

R360 Written notification for declining of transfer of rights

Free format text: JAPANESE INTERMEDIATE CODE: R360

R360 Written notification for declining of transfer of rights

Free format text: JAPANESE INTERMEDIATE CODE: R360

R371 Transfer withdrawn

Free format text: JAPANESE INTERMEDIATE CODE: R371

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees