JP5928201B2 - RESTORE PROGRAM, COMPRESSION PROGRAM, RESTORE DEVICE, COMPRESSION DEVICE, RESTORE METHOD, AND COMPRESSION METHOD - Google Patents
RESTORE PROGRAM, COMPRESSION PROGRAM, RESTORE DEVICE, COMPRESSION DEVICE, RESTORE METHOD, AND COMPRESSION METHOD Download PDFInfo
- Publication number
- JP5928201B2 JP5928201B2 JP2012153060A JP2012153060A JP5928201B2 JP 5928201 B2 JP5928201 B2 JP 5928201B2 JP 2012153060 A JP2012153060 A JP 2012153060A JP 2012153060 A JP2012153060 A JP 2012153060A JP 5928201 B2 JP5928201 B2 JP 5928201B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- length
- string
- compressed
- compression
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Description
本発明は、復元プログラム、圧縮プログラム、復元装置、圧縮装置、復元方法、および圧縮方法に関する。 The present invention relates to a restoration program, a compression program, a restoration device, a compression device, a restoration method, and a compression method.
従来、データ列を圧縮してデータ列のサイズを低減する圧縮技術がある。圧縮技術には、例えば、圧縮されたデータ列を圧縮元のデータ列に復元することができる可逆圧縮(ロスレス圧縮)技術がある。可逆圧縮技術には、例えば、「LZ77」という圧縮アルゴリズムを使用する圧縮技術や、「LZSS」という圧縮アルゴリズムを使用する圧縮技術がある。 Conventionally, there is a compression technique for reducing the size of a data string by compressing the data string. As the compression technique, for example, there is a lossless compression (lossless compression) technique capable of restoring a compressed data string to a compression source data string. The lossless compression technique includes, for example, a compression technique that uses a compression algorithm “LZ77” and a compression technique that uses a compression algorithm “LZSS”.
上述した圧縮技術によるデータ列の圧縮においては、プロセッサは、データ列の中に同一のデータが出現する場合、後に出現するデータ(以下、後続データ)を、先に出現するデータ(以下、先行データ)の開始位置とデータ長とを示すデータに圧縮する。一方、上述した圧縮技術によるデータ列への復元においては、プロセッサは、圧縮データの中の圧縮データが示す位置にある先行データを1バイト単位で順次取得することにより、圧縮データを、先行データと同一データである後続データに復元する。 In the compression of the data string by the compression technique described above, when the same data appears in the data string, the processor converts the data that appears later (hereinafter, subsequent data) to the data that appears first (hereinafter, the preceding data). ) Is compressed into data indicating the start position and data length. On the other hand, in the restoration to the data string by the compression technique described above, the processor sequentially acquires the preceding data at the position indicated by the compressed data in the compressed data in units of 1 byte, thereby converting the compressed data into the preceding data. Restore to subsequent data that is the same data.
また、圧縮データ列の中から、同一データである先行データおよび後続データを探索する技術がある。また、他の圧縮技術として、音声・画像などのロスレス圧縮に使用されるエントロピー符号化を実行するゴロム・ライス(Golomb−Rice)符号化技術がある。 There is also a technique for searching for preceding data and subsequent data that are the same data from a compressed data string. As another compression technique, there is a Golomb-Rice coding technique for executing entropy coding used for lossless compression of voice and images.
しかしながら、上述した従来技術の圧縮データは、先行データの位置やデータ長を示しており、先行データをレジスタ幅単位で取得できるか否かについては示していない。そのため、プロセッサは、先行データを1バイト単位で順次取得することになる。従って、プロセッサは、レジスタ幅を有効活用できず、圧縮データの復元処理においてレジスタの使用効率が低減するという問題がある。 However, the above-described conventional compressed data indicates the position and data length of the preceding data, and does not indicate whether or not the preceding data can be acquired in register width units. For this reason, the processor sequentially acquires the preceding data in units of 1 byte. Therefore, the processor cannot effectively use the register width, and there is a problem that the use efficiency of the register is reduced in the decompression process of the compressed data.
一方、プロセッサに、先行データをレジスタ幅単位で取得させて、レジスタ幅を活用させるには、プロセッサに、先行データのうち、レジスタ幅単位で処理できるデータの個数を算出させる必要がある。また、プロセッサに、算出させた個数を記憶装置に書き込んだり読み出したりする処理を実行させる必要がある。そのため、データ復元にかかる処理量や処理時間が増大するという問題がある。 On the other hand, in order for the processor to acquire the preceding data in register width units and to use the register width, it is necessary to cause the processor to calculate the number of data that can be processed in register width units among the preceding data. Further, it is necessary to cause the processor to execute a process of writing or reading the calculated number in the storage device. Therefore, there is a problem that the processing amount and processing time required for data restoration increase.
本発明は、プロセッサのレジスタ幅を効率的に活用することにより、データ復元の高速化を図ることを目的とする。 An object of the present invention is to increase the speed of data restoration by efficiently utilizing the register width of a processor.
本発明の一側面によれば、所定長のレジスタを有するプロセッサによって、参照先となる非圧縮データの参照位置、所定長以上である非圧縮データの長さを所定長で除した商および剰余を有する圧縮データと、非圧縮データとを含む圧縮データ列を記憶する記憶部の中から、圧縮データを検出し、検出された圧縮データに含まれている参照位置から始まる参照先データのうち、所定長に商を乗じた長さとなる第1のデータ列を所定長単位で取得するとともに、参照先データから第1のデータ列を除いた剰余分の長さとなる第2のデータ列を取得し、所定長単位で取得された第1のデータ列を所定の記憶領域に書き込むとともに、取得された第2のデータ列を所定の記憶領域に書き込む復元プログラム、復元装置、および復元方法が提案される。 According to one aspect of the present invention, a processor having a predetermined length register calculates a reference position of uncompressed data as a reference destination, a quotient obtained by dividing the length of uncompressed data that is greater than or equal to a predetermined length by a predetermined length, and a remainder. Compressed data is detected from a storage unit that stores a compressed data string including compressed data and non-compressed data, and predetermined reference data starting from a reference position included in the detected compressed data Obtaining a first data string having a length obtained by multiplying the quotient by a predetermined length unit, and obtaining a second data string having a surplus length obtained by removing the first data string from the reference destination data; A restoration program, a restoration device, and a restoration method for writing a first data string acquired in a predetermined length unit to a predetermined storage area and writing the acquired second data string to a predetermined storage area are proposed
また、本発明の一側面によれば、所定長のレジスタを有するプロセッサによって、所定の記憶領域での書込先の位置と、所定の記憶領域の先頭から所定長単位で区切られた複数の位置のうち、書込先より末尾側にあり、かつ、書込先の位置から所定長分の範囲内にある位置と、の区間長を特定し、参照先となる非圧縮データの参照位置、所定長以上である非圧縮データの長さから区間長を減じた長さを所定長で除した商および剰余を有する圧縮データと、非圧縮データとを含む圧縮データ列を記憶する記憶部の中から、圧縮データを検出し、検出された圧縮データに含まれている参照位置から始まる参照先データの先頭から順に、区間長となる第1のデータ列と、所定長に商を乗じた長さとなる所定長単位の第2のデータ列と、剰余分の長さとなる第3のデータ列と、を取得し、第1のデータ列、第2のデータ列、および第3のデータ列を所定の記憶領域における書込先の位置から取得順に書き込む復元プログラム、復元装置、および復元方法が提案される。 According to another aspect of the present invention, a processor having a register of a predetermined length causes a write destination position in a predetermined storage area and a plurality of positions divided by a predetermined length unit from the beginning of the predetermined storage area. Among them, the section length between the end of the writing destination and the position within the predetermined length from the writing destination position is specified, and the reference position of the uncompressed data serving as the reference destination, the predetermined From a storage unit for storing a compressed data string including a compressed data having a quotient and a remainder obtained by dividing a length obtained by subtracting a section length from a length of uncompressed data that is equal to or longer than a predetermined length, and the uncompressed data The compressed data is detected, and the first data string that becomes the section length and the length obtained by multiplying the predetermined length by the quotient in order from the top of the reference destination data starting from the reference position included in the detected compressed data. Second data string in a predetermined length unit and extra length A third data string, and a first data string, a second data string, and a third data string written in the order of acquisition from the write destination position in a predetermined storage area And a restoration method is proposed.
また、本発明の一側面によれば、プロセッサによって、データ列を記憶する記憶部の中から、先行データと、先行データと同一のデータである後続データと、を検出し、検出された先行データの位置、所定長以上である先行データの長さを所定長で除した商および剰余を有する圧縮データを生成し、後続データを生成された圧縮データに置換したデータ列を保存する圧縮プログラム、圧縮装置、および圧縮方法が提案される。 According to another aspect of the present invention, the processor detects preceding data and subsequent data that is the same data as the preceding data from the storage unit that stores the data string, and the detected preceding data is detected. A compression program that generates a compressed data having a quotient and a remainder obtained by dividing the position of the preceding data that is equal to or greater than the predetermined length by the predetermined length, and that stores the data string in which the subsequent data is replaced with the generated compressed data, compression An apparatus and a compression method are proposed.
また、本発明の一側面によれば、プロセッサによって、データ列を記憶する記憶部の中から、先行データと、先行データと同一のデータである後続データと、を検出し、データ列での後続データの位置と、データ列の先頭から所定長単位で区切られた複数の位置のうち、後続データの位置より末尾側にあり、かつ、後続データの位置から所定長分の範囲内にある位置と、の区間長を特定し、検出された先行データの位置、所定長以上である先行データの長さから区間長を減じた長さを所定長で除した商および剰余を有する圧縮データを生成し、後続データを生成された圧縮データに置換したデータ列を保存する圧縮プログラム、圧縮装置、および圧縮方法が提案される。 According to one aspect of the present invention, the processor detects preceding data and subsequent data that is the same data as the preceding data from the storage unit that stores the data string, and then performs subsequent processing in the data string. Among the positions of the data and a plurality of positions delimited in units of a predetermined length from the beginning of the data string, a position that is on the end side of the position of the subsequent data and is within a predetermined length range from the position of the subsequent data , And generates compressed data having a quotient obtained by dividing a length obtained by subtracting the section length from the length of the preceding data that is equal to or greater than the predetermined length, and a remainder, and a remainder. A compression program, a compression device, and a compression method for storing a data string obtained by replacing subsequent data with generated compressed data are proposed.
本発明の一側面によれば、プロセッサのレジスタ幅を効率的に活用することにより、データ復元の高速化を図ることができるという効果を奏する。 According to one aspect of the present invention, it is possible to increase the speed of data restoration by efficiently using the register width of a processor.
以下に添付図面を参照して、この発明にかかる復元プログラム、圧縮プログラム、復元装置、圧縮装置、復元方法、および圧縮方法の実施の形態を詳細に説明する。以降では、圧縮装置の機能および復元装置の機能を有する情報処理装置を例に挙げる。 Exemplary embodiments of a restoration program, a compression program, a restoration device, a compression device, a restoration method, and a compression method according to the present invention will be described below in detail with reference to the accompanying drawings. Hereinafter, an information processing apparatus having the function of a compression apparatus and the function of a decompression apparatus will be described as an example.
(圧縮データ列の復元処理の内容)
図1は、圧縮データ列の復元処理の内容を示す説明図である。
(Contents of compressed data string restoration processing)
FIG. 1 is an explanatory diagram showing the contents of the compressed data string decompression process.
情報処理装置は、復元プログラムを保持するコンピュータである。図1において、情報処理装置100は、復元プログラムにより、圧縮されたデータ列から圧縮元のデータ列を復元する。
The information processing apparatus is a computer that holds a restoration program. In FIG. 1, the
また、情報処理装置100のプロセッサは、データレジスタ(以下では、単に「レジスタ」という)を有する。ここでは、一例として、レジスタのレジスタ幅は「8バイト」とする。レジスタは、ROM(Read Only Memory)、RAM(Random Access Memory)や、磁気ディスクドライブ(Hard Disk Drive)などの他の記憶装置と比べて、情報処理装置100のプロセッサから高速にアクセスできる記憶装置である。ここでは、1バイトは、いわゆるオクテットであり、8ビットである。
The processor of the
ここで、情報処理装置100のプロセッサは、レジスタ幅が「8バイト」であるレジスタを有するため、8バイト単位のデータをまとめて処理することができる。そのため、情報処理装置100のプロセッサは、8バイト分のデータを処理する場合には、1バイト単位で順次処理するよりも、8バイト単位でまとめて処理する方が、短時間で処理を終了することができる。
Here, since the processor of the
以降、圧縮されたデータ列を「圧縮データ列」という。また、圧縮データ列cdsAから復元される圧縮元のデータ列を、「圧縮元データ列」という。圧縮データ列cdsAは、復元に使用するデータが圧縮元データ列内に存在したために圧縮することができた圧縮データと、復元に使用するデータが圧縮元データ列内に存在しなかったために圧縮することができなかった非圧縮データと、を含む。 Hereinafter, the compressed data string is referred to as “compressed data string”. A compression source data string restored from the compression data string cdsA is referred to as a “compression source data string”. The compressed data string cdsA is compressed because the data used for restoration exists in the compression source data string and can be compressed, and the data used for restoration does not exist in the compression source data string. Uncompressed data that could not be recorded.
また、圧縮データ列cdsAには、判別ビット列bsAが付与されている。判別ビット列bsAは、圧縮データ列cdsAにおける圧縮データが始まる位置を特定するために使用される情報である。以降、圧縮データが始まる位置を、「圧縮データの位置」という。 Also, the discrimination bit string bsA is given to the compressed data string cdsA. The determination bit string bsA is information used to specify the position where the compressed data starts in the compressed data string cdsA. Hereinafter, the position where the compressed data starts is referred to as “compressed data position”.
図1の例では、復元対象になる圧縮データ列cdsAは、「internationalization…30,2,4…」である。圧縮データ列cdsA内の非圧縮データである各アルファベットは1バイトのデータである。圧縮データ列cdsA内の圧縮データである「30,2,4」は3バイトのデータである。
In the example of FIG. 1, the compressed data string cdsA to be restored is “
判別ビット列bsAは、「00000000000000000000…1…」である。判別ビット列bsA内の各判別ビットは1ビットのデータである。判別ビット列bsA内の各判別ビットは、当該判別ビットに対応する位置にあるデータが圧縮データか否かを示す。判別ビットは、例えば、「0」である場合、圧縮データ列cdsA内の当該判別ビットに対応するデータが非圧縮データであることを示す。また、判別ビットは、例えば、「1」である場合、圧縮データ列cdsA内の当該判別ビットに対応するデータが圧縮データであることを示す。 The discrimination bit string bsA is “00000000000000000000... 1”. Each discrimination bit in the discrimination bit string bsA is 1-bit data. Each determination bit in the determination bit string bsA indicates whether or not the data at the position corresponding to the determination bit is compressed data. For example, when the determination bit is “0”, it indicates that the data corresponding to the determination bit in the compressed data string cdsA is uncompressed data. For example, when the determination bit is “1”, it indicates that the data corresponding to the determination bit in the compressed data string cdsA is compressed data.
図1において、情報処理装置100は、判別ビット列bsAの先頭から、順次、判別ビットを参照し、圧縮データ列cdsA内の先頭から始まる「internationalization … 」の各アルファベットが非圧縮データであると特定する。そして、情報処理装置100は、非圧縮データをそのまま、復元バッファに格納しているとする。
In FIG. 1, the
(1)次に、情報処理装置100は、判別ビット列bsAの判別ビットbAを参照すると、参照した判別ビットbAが「1」であるため、判別ビットbAに対応する位置にあるデータ「30,2,4」が圧縮データcdAであると特定する。
(1) Next, when the
(2)次に、情報処理装置100は、特定した圧縮データcdA「30,2,4」を参照して、特定した圧縮データcdAより先頭側にあり、圧縮データcdAから圧縮元のデータを復元するために参照されるデータが始まる位置を示す「30」を抽出する。
(2) Next, the
以降、圧縮元のデータを「圧縮元データ」という。また、圧縮元データを復元するために参照されるデータを「参照先データ」という。参照先データが始まる位置を、「参照先データの位置」という。ここで、抽出された「30」は、参照先データの位置が、圧縮データcdAの位置から「30バイト前」であることを示している。 Hereinafter, the compression source data is referred to as “compression source data”. Data referred to for decompressing the compression source data is referred to as “reference destination data”. The position where the reference destination data starts is referred to as “reference destination data position”. Here, the extracted “30” indicates that the position of the reference destination data is “30 bytes before” the position of the compressed data cdA.
(3)そして、情報処理装置100は、特定した圧縮データcdA(「30,2,4」)を参照して、参照先データのうち、レジスタ幅である「8バイト」単位で分割して処理できるデータの個数を示す「2」を抽出する。また、情報処理装置100は、参照先データのうち、「8バイト」単位でまとめて処理できずに残ったデータのデータ長であり、1バイト単位で処理すべきデータ長である端数データ長を示す「4」を抽出する。
(3) Then, the
(4)次に、情報処理装置100は、圧縮データcdAの位置から、「30」バイト分、先頭側にある参照先データの位置を特定して、参照先データの取得を開始する。情報処理装置100は、具体的には、例えば、特定した参照先データの位置から、順に、抽出した個数分、「8バイト」単位のデータを取得する。
(4) Next, the
(5)ここでは、まず、情報処理装置100は、特定した参照先データの位置から、「1」個目の8バイト単位のデータ「internat」をまとめて取得して、復元バッファに格納する。(6)次に、情報処理装置100は、取得した「1」個目のデータの後続に存在する「2」個目の8バイト単位のデータ「ionaliza」をまとめて取得して、復元バッファに格納する。
(5) Here, first, the
(7)そして、情報処理装置100は、取得した「2」個目のデータの後続に存在し、端数データ長である「4」バイト分のデータ「tion」を、1バイト単位で、順次取得して、復元バッファに格納する。
(7) Then, the
これにより、情報処理装置100は、圧縮データ列cdsA内の圧縮データ「30,2,4」が圧縮元データ「internationalization」に置換されたデータ列を、復元バッファに格納することができる。そして、情報処理装置100は、復元バッファに格納されたデータ列「internationalization…internationalization…」を、圧縮元データ列dsAとして、出力することができる。
Thereby, the
また、このように、情報処理装置100は、圧縮データcdAを参照して、参照先データを、8バイト単位のデータに分割してまとめて取得して、復元バッファに格納することができる。これにより、情報処理装置100は、レジスタ幅を効率的に活用することができ、データ復元の高速化を図ることができる。
Further, in this way, the
ここでは、圧縮データが示す参照先データの位置は、圧縮データの位置から何バイト分前が参照先データの位置であるかにより示されていたが、これに限らない。例えば、圧縮データが示す参照先データの位置は、圧縮データ列cdsAの位置から何バイト目が参照先データの位置であるかにより示されてもよい。 Here, the position of the reference destination data indicated by the compressed data is indicated by how many bytes before the position of the compressed data is the position of the reference destination data, but is not limited thereto. For example, the position of the reference destination data indicated by the compressed data may be indicated by how many bytes from the position of the compressed data string cdsA are the position of the reference destination data.
ここでは、圧縮データは、参照先データの位置を示すデータ、参照先データのうち8バイト単位で分割して処理できるデータの個数を示すデータ、および1バイト単位で処理すべき端数データ長を示すデータ、の順に含んでいたが、これに限らない。例えば、圧縮データは、参照先データのうち8バイト単位で分割して処理できるデータの個数を示すデータ、1バイト単位で処理すべき端数データ長を示すデータ、および参照先データの位置を示すデータ、の順に含んでもよい。 Here, the compressed data indicates data indicating the position of the reference destination data, data indicating the number of pieces of data that can be divided and processed in units of 8 bytes, and fractional data length to be processed in units of 1 byte. It was included in the order of data, but is not limited to this. For example, the compressed data includes data indicating the number of pieces of data that can be divided and processed in units of 8 bytes of the reference destination data, data indicating the fraction data length to be processed in units of bytes, and data indicating the position of the reference destination data , May be included in this order.
ここでは、判別ビット列bsAは、圧縮データ列cdsAとは別のデータとして保存されていたが、これに限らない。例えば、判別ビット列bsA内の各判別ビットは、各々、当該判別ビットに対応する圧縮データ列cdsA内の圧縮データまたは非圧縮データの直前に付与されていてもよい。判別ビット列bsAと圧縮データ列cdsAとの保存例については、図15に後述する。 Here, the discrimination bit string bsA is stored as data different from the compressed data string cdsA, but is not limited thereto. For example, each determination bit in the determination bit string bsA may be provided immediately before the compressed data or the non-compressed data in the compressed data string cdsA corresponding to the determination bit. An example of storing the discrimination bit string bsA and the compressed data string cdsA will be described later with reference to FIG.
ここでは、情報処理装置100は、圧縮データ列cdsAから圧縮元データ列dsAを復元する機能のみを有していたが、これに限らない。例えば、情報処理装置100は、圧縮データ列cdsAから圧縮元データ列dsAを復元する機能の他、データ列を圧縮して圧縮データ列cdsAを生成する機能をさらに有してもよい。
Here, the
(情報処理装置100のハードウェア構成例)
図2は、実施の形態にかかる情報処理装置100のハードウェア構成例を示すブロック図である。図2において、情報処理装置100は、プロセッサ201と、ROM202と、RAM203と、磁気ディスクドライブ204と、磁気ディスク205と、光ディスクドライブ206と、光ディスク207と、ディスプレイ208と、I/F(Interface)209と、キーボード210と、マウス211と、スキャナ212と、プリンタ213と、を備えている。また、各構成部は、バス220によってそれぞれ接続されている。
(Hardware configuration example of information processing apparatus 100)
FIG. 2 is a block diagram of a hardware configuration example of the
ここで、プロセッサ201は、情報処理装置100の全体の制御を司る。また、プロセッサ201は、処理対象のデータを格納するレジスタを有する。プロセッサ201は、レジスタへのアクセスを、ROM202、RAM203、磁気ディスク205、および光ディスク207へのアクセスよりも、高速に実行することができる。ROM202は、ブートプログラム、圧縮プログラム、および復元プログラムなどのプログラムを記憶している。RAM203は、プロセッサ201のワークエリアとして使用される。磁気ディスクドライブ204は、プロセッサ201の制御にしたがって磁気ディスク205に対するデータのリード/ライトを制御する。磁気ディスク205は、磁気ディスクドライブ204の制御で書き込まれたデータを記憶する。
Here, the
光ディスクドライブ206は、プロセッサ201の制御にしたがって光ディスク207に対するデータのリード/ライトを制御する。光ディスク207は、光ディスクドライブ206の制御で書き込まれたデータを記憶したり、光ディスク207に記憶されたデータをコンピュータに読み取らせたりする。
The
ディスプレイ208は、カーソル、アイコンあるいはツールボックスをはじめ、文書、画像、機能情報などのデータを表示する。このディスプレイ208は、例えば、液晶ディスプレイ、プラズマディスプレイなどを採用することができる。
The
インターフェース(以下、「I/F」と略する。)209は、通信回線を通じてLAN(Local Area Network)、WAN(Wide Area Network)、インターネットなどのネットワーク214に接続され、このネットワーク214を介して他の装置に接続される。そして、I/F209は、ネットワーク214と内部のインターフェースを司り、外部装置からのデータの入出力を制御する。I/F209には、例えばモデムやLANアダプタなどを採用することができる。
An interface (hereinafter abbreviated as “I / F”) 209 is connected to a
キーボード210は、文字、数字、各種指示などの入力のためのキーを備え、データの入力をおこなう。また、タッチパネル式の入力パッドやテンキーなどであってもよい。マウス211は、カーソルの移動や範囲選択、あるいはウィンドウの移動やサイズの変更などをおこなう。ポインティングデバイスとして同様に機能を備えるものであれば、トラックボールやジョイスティックなどであってもよい。 The keyboard 210 includes keys for inputting characters, numbers, various instructions, and the like, and inputs data. Moreover, a touch panel type input pad or a numeric keypad may be used. The mouse 211 performs cursor movement, range selection, window movement, size change, and the like. A trackball or a joystick may be used as long as they have the same function as a pointing device.
スキャナ212は、画像を光学的に読み取り、情報処理装置100内に画像データを取り込む。なお、スキャナ212は、OCR(Optical Character Reader)機能を持たせてもよい。また、プリンタ213は、画像データや文書データを印刷する。プリンタ213には、例えば、レーザプリンタやインクジェットプリンタを採用することができる。なお、光ディスクドライブ206、光ディスク207、ディスプレイ208、キーボード210、マウス211、スキャナ212、およびプリンタ213の少なくともいずれか1つは、なくてもよい。
The
・実施例1
次に、実施例1について説明する。実施例1では、圧縮データは、参照先データのうち、圧縮元データを復元するプロセッサ201により8バイト単位で分割して取得されるべきデータの個数と、1バイト単位で取得されるべき端数データ長と、を示すデータである。また、圧縮データは、参照先データの位置も示す。
Example 1
Next, Example 1 will be described. In the first embodiment, the compressed data includes the number of pieces of data to be acquired by dividing the reference data by the
<実施例1にかかる情報処理装置100によるデータの圧縮>
以降では、まず、実施例1にかかる情報処理装置100によるデータ列の圧縮について、図3〜図16に示す。また、実施例1にかかる情報処理装置100による圧縮元データ列の復元については、後述する図17〜図24に示す。
<Data Compression by
In the following, first, data string compression performed by the
(実施例1にかかる情報処理装置100のデータ列の圧縮に関する機能的構成例)
まず、図3を用いて、実施例1にかかる情報処理装置100のデータ列の圧縮に関する機能的構成例について説明する。図3は、実施例1にかかる情報処理装置100のデータ列の圧縮に関する機能的構成例を示すブロック図である。情報処理装置100は、記憶部301と、検出部302と、生成部303と、保存部304と、を含む構成である。
(Functional configuration example regarding compression of data string of
First, a functional configuration example related to compression of a data string of the
ここで、情報処理装置100は、所定長のレジスタを有する。所定長とは、2の冪乗になるレジスタ幅であり、例えば、上述した8バイトである。1バイトとは、複数ビットの集合であり、例えば、いわゆるオクテットであり、8ビットである。レジスタとは、例えば、上述したデータレジスタである。データレジスタは、アキュムレータともいう。
Here, the
情報処理装置100は、例えば、圧縮データを自装置で復元する場合、自装置のプロセッサ201のレジスタ幅に合わせてデータを圧縮する。また、情報処理装置100は、圧縮データを他装置で復元する場合、他装置のプロセッサのレジスタ幅に合わせてデータを圧縮してもよい。
For example, when the compressed data is restored by the own apparatus, the
記憶部301は、データ列を記憶する。ここで、データ列とは、圧縮対象になるデータ列である。記憶部301は、具体的には、例えば、情報処理装置100の利用者によるキーボード210やマウス211などの入力装置の操作によって入力された圧縮元データ列を記憶する。
The
記憶部301は、具体的には、例えば、図2に示したROM202、RAM203、磁気ディスク205、光ディスク207などの記憶装置により、その機能を実現する。これにより、検出部302は、圧縮対象になる圧縮元データ列を参照することができる。ここで、図4を用いて、記憶部301によって記憶される圧縮元データ列の一例について説明する。
Specifically, the
図4は、圧縮元データ列の一例を示す説明図である。図4の例では、圧縮元データ列dsBは、「compression decompress compression.」である。圧縮元データ列dsBに含まれるアルファベットなどの各文字は、1バイトのデータである。 FIG. 4 is an explanatory diagram showing an example of the compression source data string. In the example of FIG. 4, the compression source data string dsB is “compression decompression compression.”. Each character such as an alphabet included in the compression source data string dsB is 1-byte data.
各文字は、具体的には、例えば、「ISO(International Organization for Standardization)/IEC(International Electrotechnical Commission) 8859」や「ASCII(American Standard Code for Information Interchange)」などの文字コードである。 Specifically, each character is, for example, “ISO (International Organization for Standardization) / IEC (International Electrotechnical Commission) 8859” or “ASCII (American Standard Code Information)”.
また、図4の例では、記憶部301の記憶領域のアドレス幅が「8バイト」であり、記憶部301の記憶領域は、「8バイト」でアラインされているとする。そして、圧縮元データ列dsBは、記憶領域の先頭から格納されており、「8バイト」ごとに区切られているとする。
In the example of FIG. 4, it is assumed that the address width of the storage area of the
ここで、情報処理装置100は、データ列にアクセスする場合、アラインされて区切られた区間のデータごとにアクセスするという性質がある。従って、情報処理装置100は、例えば、8バイトのデータが、アラインされて区切られた区間内に格納されている場合は、1回のアクセスにより8バイトのデータを取得することができる。一方、情報処理装置100は、8バイトのデータが、アラインされて区切られた位置を跨いで格納されている場合は、2回のアクセスによりデータを取得することになる。情報処理装置100は、具体的には、8バイトのデータのうち先頭部分を格納している区間にアクセスした後、8バイトのデータのうち末尾部分を格納している区間にアクセスすることにより、8バイトのデータを取得することになる。
Here, when accessing the data string, the
図3に戻り、検出部302は、データ列を記憶する記憶部301の中から、先行データと、先行データと同一のデータである後続データと、を検出する。後続データとは、例えば、上述した圧縮元データである。先行データとは、例えば、圧縮元データの復元に使用する参照先データである。
Returning to FIG. 3, the
検出部302は、具体的には、例えば、圧縮元データ列dsBの中から、圧縮元データ列dsBの24バイト目から34バイト目までにある圧縮元データ「compression」を特定する。次に、検出部302は、圧縮元データ列dsBの中から、圧縮元データと同一データになる参照先データを探索する。
Specifically, for example, the
そして、検出部302は、圧縮元データと同一データになる圧縮元データ列dsBの1バイト目から11バイト目までにある参照先データ「compression」を特定する。特定されたデータは、例えば、RAM203、磁気ディスク205、光ディスク207などの記憶領域に記憶される。
Then, the
検出部302は、具体的には、例えば、図2に示したROM202、RAM203、磁気ディスク205、光ディスク207などの記憶装置に記憶されたプログラムをプロセッサ201に実行させることにより、その機能を実現する。これにより、検出部302は、生成部303に圧縮対象になる圧縮元データと、圧縮元データの圧縮のために使用する参照先データと、を送ることができる。ここで、図5を用いて、検出部302による圧縮元データおよび参照先データの特定について説明する。
Specifically, the
図5は、参照先データの探索方法の一例を示す説明図である。図5の例では、(11)検出部302は、圧縮元データ列dsBの中から、3バイト分のデータと、3バイト分のデータが始まる位置と、の組み合わせを抽出する。検出部302は、具体的には、例えば、3バイト分のデータ「com」と、「com」が始まる位置である圧縮元データ列dsBの「1」バイト目と、の組み合わせを抽出する。
FIG. 5 is an explanatory diagram showing an example of a method for searching for reference destination data. In the example of FIG. 5, (11) the
次に、検出部302は、抽出した組み合わせを、3バイト分のデータがアルファベット順になるように、並べ替える。検出部302は、具体的には、例えば、抽出した組み合わせを、基数ソート(ラディックスソート:Radix sort)を使用して並べ替える。基数ソートは、並べ替えアルゴリズムの一つである。基数ソートは、従来技術のため、ここでは、説明を省略する。
Next, the
(12)そして、検出部302は、並べ替えた組み合わせの中で、同一データになる先行データと後続データとを特定して、後続データの何バイト前に先行データが開始しているかを、特定する。次に、検出部302は、後続データの位置と、後続データに対する先行データの相対位置と、を対応付けて、探索テーブル500を生成する。
(12) Then, the
検出部302は、具体的には、例えば、「com」の位置が、「1」バイト目、「15」バイト目、および「24」バイト目にあることを検出する。次に、検出部302は、「com」が「1」バイト目および「15」バイト目にあるため、先行データの位置が後続データの位置から「14(15−1)」バイト前にあることを特定する。そして、検出部302は、後続データの位置「15」バイト目と、先行データの位置が後続データの位置から「14(15−1)」バイト前にあることと、を対応付けて、探索テーブル500を生成する。
Specifically, for example, the
(13)次に、検出部302は、圧縮元データ列dsBの24バイト目から31バイト目までにある後続データ「compress」と同一データになる先行データが「9」バイト前にあることを特定する。また、検出部302は、特定した1個目の先行データと同一のデータになる2個目の先行データが「23(9+14)」バイト前にあることを特定する。また、検出部302は、圧縮元データ列dsBの30バイト目から34バイト目までにある後続データ「ssion」と同一データになる先行データが「23」バイト前にあることを特定する。
(13) Next, the
これにより、検出部302は、後続データ「compress」と後続データ「ssion」とは、両方とも、「23」バイト前に同一データになる先行データがあることを特定する。そして、検出部302は、各々の後続データを組み合わせたデータ「compression」を圧縮元データとして採用し、圧縮元データと同一データになる参照先データ「compression」が圧縮元データから「23」バイト前にあることを特定する。
As a result, the
ここでは、検出部302は、圧縮元データとして、各々の後続データを組み合わせたデータを採用したが、これに限らない。例えば、検出部302は、各々の後続データを、別個の圧縮元データとして採用してもよい。
Here, the
より具体的には、例えば、検出部302は、後続データ「compress」を1個目の圧縮元データとして採用し、圧縮元データと同一データになる参照先データ「compress」が圧縮元データから「9」バイト前にあることを特定してもよい。さらに、検出部302は、圧縮されずに残った後続データ「ion」を2個目の圧縮元データとして採用し、圧縮元データと同一データになる参照先データ「ion」が圧縮元データから「23」バイト前にあることを特定してもよい。
More specifically, for example, the
従って、検出部302によって圧縮元データとして採用されるデータは、単語を示すデータに限らない。例えば、検出部302によって圧縮元データとして採用されるデータは、複数の単語を含む文章を示すデータであってもよい。また、検出部302によって圧縮元データとして採用されるデータは、単語の一部を示すデータであってもよい。
Therefore, the data adopted as the compression source data by the
ここでは、検出部302は、抽出した組み合わせを並べ替える際に、ラディックスソートを使用したが、これに限らない。例えば、検出部302は、マージソートを使用してもよい。また、検出部302は、図5に示した探索方法を使用したが、これに限らない。例えば、検出部302は、ハッシュ表による探索方法を使用してもよいし、木構造による探索方法を使用してもよい。ハッシュ表による探索方法や木構造による探索方法は、従来技術のため、ここでは、説明を省略する。
Here, the
図3に戻り、生成部303は、検出された先行データの位置、所定長以上である先行データの長さを所定長で除した商および剰余を有する圧縮データを生成する。ここで、一般には、先行データの長さから区間長を減じた長さを所定長で除した剰余は、所定長未満になるが、これに限らない。例えば、剰余は所定長以上であってもよい。
Returning to FIG. 3, the
より具体的には、例えば、「20バイト」を「8バイト」で除した場合に、商として「2」を採用し、剰余として「4バイト」を採用してもよい。また、例えば、「20バイト」を「8バイト」で除した場合に、商として「1」を採用し、剰余として「12バイト」を採用してもよい。 More specifically, for example, when “20 bytes” is divided by “8 bytes”, “2” may be employed as the quotient and “4 bytes” may be employed as the remainder. Further, for example, when “20 bytes” is divided by “8 bytes”, “1” may be adopted as a quotient and “12 bytes” may be adopted as a remainder.
生成部303は、具体的には、例えば、検出部302によって特定された参照先データの相対位置を示すデータを生成する。次に、生成部303は、参照先データのデータ長を8バイトで除した商と剰余とを算出する。そして、生成部303は、参照先データのうち、8バイト単位で分割して処理できるデータの個数として、上述のように算出した商を採用し、採用した商を示すデータを生成する。
Specifically, the
次に、生成部303は、参照先データを8バイト単位でまとめて処理した後に、1バイト単位で処理すべき端数データ長として、上述のように算出した剰余を採用し、採用した剰余を示すデータを生成する。そして、生成部303は、生成したデータを連結した圧縮データを生成する。次に、生成部303は、圧縮元データを圧縮したことを示す判別ビットを生成する。また、生成部303は、圧縮元データが圧縮できなかった場合、圧縮元データを圧縮しなかったことを示す判別ビットを生成してもよい。
Next, after processing the reference data in units of 8 bytes, the
また、復元を実行する他のプロセッサのレジスタ幅が、情報処理装置100の有するレジスタ幅の倍数である場合がある。この場合、生成部303は、検出された先行データの位置、所定長以上である先行データの長さを所定長の倍数で除した商および剰余を有する圧縮データを生成してもよい。これにより、復元を実行する他のプロセッサのレジスタ幅と、情報処理装置100のプロセッサ201のレジスタ幅と、が異なる場合であっても、データ圧縮が可能になる。生成されたデータは、例えば、RAM203、磁気ディスク205、光ディスク207などの記憶領域に記憶される。
In addition, the register width of another processor that executes restoration may be a multiple of the register width of the
生成部303は、具体的には、例えば、図2に示したROM202、RAM203、磁気ディスク205、光ディスク207などの記憶装置に記憶されたプログラムをプロセッサ201に実行させることにより、その機能を実現する。これにより、生成部303は、圧縮元データと置換すべき圧縮データを保存部304に送ることができる。
Specifically, the
ここで、図6〜図8を用いて、実施例1にかかる生成部303によって生成される圧縮データの内容について説明する。具体的には、図6を用いて実施例1にかかる圧縮ルールについて説明し、図7および図8を用いて図6に示した圧縮ルールにより圧縮された圧縮データの一例について説明する。
Here, the content of the compressed data generated by the
図6は、実施例1にかかる圧縮ルールを示す説明図である。図6に示すように、実施例1にかかる圧縮ルールでは、圧縮データは、参照先データの位置を示す「13ビット」の固定長データ601と、参照先データのデータ長を示す「3ビット+8ビットの倍数のデータ長」の可変長データと、を含む。3ビット+8ビットの倍数のデータ長とは、例えば、3ビット、11ビット、または19ビットである。
FIG. 6 is an explanatory diagram of a compression rule according to the first embodiment. As shown in FIG. 6, in the compression rule according to the first embodiment, the compressed data includes “13 bits” fixed
参照先データの位置を示す固定長データ601は、圧縮データの位置から参照先データの位置までの間のデータ長を示す。固定長データ601は、「13ビット」であるため、圧縮データの位置から参照先データの位置までの間のデータ長を「0バイト〜8191バイト」の範囲で示す。
参照先データのデータ長を示す可変長データは、参照先データのデータ長が「10」バイト未満である場合、「3ビット」のデータ602である。可変長データ601は、データ長が「3ビット」であるため、参照先データのデータ長を「3バイト〜9バイト」の範囲で示す。ここでは、可変長データ602は、例えば、可変長データ602が「000」である場合、2進数「000」に対応する10進数「0」ではなく、10進数「3」を示している。
The variable length data indicating the data length of the reference destination data is “3-bit”
実施例1の圧縮ルールでは、圧縮データのデータ長は2バイト以上になる。そのため、情報処理装置100は、圧縮元データのデータ長が「1バイトまたは2バイト」である場合には、圧縮してもデータサイズが低減しないことになるから、圧縮元データを圧縮しなくてもよい。従って、参照先データのデータ長として「0バイト〜2バイト」を示す必要がないため、可変長データ602は、データ「000〜110」の各々に、各々の2進数を10進数に変換した「0〜7」ではなく、「3〜9」を対応付けている。
In the compression rule of the first embodiment, the data length of the compressed data is 2 bytes or more. Therefore, when the data length of the compression source data is “1 byte or 2 bytes”, the
また、参照先データのデータ長を示す可変長データは、参照先データのデータ長が「10」バイト以上「256バイト」未満である場合、「3ビット」のデータ602と「5ビット」のデータ603と「3ビット」のデータ604とを連結したデータである。
The variable length data indicating the data length of the reference destination data is “3 bits”
可変長データ602〜604のうち、データ602は「111」となり、参照先データのデータ長が「10バイト」以上であることを示すとともに、後続の「8ビット」のデータ603,604が参照先データのデータ長を示すデータであることを示す。
Among the
可変長データ602〜604のうち、データ603は、参照先データのうち、「8バイト」単位で分割して取得できるデータの個数を示す。データ603は、データ長が「5ビット」であるため、個数を「1〜31」の範囲で示す。換言すれば、データ603は、「8バイト〜248バイト」の範囲内の8の倍数のデータ長のいずれかを示す。実施例1の圧縮ルールでは、「8バイト」単位で分割して取得できるデータの個数として「0」を示す必要がないため、データ603は、データ「00000〜11110」の各々に、各々の2進数を10進数に変換した「0〜30」ではなく、「1〜31」を対応付けている。
Of the
また、データ604は、参照先データのデータ長から、データ603が示す個数分の「8バイト」を減じた端数データ長を示す。ここで、データ604は、データ長が「3ビット」であるため、端数データ長を「0バイト〜7バイト」の範囲で示す。
また、参照先データのデータ長が「256バイト」以上である場合がある。この場合、参照先データのデータ長を示す可変長データは、「3ビット」のデータ602と「5ビット」のデータ603と「3ビット」のデータ604と「8ビット」のデータ605とを連結したデータである。データ602,604については、参照先データのデータ長が「10バイト」以上「256バイト」未満である場合と同様のため、ここでは、説明を省略する。
Further, the data length of the reference destination data may be “256 bytes” or more. In this case, the variable length data indicating the data length of the reference destination data is obtained by concatenating “3 bits”
可変長データ602〜605のうち、データ603は、「11111」となり、参照先データのうち、「8バイト」単位で分割して取得できるデータの個数が「31」以上であることを示す。また、データ603は、後続の「8ビット」のデータ605が、参照先データのうち、「8バイト」単位で分割して取得できるデータの個数を示すデータであることを示す。
Of the
可変長データ602〜605のうち、データ605は、参照先データのうち、「8バイト」単位で分割して取得できるデータの個数が、「31」より何個多いかを示すことにより、間接的にデータの個数を示す。データ605は、データ長が「8ビット」であるため、個数「31」より何個多いかを「1〜255」の範囲で示す。
Among the
これにより、データ605は、参照先データのうち、「8バイト」単位で分割して取得できるデータの個数を、「32〜286(31+1〜31+255)」の範囲で示す。換言すれば、データ605は、「256バイト〜2040バイト」の範囲内の8の倍数のデータ長のいずれかを示す。
As a result, the
以降、参照先データのデータ長を示す可変長データは、上述した「8バイト」単位で分割して取得できるデータの個数が、当該個数を示すために使用中のデータ長で示せなくなる都度、新たに当該個数を示すための8ビットのデータを追加する。そして、追加した8ビットのデータを使用して、「8バイト」単位で分割して取得できるデータの個数を示すことになる。 Thereafter, the variable length data indicating the data length of the reference destination data is updated each time the number of data that can be obtained by dividing in units of “8 bytes” described above cannot be indicated by the data length being used to indicate the number. Is added with 8-bit data for indicating the number. Then, using the added 8-bit data, the number of pieces of data that can be obtained by being divided in units of “8 bytes” is indicated.
図7および図8は、圧縮されなかった非圧縮データの一例、および、図6に示した圧縮ルールによって圧縮された圧縮データの一例を示す説明図である。 7 and 8 are explanatory diagrams illustrating an example of uncompressed data that has not been compressed, and an example of compressed data that has been compressed according to the compression rule illustrated in FIG. 6.
図7(A)は、圧縮されなかった非圧縮データの一例を示す。図7(B)は、9バイト以下のデータ長の圧縮元データを圧縮した場合の圧縮データの一例を示す。図7(C)は、9バイトより長いデータ長の圧縮元データを圧縮した場合の圧縮データの一例(その1)を示す。図8(D)は、9バイトより長いデータ長の圧縮元データを圧縮した場合の圧縮データの一例(その2)を示す。 FIG. 7A shows an example of uncompressed data that has not been compressed. FIG. 7B shows an example of compressed data when compression source data having a data length of 9 bytes or less is compressed. FIG. 7C shows an example (part 1) of compressed data when compression source data having a data length longer than 9 bytes is compressed. FIG. 8D shows an example (part 2) of compressed data when compression source data having a data length longer than 9 bytes is compressed.
図7(A)に示すように、圧縮元データ列dsCに含まれるデータが圧縮できないデータdCである場合がある。この場合、生成部303は、圧縮できないデータdCを、非圧縮データndCとして、そのまま保存部304に送る。また、生成部303は、圧縮していないことを示す判別ビットbC「0」を生成する。
As shown in FIG. 7A, the data included in the compression source data string dsC may be data dC that cannot be compressed. In this case, the
図7(B)に示すように、圧縮元データ列dsDに、同一データになる圧縮元データtdDと参照先データrdDとがあり、圧縮元データtdDが「9バイト」以下である場合がある。この場合、生成部303は、「13ビット」で、参照先データrdDの相対位置「10」を示す「0000000001010(10)」を生成する。
As illustrated in FIG. 7B, the compression source data string dsD includes compression source data tdD and reference destination data rdD that are the same data, and the compression source data tdD may be “9 bytes” or less. In this case, the
次に、生成部303は、「3ビット」で、参照先データrdDのデータ長「4バイト」を示す「001(4)」を生成する。そして、生成部303は、生成したデータを連結した圧縮データcdD「0000000001010(10)001(4)」を生成する。また、生成部303は、圧縮したことを示す判別ビットbD「1」を生成する。
Next, the
図7(C)に示すように、圧縮元データ列dsEに、同一データになる圧縮元データtdEと参照先データrdEとがあり、圧縮元データtdEが「9バイト」より大きい場合がある。ここでは、圧縮元データtdEの位置から2バイト目が、圧縮元データ列dsEの先頭からアラインされて区切られた位置とする。 As shown in FIG. 7C, the compression source data string dsE includes compression source data tdE and reference destination data rdE that become the same data, and the compression source data tdE may be larger than “9 bytes”. Here, it is assumed that the second byte from the position of the compression source data tdE is a position that is aligned and separated from the head of the compression source data string dsE.
この場合、生成部303は、「13ビット」で、参照先データrdEの相対位置「20」を示す「0000000010100(20)」を生成する。次に、生成部303は、「3ビット」で、参照先データrdEのデータ長が「9バイト」より大きいことを示す「111(10)」を生成する。
In this case, the
そして、生成部303は、参照先データrdE「compression」のデータ長「11バイト」を「8バイト」で除することにより、8バイト単位で分割して処理できるデータの個数「1」を算出する。次に、生成部303は、8バイト単位で分割して処理できるデータの個数「1」を示すデータ「00000(1)」を生成する。
Then, the
そして、生成部303は、参照先データrdE「compression」のデータ長から、算出した個数分の「8バイト」を減じて、端数データ長「3バイト」を算出する。次に、生成部303は、1バイト単位で処理すべき端数データ長「3」を示すデータ「011(3)」を生成する。そして、生成部303は、生成したデータを連結した圧縮データcdE「0000000010100(20)111(10)00000(1)011(3)」を生成する。また、生成部303は、圧縮したことを示す判別ビットbE「1」を生成する。
Then, the
図8(D)に示すように、圧縮元データ列dsFに、同一データになる圧縮元データtdFと参照先データrdFとがあり、圧縮元データtdFが「9バイト」より大きい場合がある。ここでは、圧縮元データtdFの位置から2バイト目が、圧縮元データ列dsFの先頭からアラインされて区切られた位置とする。 As illustrated in FIG. 8D, the compression source data string dsF includes compression source data tdF and reference destination data rdF that are the same data, and the compression source data tdF may be larger than “9 bytes”. Here, it is assumed that the second byte from the position of the compression source data tdF is aligned and separated from the head of the compression source data string dsF.
この場合、生成部303は、「13ビット」で、参照先データrdFの相対位置「1120」を示す「0010001100000(1120)」を生成する。次に、生成部303は、「3ビット」で、参照先データrdFのデータ長が「9バイト」より大きいことを示す「111(10)」を生成する。
In this case, the
そして、生成部303は、参照先データrdFのデータ長「303バイト」を「8バイト」で除することにより、8バイト単位で分割して処理できるデータの個数「37」を算出する。次に、生成部303は、8バイト単位で分割して処理できるデータの個数「37」を示すために、5ビットで個数が「31」より多いことを示すデータ「11111(32)」を生成する。そして、生成部303は、8ビットで「31」から「37」までの不足分である「6」を示すことにより、個数「37」を示すデータ「00000101(31+6=37)」を生成する。
Then, the
次に、生成部303は、参照先データrdF「compression」のデータ長から、算出した個数分の「8バイト」を減じて、端数データ長「7」を算出する。次に、生成部303は、1バイト単位で処理すべき端数データ長「7」を示すデータ「111(7)」を生成する。そして、生成部303は、生成したデータを連結した圧縮データcdF「0010001100000(1120)111(10)11111(32)111(7)00000101(37)」を生成する。また、生成部303は、圧縮したことを示す判別ビットbF「1」を生成する。
Next, the
図3に戻り、保存部304は、後続データを生成された圧縮データに置換したデータ列を保存する。保存部304は、具体的には、例えば、圧縮元データ列dsBのうち圧縮元データを圧縮データに置換した圧縮データ列を生成する。次に、保存部304は、判別ビット列と圧縮データ列とを保存する。判別ビット列と圧縮データ列との保存例については、図15に後述する。
Returning to FIG. 3, the
保存部304は、具体的には、例えば、図2に示したROM202、RAM203、磁気ディスク205、光ディスク207などの記憶装置に記憶されたプログラムをプロセッサ201に実行させることにより、その機能を実現する。これにより、保存部304は、データ列のメモリサイズを小さくすることができる。結果として、情報処理装置100は、データ列を保存する場合に、圧縮せずに保存する場合と比べて、使用する記憶領域のサイズを低減することができる。また、情報処理装置100は、データ列を他のコンピュータに送信する場合に、データ列を圧縮してから送信することにより、送信時間を短縮することができる。
Specifically, the
(データ列の圧縮の流れ)
次に、図9〜図14を用いて、実施例1にかかる情報処理装置100によるデータ列の圧縮の流れについて説明する。
(Data stream compression flow)
Next, the flow of data string compression by the
図9〜図14は、実施例1にかかる情報処理装置100によるデータ列の圧縮の流れを示す説明図である。図9において、まず、情報処理装置100は、情報処理装置100の利用者によるキーボード210やマウス211などの入力装置の操作により、圧縮元データ列dsBを入力する。次に、情報処理装置100は、入力された圧縮元データ列dsBを、入力バッファに格納する。
9 to 14 are explanatory diagrams illustrating a flow of data string compression by the
そして、情報処理装置100は、入力バッファに格納された圧縮元データ列dsBの先頭に圧縮ポインタ900を設定する。次に、情報処理装置100は、判別ビット列を格納する判別バッファ910と、圧縮データ列を格納する圧縮バッファ920と、を設定する。そして、情報処理装置100は、圧縮元データ列dsBの圧縮を開始する。
Then, the
図9において、(21)情報処理装置100は、圧縮ポインタ900が示す位置から始まる「3バイト」のデータ「com」を取得する。次に、情報処理装置100は、圧縮ポインタ900が示す位置よりも先頭側から、取得したデータ「com」と同一データになる先行データを探索する。
In FIG. 9, (21) the
ここで、情報処理装置100は、具体的には、例えば、図5に示した探索テーブル500を参照して、圧縮ポインタ900が示す位置に対応する先行データの位置情報「0」を取得する。次に、情報処理装置100は、位置情報が「0」であるため、圧縮ポインタ900が示す位置から始まるデータ「com」と同一データになる先行データがなく、データ「com」が圧縮できないと判定する。
Here, specifically, for example, the
(22)そして、情報処理装置100は、圧縮ポインタ900が示す位置にあるデータ「c」を圧縮できなかったデータとして、そのまま、圧縮バッファ920に格納する。(23)また、情報処理装置100は、圧縮ポインタ900が示す位置にあるデータ「c」を圧縮できなかったことを示す判別ビット「0」を判別バッファ910に格納する。
(22) The
次に、情報処理装置100は、圧縮ポインタ900を「1バイト」分、末尾側にシフトして、図10の処理に移行する。
Next, the
図10において、(24)情報処理装置100は、図9と同様にして、圧縮ポインタ900が示す位置から始まる「3バイト」のデータ「omp」を取得する。次に、情報処理装置100は、圧縮ポインタ900が示す位置よりも先頭側から、取得したデータ「omp」と同一データになる先行データを探索する。そして、情報処理装置100は、圧縮ポインタ900が示す位置から始まるデータ「omp」と同一データになる先行データがないため、データ「omp」が圧縮できないと判定する。
10, (24) the
(25)次に、情報処理装置100は、圧縮ポインタ900が示す位置にあるデータ「o」を圧縮できなかったデータとして、そのまま、圧縮バッファ920に格納する。(26)また、情報処理装置100は、圧縮ポインタ900が示す位置にあるデータ「o」を圧縮できなかったことを示す判別ビット「0」を判別バッファ910に格納する。
(25) Next, the
次に、情報処理装置100は、圧縮ポインタ900を「1バイト」分、末尾側にシフトして、図11の処理に移行する。
Next, the
図11において、(27)情報処理装置100は、図9と同様にして、圧縮ポインタ900が示す位置から始まる「3バイト」のデータ「mpr」を取得する。次に、情報処理装置100は、圧縮ポインタ900が示す位置よりも先頭側から、取得したデータ「mpr」と同一データになる先行データを探索する。そして、情報処理装置100は、圧縮ポインタ900が示す位置から始まるデータ「mpr」と同一データになる先行データがないため、データ「mpr」が圧縮できないと判定する。
In FIG. 11, (27) the
(28)次に、情報処理装置100は、圧縮ポインタ900が示す位置にあるデータ「m」を圧縮できなかったデータとして、そのまま、圧縮バッファ920に格納する。(29)また、情報処理装置100は、圧縮ポインタ900が示す位置にあるデータ「m」を圧縮できなかったことを示す判別ビット「0」を判別バッファ910に格納する。
(28) Next, the
以降、情報処理装置100は、図9〜図11と同様にして、圧縮元データの「4バイト目」〜「14バイト目」の各々の位置にあるデータを圧縮せずに圧縮バッファ920に格納したとする。次に、情報処理装置100は、圧縮ポインタ900を「1バイト」分、末尾側にシフトして、図12の処理に移行する。
Thereafter, the
図12において、(30)情報処理装置100は、圧縮ポインタ900が示す位置から始まる「3バイト」のデータ「com」を取得する。次に、情報処理装置100は、圧縮ポインタ900が示す位置よりも先頭側から、取得したデータ「com」と同一データになる先行データを探索する。
In FIG. 12, (30) the
ここで、情報処理装置100は、具体的には、例えば、図5に示した探索テーブル500を参照して、圧縮ポインタ900が示す位置に対応する先行データの位置情報「14」を取得する。次に、情報処理装置100は、位置情報が「14」であるため、圧縮ポインタ900が示す位置から始まるデータ「com」と同一データになる先行データが「14バイト前」にあると判定する。そのため、情報処理装置100は、「com」を圧縮できると判定する。
Here, specifically, for example, the
ここで、情報処理装置100は、「com」より末尾側のデータも、「com」とまとめて圧縮できるか否かを判定する。情報処理装置100は、具体的には、例えば、圧縮ポインタ900が示す位置より「1バイト分」末尾側の位置に対応する先行データの位置情報「14」を取得する。
Here, the
ここで、取得した先行データの位置情報「14」は、圧縮ポインタ900が示す位置に対応する先行データの位置情報「14」と同一である。そのため、情報処理装置100は、圧縮ポインタ900が示す位置にあるデータ「com」とまとめて、圧縮ポインタ900が示す位置より「1バイト分」末尾側の位置にある「omp」を圧縮できると判定する。
Here, the acquired position information “14” of the preceding data is the same as the position information “14” of the preceding data corresponding to the position indicated by the
換言すれば、情報処理装置100は、圧縮ポインタ900が示す位置から始まる「4バイト」のデータ「comp」を、「14バイト前」にある先行データ「comp」を使用して、圧縮できると判定する。
In other words, the
そして、情報処理装置100は、同様にして、圧縮ポインタ900が示す位置から始まる「8バイト」のデータ「compress」を、「14バイト前」にある先行データ「compress」を使用して、圧縮できると判定する。
Similarly, the
次に、情報処理装置100は、参照先データの相対位置を示す「13ビット」のデータ「0000000001110(14)」を生成する。また、情報処理装置100は、参照先データのデータ長を示す「3ビット」のデータ「101(8)」を生成する。次に、情報処理装置100は、生成したデータを連結した圧縮データ「0000000001110(14)101(8)」を生成する。以降、圧縮データ「0000000001110(14)101(8)」を、圧縮データ「14,8」と表す。
Next, the
(31)そして、情報処理装置100は、圧縮ポインタ900が示す位置から始まるデータ「compress」の代わりに、圧縮データ「14,8」を圧縮バッファ920に格納する。(32)また、情報処理装置100は、圧縮ポインタ900が示す位置から始まるデータ「compress」を圧縮したことを示す判別ビット「1」を判別バッファ910に格納する。
(31) The
次に、情報処理装置100は、圧縮ポインタ900を、圧縮したデータのデータ長である「8バイト分」、末尾側にシフトして、図9〜図11と同様にして、圧縮元データの「23バイト目」の位置にあるデータ「 (空白)」を圧縮せずに圧縮バッファ920に格納したとする。そして、情報処理装置100は、圧縮ポインタ900を「1バイト分」、末尾側にシフトしたとして、図13の処理に移行する。
Next, the
図13において、(33)情報処理装置100は、圧縮ポインタ900が示す位置から始まる「3バイト」のデータ「com」を取得する。次に、情報処理装置100は、圧縮ポインタ900が示す位置よりも先頭側から、取得したデータ「com」と同一データになる先行データを探索する。
In FIG. 13, (33) the
ここで、情報処理装置100は、図12と同様にして、圧縮ポインタ900が示す位置から始まる「11バイト」のデータ「compression」を、「23バイト前」にある先行データ「compression」を使用して、圧縮できると判定する。
Here, as in FIG. 12, the
次に、情報処理装置100は、参照先データの相対位置を示す「13ビット」のデータ「0000000010111(23)」を生成する。そして、情報処理装置100は、参照先データのデータ長が9バイトより長いことを示す「3ビット」のデータ「111(10)」を生成する。
Next, the
次に、情報処理装置100は、参照先データのデータ長が「11バイト」であるため、8バイト単位で分割して処理できるデータの個数「1」を示すデータ「00000(1)」を生成する。そして、情報処理装置100は、参照先データを8バイト単位でまとめて処理した後に、1バイト単位で処理すべき端数データ長「3バイト」を示すデータ「011(3)」を生成する。次に、情報処理装置100は、生成したデータを連結した圧縮データ「0000000010111(23)111(10)00000(1)011(3)」を生成する。以降、圧縮データ「0000000010111(23)111(10)00000(1)011(3)」を、圧縮データ「23,1,3」と表す。
Next, since the data length of the reference destination data is “11 bytes”, the
(34)そして、情報処理装置100は、圧縮ポインタ900が示す位置から始まるデータ「compression」の代わりに、圧縮データ「23,1,3」を圧縮バッファ920に格納する。(35)また、情報処理装置100は、圧縮ポインタ900が示す位置から始まるデータ「compression」を圧縮したことを示す判別ビット「1」を判別バッファ910に格納する。
(34) The
次に、情報処理装置100は、圧縮ポインタ900を、圧縮したデータのデータ長である「11バイト分」、末尾側にシフトして、図9〜図11と同様にして、圧縮元データの「34バイト目」の位置にあるデータ「.」を圧縮せずに圧縮バッファ920に格納したとする。
Next, the
図9〜図13を用いて説明した処理により圧縮された圧縮データ列を図14に示す。図14に示すように、判別バッファ910に格納されていた判別ビット列bsGは「18ビット」である。また、圧縮バッファ920に格納されていた圧縮データ列cdsGは「21バイト」である。
FIG. 14 shows a compressed data string compressed by the processing described with reference to FIGS. As shown in FIG. 14, the discrimination bit string bsG stored in the
従って、情報処理装置100は、「35バイト」の圧縮元データ列dsBを、「18ビット」の判別ビット列bsGと、「21バイト」の圧縮データ列cdsGと、に変換したことになる。換言すれば、情報処理装置100は、データ列のデータ長を、「(35バイト)−(21バイト+18ビット)=(11バイト+6ビット)」のデータ長分、低減することができる。
Therefore, the
このように、情報処理装置100は、データ列のサイズを低減することができる。結果として、情報処理装置100は、データ列を保存する場合に、圧縮せずに保存する場合と比べて、使用する記憶領域のサイズを低減することができる。また、情報処理装置100は、データ列を他のコンピュータに送信する場合に、データ列を圧縮してから送信することにより、送信時間を短縮することができる。
Thus, the
(判別ビット列および圧縮データ列の保存例)
次に、図15を用いて、図14に示した判別ビット列bsGおよび圧縮データ列cdsGを記憶装置に保存する場合の保存例について説明する。ここで、記憶装置とは、例えば、図2に示したROM202、RAM203、磁気ディスク205、光ディスク207などである。
(Example of saving discrimination bit string and compressed data string)
Next, a storage example in the case where the determination bit string bsG and the compressed data string cdsG illustrated in FIG. 14 are stored in the storage device will be described with reference to FIG. Here, the storage device is, for example, the
図15は、図7〜図14に示した判別ビット列bsGおよび圧縮データ列cdsGの保存例を示す説明図である。図15(A)は、判別ビット列bsGおよび圧縮データ列cdsGの保存例1を示す。図15(B)は、判別ビット列bsGおよび圧縮データ列cdsGの保存例2を示す。図15(C)は、判別ビット列bsGおよび圧縮データ列cdsGの保存例3を示す。 FIG. 15 is an explanatory diagram illustrating a storage example of the discrimination bit string bsG and the compressed data string cdsG illustrated in FIGS. 7 to 14. FIG. 15A shows a storage example 1 of the discrimination bit string bsG and the compressed data string cdsG. FIG. 15B shows a storage example 2 of the discrimination bit string bsG and the compressed data string cdsG. FIG. 15C shows a storage example 3 of the discrimination bit string bsG and the compressed data string cdsG.
図15(A)に示すように、情報処理装置100は、例えば、記憶装置の先頭にあるアドレス幅の区間に、判別ビット列bsGをまとめて保存し、後続のアドレス幅の区間に圧縮データ列cdsGをまとめて保存することができる。また、情報処理装置100は、例えば、保存した判別ビット列bsGの末尾にパディングを格納して、アドレス幅単位のデータ列に調整してもよいし、保存した圧縮データ列cdsGの末尾にパディングを格納して、アドレス幅単位のデータ列に調整してもよい。
As shown in FIG. 15A, for example, the
具体的には、例えば、記憶装置には、「判別ビット列bsG→パディング→圧縮データ列cdsG→パディング」のような順に、判別ビット列bsGおよび圧縮データ列cdsGが保存される。情報処理装置100は、図15(A)のように保存することにより、判別ビット列bsGをまとめて書き込んだり読み出したりすることができる。
Specifically, for example, the determination bit string bsG and the compressed data string cdsG are stored in the storage device in the order of “determination bit string bsG → padding → compressed data string cdsG → padding”. The
図15(B)に示すように、情報処理装置100は、例えば、記憶装置の先頭から順に、各々の判別ビットを、各々の判別ビットに対応する非圧縮データまたは圧縮データの先頭に付与して、保存することができる。また、情報処理装置100は、例えば、保存したデータ列の末尾にパディングを格納して、保存したデータ列をバイト単位のデータに調整してもよい。
As shown in FIG. 15B, the
具体的には、例えば、記憶装置には、「判別ビット→非圧縮データ→判別ビット→非圧縮データ→…→判別ビット→圧縮データ→…→パディング」のような順に、判別ビット列bsGおよび圧縮データ列cdsGが保存される。情報処理装置100は、図15(B)のように保存することにより、復元に使用する順に判別ビット列bsGおよび圧縮データ列cdsGが並ぶため、復元において記憶装置の先頭アドレスから順にアクセスすればよく、ランダムアクセスを抑制することができる。
Specifically, for example, the determination bit string bsG and the compressed data are stored in the storage device in the order of “determination bit → uncompressed data → determination bit → uncompressed data →... → determination bit → compressed data →. The column cdsG is saved. The
図15(C)に示すように、情報処理装置100は、例えば、記憶装置の先頭から順に、「1バイト分」の判別ビット群を保存し、保存した判別ビット群の各々の判別ビットに対応する非圧縮データまたは圧縮データを判別ビット群の後続に保存することができる。また、情報処理装置100は、判別ビット群が「1バイト分」に足らない場合、判別ビット群の末尾にパディングを格納して、判別ビット群を「1バイト」に調整してもよい。
As illustrated in FIG. 15C, the
具体的には、例えば、記憶装置には、「1バイト分の判別ビット→8バイト分の非圧縮データや圧縮データ→…→2ビット分の判別ビットと6ビット分のパディング→2バイト分の非圧縮データや圧縮データ→…」のような順に、判別ビット列bsGおよび圧縮データ列cdsGが保存される。情報処理装置100は、図15(C)のように保存することにより、判別ビット、圧縮データ、および非圧縮データが格納されるアドレスを、バイト単位で区切られたアドレスにすることができる。そのため、情報処理装置100は、各データにアクセスする際、ビットシフトしなくてもよくなり、各データへのアクセスにかかる時間を低減することができる。
Specifically, for example, in the storage device, “1 byte determination bit → 8 bytes of uncompressed data or compressed data →... → 2 bits determination bit and 6 bits padding → 2 bytes The determination bit string bsG and the compressed data string cdsG are stored in the order of “uncompressed data and compressed data →. By saving the
(データ列圧縮処理)
次に、図16を用いて、図7〜図14に示したデータ列の圧縮を実現するデータ列圧縮処理の詳細な処理手順について説明する。
(Data string compression processing)
Next, a detailed processing procedure of the data string compression processing for realizing the compression of the data strings shown in FIGS. 7 to 14 will be described with reference to FIG.
図16は、図7〜図14に示したデータ列の圧縮を実現するデータ列圧縮処理の詳細な処理手順を示すフローチャートである。図16に示すように、情報処理装置100は、まず、入力バッファにある圧縮元データの中から、圧縮ポインタ900が示す位置にある後続データと同一データになる先行データを検出する(ステップS1601)。
FIG. 16 is a flowchart showing a detailed processing procedure of the data string compression processing for realizing the compression of the data string shown in FIGS. As shown in FIG. 16, the
次に、情報処理装置100は、先行データが検出されたか否かを判定する(ステップS1602)。ここで、先行データが検出されなかった場合(ステップS1602:No)、情報処理装置100は、圧縮しないことを示す判別ビット「0」を生成して、判別バッファ910に格納する(ステップS1603)。
Next, the
次に、情報処理装置100は、後続データの先頭1バイト分のデータを、そのまま、圧縮バッファ920に格納する(ステップS1604)。そして、情報処理装置100は、圧縮ポインタ900を「1バイト分」末尾側にシフトする(ステップS1605)。
Next, the
次に、情報処理装置100は、圧縮が終了したか否かを判定する(ステップS1606)。ここで、圧縮が終了した場合(ステップS1606:Yes)、情報処理装置100は、データ列圧縮処理を終了する。
Next, the
一方、圧縮が終了していない場合(ステップS1606:No)、情報処理装置100は、ステップS1601に戻る。以上のステップS1601〜ステップS1606を経由する処理により、情報処理装置100は、圧縮できないデータを処理する。
On the other hand, if the compression has not ended (step S1606: No), the
一方、ステップS1602において、先行データが検出された場合(ステップS1602:Yes)、情報処理装置100は、圧縮することを示す判別ビット「1」を生成して、判別バッファ910に格納する(ステップS1607)。
On the other hand, when preceding data is detected in step S1602 (step S1602: Yes), the
次に、情報処理装置100は、先行データのデータ長が9バイトより長いか否かを判定する(ステップS1608)。ここで、先行データのデータ長が9バイト以下の場合(ステップS1608:No)、情報処理装置100は、先行データの位置を示すデータと、先行データのデータ長を示すデータと、を生成して、圧縮バッファ920に格納する(ステップS1609)。
Next, the
次に、情報処理装置100は、圧縮ポインタ900を「先行データのデータ長分」末尾側にシフトする(ステップS1610)。そして、情報処理装置100は、ステップS1606に移行する。以上のステップS1601,S1602,S1607〜S1610,S1606を経由する処理により、情報処理装置100は、9バイト以下のデータ長であって圧縮可能なデータを圧縮する。
Next, the
一方、ステップS1608において、先行データのデータ長が9バイトより長い場合(ステップS1608:Yes)、情報処理装置100は、先行データの位置を示すデータと、先行データのデータ長が9バイトより長いことを示すデータと、を生成する。次に、情報処理装置100は、生成したデータを、圧縮バッファ920に格納する(ステップS1611)。
On the other hand, when the data length of the preceding data is longer than 9 bytes in step S1608 (step S1608: Yes), the
そして、情報処理装置100は、先行データのデータ長をレジスタ幅で除した商と剰余とを算出し、算出した商を示すデータと、算出した剰余を示すデータと、を生成して、圧縮バッファ920に格納する(ステップS1612)。
Then, the
次に、情報処理装置100は、ステップS1610に移行する。以上のステップS1601,S1602,S1607,S1608,S1611,S1612,S1610,S1606を経由する処理により、情報処理装置100は、9バイトより長いデータ長であって圧縮可能なデータを圧縮する。
Next, the
これにより、情報処理装置100は、圧縮元データの復元において、参照先データをレジスタ幅単位で分割して処理できるデータの個数と、1バイト単位で処理すべき端数バイトと、が特定できるように圧縮データを生成することができる。
As a result, the
(実施例1にかかる情報処理装置100による圧縮元データ列dsBの復元)
次に、実施例1にかかる情報処理装置100による圧縮元データ列dsBの復元について、図17〜図23に示す。
(Restoration of the compression source data string dsB by the
Next, decompression of the compression source data string dsB by the
(実施例1にかかる情報処理装置100の圧縮元データ列dsBの復元に関する機能的構成例)
まず、図17を用いて、実施例1にかかる情報処理装置100の圧縮元データ列dsBの復元に関する機能的構成例について説明する。図17は、実施例1にかかる情報処理装置100の圧縮元データ列dsBの復元に関する機能的構成例を示すブロック図である。情報処理装置100は、記憶部1701と、検出部1702と、取得部1703と、格納部1704と、を含む構成である。
(Functional configuration example relating to decompression of the compression source data string dsB of the
First, a functional configuration example relating to the decompression of the compression source data string dsB of the
記憶部1701は、参照先となる非圧縮データの参照位置、所定長以上である非圧縮データの長さを所定長で除した商および剰余を有する圧縮データと、非圧縮データとを含む圧縮データ列を記憶する。参照先となる非圧縮データとは、例えば、上述した参照先データである。所定長とは、2の冪乗になるレジスタ幅であり、例えば、上述した8バイトである。
The
圧縮データは、例えば、参照先データの相対位置「14」を示すデータ「0000000001110(14)」を有する。また、圧縮データは、例えば、参照先データが10バイト以上であることを示すデータ「111(10)」を有する。また、圧縮データは、例えば、8バイト単位で分割して処理できるデータの個数「1」を示すデータ「00000(1)」、および1バイト単位で処理すべき端数データ長「3」を示すデータ「011(3)」を有する。 The compressed data includes, for example, data “0000000001110 (14)” indicating the relative position “14” of the reference destination data. The compressed data includes, for example, data “111 (10)” indicating that the reference destination data is 10 bytes or more. The compressed data includes, for example, data “00000 (1)” indicating the number of data “1” that can be divided and processed in units of 8 bytes, and data indicating the fraction data length “3” to be processed in units of 1 byte. “011 (3)”.
記憶部1701は、具体的には、例えば、圧縮データと非圧縮データとを含む圧縮データ列、および判別ビット列を記憶する。記憶部1701は、具体的には、例えば、図2に示したROM202、RAM203、磁気ディスク205、光ディスク207などの記憶装置により、その機能を実現する。これにより、検出部1702は、記憶部1701に記憶された圧縮データ列および判別ビット列を取得することができる。
Specifically, the
検出部1702は、記憶部1701の中から、圧縮データを検出する。検出部1702は、具体的には、例えば、判別ビット列の中から判別ビットを取得し、取得した判別ビットに対応するデータが非圧縮データか圧縮データかを判定する。
The
次に、検出部1702は、圧縮データと判定された場合、判別ビットに対応する「1バイト分」のデータ「0000000001110(14)111(10)」を検出する。ここで、検出部1702は、検出したデータの末尾「3ビット」が参照先データのデータ長が「9バイト」より長いことを示す「111(10)」であるため、後続の「1バイト分」のデータ「00000(1)011(3)」をさらに検出する。
Next, when it is determined that the data is compressed data, the
このように、検出部1702は、圧縮データ「0000000001110(14)111(10)00000(1)011(3)」を検出する。検出部1702は、具体的には、例えば、図2に示したROM202、RAM203、磁気ディスク205、光ディスク207などの記憶装置に記憶されたプログラムをプロセッサ201に実行させることにより、その機能を実現する。これにより、取得部1703は、検出部1702によって検出された圧縮データを使用して、参照先データを取得することができる。
In this manner, the
取得部1703は、検出された圧縮データに含まれている参照位置から始まる参照先データのうち、所定長に商を乗じた長さとなる第1のデータ列を所定長単位で取得する。また、取得部1703は、参照先データから第1のデータ列を除いた剰余分の長さとなる第2のデータ列を取得する。
The
取得部1703は、具体的には、例えば、圧縮データ内の「0000000001110(14)」から、参照先データの位置が圧縮データの位置より「14バイト分」先頭側の位置であることを特定する。
Specifically, the
次に、取得部1703は、特定した位置から始まる参照先データのうち、「8バイト」に圧縮データ内の「00000(1)」が示す商を乗じた「8バイト分」のデータを、「8バイト単位」でまとめて取得する。また、取得部1703は、圧縮データ内の「011(3)」が示す剰余分の「3バイト分」のデータを、「1バイト」ごとに取得する。
Next, the
また、圧縮を実行した他のプロセッサのレジスタ幅が、情報処理装置100のプロセッサ201のレジスタ幅の倍数である場合がある。この場合、取得部1703は、検出された圧縮データに含まれている参照位置から始まる参照先データの先頭から順に、第1のデータ列と、所定長の倍数に商を乗じた長さとなる所定長単位の第2のデータ列と、第3のデータ列と、を取得してもよい。
In addition, the register width of another processor that has performed compression may be a multiple of the register width of the
取得部1703は、具体的には、例えば、図2に示したROM202、RAM203、磁気ディスク205、光ディスク207などの記憶装置に記憶されたプログラムをプロセッサ201に実行させることにより、その機能を実現する。これにより、取得部1703は、圧縮データと置換すべき参照先データを格納部1704に送ることができる。
Specifically, the
格納部1704は、所定長単位で取得された第1のデータ列を所定の記憶領域に書き込むとともに、取得された第2のデータ列を所定の記憶領域に書き込む。格納部1704は、具体的には、例えば、参照先データ「compression」のうち、「8バイト単位」で取得した「compress」を復元バッファに格納し、取得した「3バイト分」の「ion」を復元バッファに格納する。
The
格納部1704は、具体的には、例えば、図2に示したROM202、RAM203、磁気ディスク205、光ディスク207などの記憶装置に記憶されたプログラムをプロセッサ201に実行させることにより、その機能を実現する。これにより、格納部1704は、圧縮データを参照先データの複製データと置換することができ、圧縮元データを復元することができる。
Specifically, the
また、格納部1704は、検出部1702によって非圧縮データと判定されたデータを、そのまま、復元バッファに格納する。これにより、格納部1704は、参照先データになる可能性がある非圧縮データを復元バッファに格納しておくことができる。
The
(圧縮元データ列dsBの復元の流れ)
次に、図18〜図23を用いて、実施例1にかかる情報処理装置100による圧縮元データ列dsBの復元の流れについて説明する。
(Flow of decompression of compression source data string dsB)
Next, the flow of decompression of the compression source data string dsB by the
図18〜図23は、実施例1にかかる情報処理装置100による圧縮元データ列dsBの復元の流れを示す説明図である。図18において、まず、情報処理装置100は、判別ビット列の先頭に判別ポインタ1810を設定する。次に、情報処理装置100は、圧縮データ列の先頭に復元ポインタ1820を設定する。そして、情報処理装置100は、復元した圧縮元データ列dsBを格納する復元バッファ1800を設定する。
18 to 23 are explanatory diagrams illustrating a flow of decompression of the compression source data string dsB by the
図18において、(41)情報処理装置100は、判別ポインタ1810が示す位置にある判別ビットを検出する。(42)次に、情報処理装置100は、検出した判別ビットが「0」であるため、復元ポインタ1820が示す位置にあるデータが非圧縮データであると判定して、復元ポインタ1820が示す位置にあるデータ「c」を取得する。
18, (41) the
(43)そして、情報処理装置100は、取得した非圧縮データ「c」を、そのまま、復元バッファ1800に格納する。次に、情報処理装置100は、判別ポインタ1810を「1ビット分」末尾側にシフトして、復元ポインタ1820を「1バイト分」末尾側にシフトして、図19の処理に移行する。
(43) The
図19において、(44)情報処理装置100は、図18と同様にして、判別ポインタ1810が示す位置にある判別ビットを検出する。(45)次に、情報処理装置100は、検出した判別ビットが「0」であるため、復元ポインタ1820が示す位置にあるデータが非圧縮データであると判定して、復元ポインタ1820が示す位置にあるデータ「o」を取得する。
19, (44) the
(46)そして、情報処理装置100は、取得した非圧縮データ「o」を、そのまま、復元バッファ1800に格納する。次に、情報処理装置100は、判別ポインタ1810を「1ビット分」末尾側にシフトして、復元ポインタ1820を「1バイト分」末尾側にシフトして、図20の処理に移行する。
(46) The
図20において、(47)情報処理装置100は、図18と同様にして、判別ポインタ1810が示す位置にある判別ビットを検出する。(48)次に、情報処理装置100は、検出した判別ビットが「0」であるため、復元ポインタ1820が示す位置にあるデータが非圧縮データであると判定して、復元ポインタ1820が示す位置にあるデータ「m」を取得する。
20, (47) the
(49)そして、情報処理装置100は、取得した非圧縮データ「m」を、そのまま、復元バッファ1800に格納する。以降、情報処理装置100は、図18〜図20と同様にして、圧縮データの「1バイト目」〜「14バイト目」の各々の位置にあるデータを、そのまま、復元バッファ1800に格納したとする。次に、情報処理装置100は、判別ポインタ1810を「1ビット分」末尾側にシフトして、復元ポインタ1820を「1バイト分」末尾側にシフトして、図21の処理に移行する。
(49) The
図21において、(50)情報処理装置100は、判別ポインタ1810が示す位置にある判別ビットを検出する。(51)次に、情報処理装置100は、検出した判別ビットが「1」であるため、復元ポインタ1820が示す位置にあるデータが圧縮データであると判定して、復元ポインタ1820が示す位置にあるデータ「14,8」を取得する。
In FIG. 21, (50) the
(52)そして、情報処理装置100は、取得した圧縮データ「14,8」を参照して、参照先データが圧縮データより「14バイト前」にあると判定する。次に、情報処理装置100は、取得した圧縮データ「14,8」を参照して、「8バイト分」の参照先データを、1バイト単位で取得して、復元バッファ1800に格納する。
(52) The
次に、情報処理装置100は、判別ポインタ1810を「1バイト分」末尾側にシフトして、復元ポインタ1820を圧縮データのデータ長である「2バイト分」末尾側にシフトしたとする。そして、情報処理装置100は、図18〜図20と同様にして、復元ポインタ1820が示す位置にある非圧縮データ「 (空白)」を復元バッファ1800に格納したとする。次に、情報処理装置100は、判別ポインタ1810を「1ビット分」末尾側にシフトして、復元ポインタ1820を「1バイト分」末尾側にシフトして、図22の処理に移行する。
Next, it is assumed that the
図22において、(53)情報処理装置100は、判別ポインタ1810が示す位置にある判別ビットを検出する。(54)次に、情報処理装置100は、検出した判別ビットが「1」であるため、復元ポインタ1820が示す位置にあるデータが圧縮データであると判定して、復元ポインタ1820が示す位置にあるデータ「23,1,3」を取得する。
22, (53) the
(55)そして、情報処理装置100は、取得した圧縮データ「23,1,3」を参照して、参照先データが圧縮データより「23バイト前」にあると判定する。次に、情報処理装置100は、取得した圧縮データ「23,1,3」を参照して、参照先データを、「8バイト単位」で分割して処理できるデータの個数が「1回」であると特定する。そして、情報処理装置100は、参照先データを先頭から、1回目の「8バイト分」のデータ「compress」を取得して、復元バッファ1800に格納する。
(55) The
次に、情報処理装置100は、取得した圧縮データ「23,1,3」を参照して、参照先データを、「1バイト単位」で処理すべき端数データ長が「3バイト」であると特定する。そして、情報処理装置100は、参照先データからデータ「compress」を取得して残ったデータ「ion」を、1バイト単位で取得して、復元バッファ1800に格納する。
Next, the
次に、情報処理装置100は、判別ポインタ1810を「1バイト分」末尾側にシフトして、復元ポインタ1820を圧縮データのデータ長である「3バイト分」末尾側にシフトしたとする。そして、情報処理装置100は、図18〜図20と同様にして、復元ポインタ1820が示す位置にある非圧縮データ「.」を復元バッファ1800に格納したとする。
Next, it is assumed that the
図18〜図22を用いて説明した処理により復元された圧縮元データ列dsBを図23に示す。図23に示すように、情報処理装置100は、圧縮元データ列dsBを、損失なく、復元バッファ1800に復元することができる。
FIG. 23 shows the compression source data string dsB restored by the processing described with reference to FIGS. As illustrated in FIG. 23, the
このように、情報処理装置100は、圧縮元データ列dsBの復元において、8バイト単位で取得可能な参照先データがあれば、8バイト単位で取得して復元バッファ1800に格納する。これにより、情報処理装置100は、レジスタ幅を有効活用して、圧縮元データ列dsBの復元にかかる時間を短縮することができる。
In this way, in the decompression of the compression source data string dsB, the
(圧縮元データ列復元処理)
次に、図24を用いて、図18〜図23に示した圧縮元データ列dsBの復元を実現する圧縮元データ列復元処理の詳細な処理手順について説明する。
(Compression source data string restoration processing)
Next, with reference to FIG. 24, a detailed processing procedure of the compression source data sequence decompression processing for realizing the decompression of the compression source data sequence dsB illustrated in FIGS. 18 to 23 will be described.
図24は、図18〜図23に示した圧縮元データ列dsBの復元を実現する圧縮元データ列復元処理の詳細な処理手順を示すフローチャートである。図24に示すように、情報処理装置100は、まず、判別ポインタ1810が示す位置にある判別ビットを取得する(ステップS2401)。
FIG. 24 is a flowchart showing a detailed processing procedure of the compression source data sequence decompression processing for realizing the decompression of the compression source data sequence dsB shown in FIGS. As shown in FIG. 24, the
次に、情報処理装置100は、取得した判別ビットを参照して、復元ポインタ1820が示す位置にあるデータが圧縮データか否かを判定する(ステップS2402)。ここで、非圧縮データである場合(ステップS2402:No)、情報処理装置100は、復元ポインタ1820が示す位置にある1バイトのデータを取得して、復元バッファ1800に格納する(ステップS2403)。
Next, the
次に、情報処理装置100は、判別ポインタ1810を「1バイト分」末尾側にシフトし、復元ポインタ1820を「1バイト分」末尾側にシフトする(ステップS2404)。そして、情報処理装置100は、復元が終了したか否かを判定する(ステップS2405)。ここで、復元が終了した場合(ステップS2405:Yes)、情報処理装置100は、圧縮元データ列復元処理を終了する。
Next, the
一方、復元が終了していない場合(ステップS2405:No)、情報処理装置100は、ステップS2401に戻る。以上のステップS2401〜S2405を経由する処理により、情報処理装置100は、非圧縮データを処理する。
On the other hand, when the restoration is not completed (step S2405: No), the
一方、ステップS2402において、圧縮データである場合(ステップS2402:Yes)、情報処理装置100は、圧縮データを参照して、参照先データの位置と、参照先データのデータ長と、を取得する(ステップS2406)。
On the other hand, if it is compressed data in step S2402 (step S2402: Yes), the
次に、情報処理装置100は、取得した参照先データのデータ長が9バイトより長いか否かを判定する(ステップS2407)。ここで、参照先データのデータ長が9バイト以下の場合(ステップS2407:No)、情報処理装置100は、参照先データの位置から、参照先データのデータ長分のデータを、1バイト単位で取得して、復元バッファ1800に格納する(ステップS2408)。
Next, the
次に、情報処理装置100は、判別ポインタ1810を「1バイト分」末尾側にシフトし、復元ポインタ1820を「圧縮データのデータ長分」末尾側にシフトする(ステップS2409)。そして、情報処理装置100は、ステップS2405に移行する。
Next, the
以上のステップS2401,S2402,S2406〜S2409,S2405を経由する処理により、情報処理装置100は、9バイト以下のデータ長である圧縮元データを復元する。
The
一方、参照先データのデータ長が9バイトより長い場合(ステップS2407:Yes)、情報処理装置100は、取得した圧縮データを参照して、参照先データを、「8バイト単位」で分割して処理できるデータの個数を特定する。次に、情報処理装置100は、参照先データを、先頭から、特定した個数分の「8バイト分」のデータを取得して、復元バッファ1800に格納する(ステップS2410)。
On the other hand, when the data length of the reference destination data is longer than 9 bytes (step S2407: Yes), the
次に、情報処理装置100は、取得した圧縮データを参照して、参照先データを、「1バイト単位」で処理すべき端数データ長を特定する。そして、情報処理装置100は、参照先データから個数分の「8バイト分」のデータを取得して残ったデータを、先頭から、1バイト単位で取得して、復元バッファ1800に格納する(ステップS2411)。
Next, the
次に、情報処理装置100は、判別ポインタ1810を「1バイト分」末尾側にシフトし、復元ポインタ1820を「圧縮データのデータ長分」末尾側にシフトする(ステップS2412)。そして、情報処理装置100は、ステップS2405に移行する。
Next, the
以上のステップS2401,S2402,S2406,S2407,S2410〜S2412,S2405を経由する処理により、情報処理装置100は、9バイトより長いデータ長である圧縮元データを復元する。
The
以上説明したように、情報処理装置100は、圧縮データに対応する参照先データを、圧縮データを参照して、レジスタ幅単位で分割して取得し、レジスタ幅単位で分割して取得しきれなかったデータを1バイト単位で分割して取得する。このように、情報処理装置100は、プロセッサ201によりレジスタ幅分の非圧縮な参照先データをまとめて処理することにより、レジスタ幅分のデータを1バイトずつ順次処理するよりも、短時間で処理を終了することができる。これにより、情報処理装置100は、レジスタ幅を効率的に活用して参照先データを処理することができ、データ復元の高速化を図ることができる。
As described above, the
また、圧縮を実行した他のプロセッサのレジスタ幅が、情報処理装置100のプロセッサ201のレジスタ幅の倍数である場合がある。この場合、情報処理装置100は、圧縮データが示すレジスタ幅単位で分割して取得できるデータの個数に、情報処理装置100のプロセッサ201のレジスタ幅に対する圧縮を実行した他のプロセッサのレジスタ幅の割合を乗じた個数を算出してもよい。そして、情報処理装置100は、参照先データのうち、算出した個数分にレジスタ幅単位で分割したデータを取得し、レジスタ幅単位で分割して取得しきれなかったデータを1バイト単位で分割して取得する。これにより、圧縮を実行した他のプロセッサのレジスタ幅と、情報処理装置100のプロセッサ201のレジスタ幅と、が異なる場合でもデータ復元が可能になる。
In addition, the register width of another processor that has performed compression may be a multiple of the register width of the
また、情報処理装置100は、圧縮元データと同一のデータになる参照先データを検出し、圧縮元データを参照先データの位置と参照先データのうちレジスタ幅単位で分割して取得できるデータの個数と端数データ長とを示す圧縮データに圧縮する。これにより、圧縮データを復元するプロセッサ201が、圧縮データを参照して、データを復元することが可能になる。具体的には、例えば、プロセッサ201は、参照先データのうち、レジスタ幅単位で分割したデータを取得し、レジスタ幅単位で分割して取得しきれなかった残りのデータを1バイト単位で分割して取得することにより、データを復元することができる。また、情報処理装置100は、参照先データのデータ長を8の倍数で表すことにより、参照先データのデータ長をそのまま表した場合に比べて、248バイト以上の参照先データに関しての圧縮効率を向上させることができる。
In addition, the
また、復元を実行する他のプロセッサのレジスタ幅が情報処理装置100のレジスタ幅の倍数である場合がある。この場合、情報処理装置100は、圧縮元データを、参照先データの位置と、参照先データのうち当該レジスタ幅の倍数単位で分割して取得できるデータの個数と端数データ長とを示す圧縮データに圧縮する。これにより、復元を実行する他のプロセッサのレジスタ幅と、情報処理装置100のプロセッサ201のレジスタ幅と、が異なる場合でもデータ圧縮が可能になる。
In addition, the register width of another processor that executes restoration may be a multiple of the register width of the
・実施例2
次に、実施例2について説明する。実施例1では、情報処理装置100は、参照先データから取得したレジスタ幅のデータを格納する復号バッファ内の領域が、アラインされて区切られた区間か否かに関わらず格納している。これに対し、実施例2では、情報処理装置100は、参照先データから取得したレジスタ幅のデータを格納する復号バッファ内の領域が、アラインされて区切られた区間になるようにする。
Example 2
Next, Example 2 will be described. In the first embodiment, the
そのため、実施例2では、圧縮データは、参照先データから、圧縮元データを復元するプロセッサ201により取得される先頭側のデータを除いた残りのデータのうち、8バイト単位で分割して取得されるべきデータの個数を示すデータである。ここで、参照先データのうち、先頭側のデータとは、復元バッファ内の書込先位置からアラインされて区切られた区間の末尾の位置までの空き領域を埋めるために使用されるデータである。
Therefore, in the second embodiment, the compressed data is acquired by dividing the reference data from the reference destination data in units of 8 bytes out of the remaining data excluding the head data acquired by the
これにより、情報処理装置100は、復元バッファ内の書込先位置がアラインされた区間の先頭の位置になるまでは、参照先データの先頭から1バイト単位で取得して復元バッファに格納していく。そして、情報処理装置100は、復元バッファ内の書込先位置がアラインされた区間の先頭の位置になると、レジスタ幅単位のデータを取得して、レジスタ幅分のデータ長であるアラインされた区間に、過不足なく格納することができる。
As a result, the
換言すれば、情報処理装置100は、レジスタ幅単位のデータを格納する際に、アラインされた位置を跨いで格納することがなくなる。そのため、情報処理装置100は、レジスタ幅単位のデータを格納する際の復元バッファへのアクセス回数を低減することができ、データ復元の高速化を図ることができる。
In other words, the
<実施例2にかかる情報処理装置100によるデータ列の圧縮>
以降では、まず、実施例2にかかる情報処理装置100によるデータ列の圧縮について、図25〜図35に示す。また、実施例2にかかる情報処理装置100による圧縮元データ列dsBの復元については、後述する図36〜図43に示す。
<Compression of Data Sequence by
In the following, first, data string compression performed by the
(実施例2にかかる情報処理装置100のデータ列の圧縮に関する機能的構成例)
まず、図25を用いて、実施例2にかかる情報処理装置100のデータ列の圧縮に関する機能的構成例について説明する。図25は、実施例2にかかる情報処理装置100のデータ列の圧縮に関する機能的構成例を示すブロック図である。情報処理装置100は、記憶部2502と、検出部2503と、特定部2501と、生成部2504と、保存部2505と、を含む構成である。
(Functional configuration example regarding compression of data string of
First, an example of a functional configuration related to compression of a data string of the
ここで、情報処理装置100は、所定長のレジスタを有する。レジスタについては、図3を用いて説明したレジスタと同様のため、説明を省略する。情報処理装置100は、例えば、圧縮データを自装置で復元する場合、自装置のプロセッサ201のレジスタ幅に合わせてデータを圧縮する。また、情報処理装置100は、圧縮データを他装置で復元する場合、他装置のプロセッサのレジスタ幅に合わせてデータを圧縮してもよい。
Here, the
特定部2501は、データ列での後続データの位置と、データ列の先頭から所定長単位で区切られた複数の位置のうち、後続データの位置より末尾側にあり、かつ、後続データの位置から所定長分の範囲内にある位置と、の区間長を特定する。
The specifying
特定部2501は、具体的には、例えば、圧縮元データの位置「24バイト目」と、データ列の先頭から8バイトごとに区切られた区間のうちで圧縮元データの位置を含む区間の末尾の位置「25バイト目」と、を特定する。次に、特定部2501は、特定した「24バイト目」と「25バイト目」との間にある部分区間のデータ長「1バイト」を特定する。
Specifically, for example, the specifying
特定部2501は、具体的には、例えば、図2に示したROM202、RAM203、磁気ディスク205、光ディスク207などの記憶装置に記憶されたプログラムをプロセッサ201に実行させることにより、その機能を実現する。これにより、生成部2504は、部分区間のデータ長を参照して、圧縮データを生成することができる。
Specifically, the specifying
記憶部2502は、データ列を記憶する。記憶部2502によって記憶されるデータ列については、図3および図4を用いて説明したデータ列と同様であるため、説明を省略する。検出部2503は、データ列を記憶する記憶部2502の中から、先行データと、先行データと同一のデータである後続データと、を検出する。検出部2503は、具体的には、例えば、図2に示したROM202、RAM203、磁気ディスク205、光ディスク207などの記憶装置に記憶されたプログラムをプロセッサ201に実行させることにより、その機能を実現する。検出部2503による検出処理については、図3および図5を用いて説明した処理と同様のため、説明を省略する。
The
生成部2504は、検出された先行データの位置、所定長以上である先行データの長さから区間長を減じた長さを所定長で除した商および剰余を有する圧縮データを生成する。ここで、一般には、先行データの長さから区間長を減じた長さを所定長で除した剰余は、所定長未満になるが、これに限らない。例えば、剰余は所定長以上であってもよい。
The
より具体的には、例えば、「20バイト」を「8バイト」で除した場合に、商として「2」を採用し、剰余として「4バイト」を採用してもよい。また、例えば、「20バイト」を「8バイト」で除した場合に、商として「1」を採用し、剰余として「12バイト」を採用してもよい。 More specifically, for example, when “20 bytes” is divided by “8 bytes”, “2” may be employed as the quotient and “4 bytes” may be employed as the remainder. Further, for example, when “20 bytes” is divided by “8 bytes”, “1” may be adopted as a quotient and “12 bytes” may be adopted as a remainder.
生成部2504は、具体的には、例えば、検出部2503によって特定された参照先データの相対位置を示すデータを生成する。次に、生成部2504は、参照先データのデータ長から、特定した部分区間のデータ長を減算し、減算したデータ長を8バイトで除した商と剰余とを算出する。そして、情報処理装置100は、減算したデータ長分のデータのうち、8バイト単位で分割して処理できるデータの個数として、上述のように算出した商を採用し、採用した商を示すデータを生成する。
Specifically, the
次に、生成部2504は、減算したデータ長分のデータを8バイト単位でまとめて処理した後に、1バイト単位で処理すべき端数データ長として、上述のように算出した剰余を採用し、採用した剰余を示すデータを生成する。そして、生成部2504は、生成したデータを連結した圧縮データを生成する。次に、生成部2504は、圧縮元データを圧縮したことを示す判別ビットを生成する。また、生成部2504は、圧縮元データが圧縮できなかった場合、圧縮元データを圧縮しなかったことを示す判別ビットを生成してもよい。
Next, the
また、復元を実行する他のプロセッサのレジスタ幅が、情報処理装置100のプロセッサ201のレジスタ幅の倍数である場合がある。この場合、生成部2504は、検出された先行データの位置、所定長以上である先行データの長さから区間長を減じた長さを所定長の倍数で除した商および剰余を有する圧縮データを生成してもよい。これにより、復元を実行する他のプロセッサのレジスタ幅と、情報処理装置100のプロセッサ201のレジスタ幅と、が異なる場合であっても、データ圧縮が可能になる。生成されたデータは、例えば、RAM203、磁気ディスク205、光ディスク207などの記憶領域に記憶される。
In addition, the register width of another processor that executes restoration may be a multiple of the register width of the
生成部2504は、具体的には、例えば、図2に示したROM202、RAM203、磁気ディスク205、光ディスク207などの記憶装置に記憶されたプログラムをプロセッサ201に実行させることにより、その機能を実現する。これにより、生成部2504は、圧縮元データと置換すべき圧縮データを保存部2505に送ることができる。
Specifically, the
ここで、図26〜図28を用いて、実施例2にかかる生成部2504によって生成される圧縮データの内容について説明する。具体的には、図26を用いて実施例2にかかる圧縮ルールについて説明し、図27および図28を用いて図26に示した圧縮ルールにより圧縮された圧縮データの一例について説明する。
Here, the content of the compressed data generated by the
図26は、実施例2にかかる圧縮ルールを示す説明図である。図26に示すように、実施例2にかかる圧縮ルールでは、圧縮データは、参照先データの位置を示す「13ビット」の固定長データ2601と、参照先データのデータ長を示す「3ビット+8ビットの倍数のデータ長」の可変長データと、を含む。3ビット+8ビットの倍数のデータ長とは、例えば、3ビット、11ビット、または19ビットである。
FIG. 26 is an explanatory diagram of a compression rule according to the second embodiment. As shown in FIG. 26, in the compression rule according to the second embodiment, the compressed data includes “13 bits” fixed
参照先データの位置を示す固定長データ2601は、圧縮データの位置から参照先データの位置までの間のデータ長を示す。固定長データ2601は、「13ビット」であるため、圧縮データの位置から参照先データの位置までの間のデータ長を「0バイト〜8191バイト」の範囲で示す。
The fixed
参照先データのデータ長を示す可変長データは、参照先データのデータ長が「10」バイト未満である場合、「3ビット」のデータ2602である。可変長データ2602は、データ長が「3ビット」であるため、参照先データのデータ長を「3バイト〜9バイト」の範囲で示す。ここでは、可変長データ2602は、例えば、可変長データ2602が「000」である場合、2進数「000」に対応する10進数「0」ではなく、10進数「3」を示している。
The variable length data indicating the data length of the reference destination data is “3 bits”
実施例2の圧縮ルールでは、圧縮データのデータ長は2バイト以上になる。そのため、情報処理装置100は、圧縮元データのデータ長が「1バイトまたは2バイト」である場合には、圧縮してもデータサイズが低減しないことになるから、圧縮元データを圧縮しなくてもよい。従って、参照先データのデータ長として「0バイト〜2バイト」を示す必要がないため、可変長データ2602は、データ「000〜110」の各々に、各々の2進数を10進数に変換した「0〜7」ではなく、「3〜9」を対応付けている。
In the compression rule of the second embodiment, the data length of the compressed data is 2 bytes or more. Therefore, when the data length of the compression source data is “1 byte or 2 bytes”, the
また、参照先データのデータ長を示す可変長データは、参照先データのデータ長が「10」バイト以上「248バイト」未満である場合、「3ビット」のデータ2602と「5ビット」のデータ2603と「3ビット」のデータ2604とを連結したデータである。
The variable length data indicating the data length of the reference destination data is “3 bits”
可変長データ2602〜2604のうち、データ2602は「111」となり、参照先データのデータ長が「10バイト」以上であることを示すとともに、後続の「8ビット」のデータ2603,2604が参照先データのデータ長を示すデータであることを示す。
Among the
可変長データ2602〜2604のうち、データ2603は、参照先データのデータ長から圧縮元データの位置からアラインされて区切られた位置までの区間長を減じたデータ長分のデータのうち、「8バイト」単位で分割して取得できるデータの個数を示す。ここで、データ2603は、データ長が「5ビット」であるため、個数を「0〜30」の範囲で示す。換言すれば、データ2603は、「0バイト〜240バイト」の範囲内の8の倍数のデータ長のいずれかを示す。
Of the
また、データ2604は、参照先データのデータ長から、圧縮元データの位置からアラインされて区切られた位置までの区間長を減じ、データ2603が示す個数分の「8バイト」を減じた端数データ長を示す。ここで、データ2604は、データ長が「3ビット」であるため、端数データ長を「0バイト〜7バイト」の範囲で示す。
The
また、参照先データのデータ長が「248バイト」以上である場合がある。この場合、参照先データのデータ長を示す可変長データは、「3ビット」のデータ2602と「5ビット」のデータ2603と「3ビット」のデータ2604と「8ビット」のデータ2605とを連結したデータである。データ2602,2604については、参照先データのデータ長が「10」バイト以上「248バイト」未満である場合と同様のため、ここでは、説明を省略する。
Further, the data length of the reference destination data may be “248 bytes” or more. In this case, the variable-length data indicating the data length of the reference destination data is concatenation of “3-bit”
可変長データ2602〜2605のうち、データ2603は、「11111」となり、上述した「8バイト」単位で分割して取得できるデータの個数が「30」以上であることを示す。また、データ2603は、後続の「8ビット」のデータ2605が、参照先データのうち、「8バイト」単位で分割して取得できるデータの個数を示すデータであることを示す。
Of the
可変長データ2602〜2605のうち、データ2605は、上述した「8バイト」単位で分割して取得できるデータの個数が、「30」より何個多いかを示すことにより、間接的にデータの個数を示す。データ2605は、データ長が「8ビット」であるため、個数「30」より何個多いかを「1〜255」の範囲で示す。
Among the variable-length data 2602-2605, the
これにより、データ2605は、上述した「8バイト」単位で分割して取得できるデータの個数を、「31〜285(30+1〜30+255)」の範囲で示す。換言すれば、データ2605は、「248バイト〜2032バイト」の範囲内の8の倍数のデータ長のいずれかを示す。
As a result, the
以降、参照先データのデータ長を示す可変長データは、上述した「8バイト」単位で分割して取得できるデータの個数が、当該個数を示すために使用中のデータでは示せなくなる都度、新たに当該個数を示すための8ビットのデータを追加する。そして、追加した8ビットのデータを使用して、「8バイト」単位で分割して取得できるデータの個数を示すことになる。 Thereafter, the variable length data indicating the data length of the reference destination data is newly added each time the number of data that can be obtained by being divided in units of “8 bytes” cannot be indicated by the data being used to indicate the number. 8-bit data for indicating the number is added. Then, using the added 8-bit data, the number of pieces of data that can be obtained by being divided in units of “8 bytes” is indicated.
図27および図28は、圧縮されなかった非圧縮データの一例、および、図26に示した圧縮ルールによって圧縮された圧縮データの一例を示す説明図である。 27 and 28 are explanatory diagrams illustrating an example of uncompressed data that has not been compressed and an example of compressed data that has been compressed according to the compression rule illustrated in FIG. 26.
図27(A)は、圧縮されなかった非圧縮データの一例を示す。図27(B)は、9バイト以下のデータ長の圧縮元データを圧縮した場合の圧縮データの一例を示す。図27(C)は、9バイトより長いデータ長の圧縮元データを圧縮した場合の圧縮データの一例(その1)を示す。図28(D)は、9バイトより長いデータ長の圧縮元データを圧縮した場合の圧縮データの一例(その2)を示す。 FIG. 27A shows an example of uncompressed data that has not been compressed. FIG. 27B shows an example of compressed data when compression source data having a data length of 9 bytes or less is compressed. FIG. 27C shows an example (part 1) of compressed data when compression source data having a data length longer than 9 bytes is compressed. FIG. 28D shows an example (part 2) of compressed data when compression source data having a data length longer than 9 bytes is compressed.
図27(A)に示すように、圧縮元データ列dsHに含まれるデータが圧縮できないデータdHである場合がある。この場合、生成部2504は、圧縮できないデータdHを、非圧縮データndHとして、そのまま保存部2505に送る。また、生成部2504は、圧縮していないことを示す判別ビットbH「0」を生成する。
As shown in FIG. 27A, the data included in the compression source data string dsH may be data dH that cannot be compressed. In this case, the
図27(B)に示すように、圧縮元データ列dsIに、同一データになる圧縮元データtdIと参照先データrdIとがあり、圧縮元データtdIが「9バイト」以下である場合がある。この場合、生成部2504は、「13ビット」で、参照先データrdIの相対位置「10」を示す「0000000001010(10)」を生成する。
As shown in FIG. 27B, the compression source data string dsI includes compression source data tdI and reference destination data rdI that are the same data, and the compression source data tdI may be “9 bytes” or less. In this case, the
次に、生成部2504は、「3ビット」で、参照先データrdIのデータ長「4バイト」を示す「001(4)」を生成する。そして、生成部2504は、生成したデータを連結した圧縮データcdI「0000000001010(10)001(4)」を生成する。また、生成部2504は、圧縮したことを示す判別ビットbI「1」を生成する。
Next, the
図27(C)に示すように、圧縮元データ列dsJに、同一データになる圧縮元データtdJと参照先データrdJとがあり、圧縮元データtdJが「9バイト」より大きい場合がある。ここでは、圧縮元データtdJの位置から2バイト目が、圧縮元データ列dsJの先頭からアラインされて区切られた位置とする。 As shown in FIG. 27C, the compression source data string dsJ includes compression source data tdJ and reference destination data rdJ that are the same data, and the compression source data tdJ may be larger than “9 bytes”. Here, it is assumed that the second byte from the position of the compression source data tdJ is a position that is aligned and separated from the head of the compression source data string dsJ.
この場合、生成部2504は、「13ビット」で、参照先データrdJの相対位置「20」を示す「0000000010100(20)」を生成する。次に、生成部2504は、「3ビット」で、参照先データrdJのデータ長が「9バイト」より大きいことを示す「111(10)」を生成する。
In this case, the
そして、生成部2504は、参照先データrdJ「compression」のデータ長「11バイト」から、圧縮元データtdJの位置とアラインされて区切られた位置との区間長「2バイト」を減算する。次に、生成部2504は、減算結果の「9バイト」を、「8バイト」で除することにより、8バイト単位で分割して処理できる個数「1」を算出する。そして、生成部2504は、8バイト単位で分割して処理できるデータの個数「1」を示すデータ「00001(1)」を生成する。
Then, the
次に、生成部2504は、減算結果の「9バイト」から、算出した個数分の「8バイト」を減じて、端数データ長「1バイト」を算出する。そして、生成部2504は、1バイト単位で処理すべき端数データ長「1」を示すデータ「001(1)」を生成する。次に、生成部2504は、生成したデータを連結した圧縮データcdJ「0000000010100(20)111(10)00001(1)001(1)」を生成する。また、生成部2504は、圧縮したことを示す判別ビットbJ「1」を生成する。
Next, the
図28(D)に示すように、圧縮元データ列dsKに、同一データになる圧縮元データtdKと参照先データrdKとがあり、圧縮元データtdKが「9バイト」より大きい場合がある。ここでは、圧縮元データtdKの位置から2バイト目が、圧縮元データ列dsKの先頭からアラインされて区切られた位置とする。 As shown in FIG. 28D, the compression source data string dsK includes compression source data tdK and reference destination data rdK that are the same data, and the compression source data tdK may be larger than “9 bytes”. Here, it is assumed that the second byte from the position of the compression source data tdK is a position that is aligned and separated from the head of the compression source data string dsK.
この場合、生成部2504は、「13ビット」で、参照先データrdKの相対位置「1120」を示す「0010001100000(1120)」を生成する。次に、生成部2504は、「3ビット」で、参照先データrdKのデータ長が「9バイト」より大きいことを示す「111(10)」を生成する。
In this case, the
そして、生成部2504は、参照先データrdKのデータ長「303バイト」から、圧縮元データtdKの位置とアラインされて区切られた位置との区間長「2バイト」を減算する。次に、生成部2504は、減算結果の「301バイト」を、「8バイト」で除することにより、8バイト単位で分割して処理できる個数「37」を算出する。そして、生成部2504は、8バイト単位で分割して処理できるデータの個数「37」を示すために、5ビットで個数が「30」より多いことを示すデータ「11111(31)」を生成する。そして、生成部2504は、8ビットで「30」から「37」までの不足分である「7」を示すことにより、個数「37」を示すデータ「00000110(30+7=37)」を生成する。
Then, the
次に、生成部2504は、減算結果の「301バイト」から、算出した個数分の「8バイト」を減じて、端数データ長「5バイト」を算出する。そして、生成部2504は、1バイト単位で処理すべき端数データ長「5」を示すデータ「101(5)」を生成する。そして、生成部2504は、生成したデータを連結した圧縮データcdK「0010001100000(1120)111(10)11111(31)101(5)00000110(37)」を生成する。また、生成部2504は、圧縮したことを示す判別ビットbK「1」を生成する。
Next, the
図25に戻り、保存部2505は、後続データを生成された圧縮データに置換したデータ列を保存する。保存部2505による保存処理については、図3を用いて説明した処理と同様のため、説明を省略する。
Returning to FIG. 25, the
(データ列の圧縮の流れ)
次に、図29〜図34を用いて、実施例2にかかる情報処理装置100によるデータ列の圧縮の流れについて説明する。
(Data stream compression flow)
Next, the flow of data string compression by the
図29〜図34は、実施例2にかかる情報処理装置100によるデータ列の圧縮の流れを示す説明図である。図29において、まず、情報処理装置100は、情報処理装置100の利用者によるキーボード210やマウス211などの入力装置の操作により、圧縮元データ列dsBを入力する。次に、情報処理装置100は、入力された圧縮元データ列dsBを、入力バッファに格納する。
FIGS. 29 to 34 are explanatory diagrams illustrating a flow of data string compression by the
そして、情報処理装置100は、入力バッファに格納された圧縮元データ列dsBの先頭に圧縮ポインタ900を設定する。次に、情報処理装置100は、判別ビット列を格納する判別バッファ910と、圧縮データ列を格納する圧縮バッファ920と、を設定する。そして、情報処理装置100は、圧縮元データ列dsBの圧縮を開始する。
Then, the
図29において、(61)情報処理装置100は、圧縮ポインタ900が示す位置から始まる「3バイト」のデータ「com」を取得する。次に、情報処理装置100は、圧縮ポインタ900が示す位置よりも先頭側から、取得したデータ「com」と同一データになる先行データを探索する。
In FIG. 29, (61) the
ここで、情報処理装置100は、具体的には、例えば、図5に示した探索テーブル500を参照して、圧縮ポインタ900が示す位置に対応する先行データの位置情報「0」を取得する。次に、情報処理装置100は、位置情報が「0」であるため、圧縮ポインタ900が示す位置から始まるデータ「com」と同一データになる先行データがなく、データ「com」が圧縮できないと判定する。
Here, specifically, for example, the
(62)そして、情報処理装置100は、圧縮ポインタ900が示す位置にあるデータ「c」を圧縮できなかったデータとして、そのまま、圧縮バッファ920に格納する。(63)また、情報処理装置100は、圧縮ポインタ900が示す位置にあるデータ「c」を圧縮できなかったことを示す判別ビット「0」を判別バッファ910に格納する。
(62) The
次に、情報処理装置100は、圧縮ポインタ900を「1バイト」分、末尾側にシフトして、図30の処理に移行する。
Next, the
図30において、(64)情報処理装置100は、図29と同様にして、圧縮ポインタ900が示す位置から始まる「3バイト」のデータ「omp」を取得する。次に、情報処理装置100は、圧縮ポインタ900が示す位置よりも先頭側から、取得したデータ「omp」と同一データになる先行データを探索する。そして、情報処理装置100は、圧縮ポインタ900が示す位置から始まるデータ「omp」と同一データになる先行データがないため、データ「omp」が圧縮できないと判定する。
30, (64) the
(65)次に、情報処理装置100は、圧縮ポインタ900が示す位置にあるデータ「o」を圧縮できなかったデータとして、そのまま、圧縮バッファ920に格納する。(66)また、情報処理装置100は、圧縮ポインタ900が示す位置にあるデータ「o」を圧縮できなかったことを示す判別ビット「0」を判別バッファ910に格納する。
(65) Next, the
次に、情報処理装置100は、圧縮ポインタ900を「1バイト」分、末尾側にシフトして、図31の処理に移行する。
Next, the
図31において、(67)情報処理装置100は、図29と同様にして、圧縮ポインタ900が示す位置から始まる「3バイト」のデータ「mpr」を取得する。次に、情報処理装置100は、圧縮ポインタ900が示す位置よりも先頭側から、取得したデータ「mpr」と同一データになる先行データを探索する。そして、情報処理装置100は、圧縮ポインタ900が示す位置から始まるデータ「mpr」と同一データになる先行データがないため、データ「mpr」が圧縮できないと判定する。
In FIG. 31, (67) the
(68)次に、情報処理装置100は、圧縮ポインタ900が示す位置にあるデータ「m」を圧縮できなかったデータとして、そのまま、圧縮バッファ920に格納する。(69)また、情報処理装置100は、圧縮ポインタ900が示す位置にあるデータ「m」を圧縮できなかったことを示す判別ビット「0」を判別バッファ910に格納する。
(68) Next, the
以降、情報処理装置100は、図29〜図31と同様にして、圧縮元データの「4バイト目」〜「14バイト目」の各々の位置にあるデータを圧縮せずに圧縮バッファ920に格納したとする。次に、情報処理装置100は、圧縮ポインタ900を「1バイト」分、末尾側にシフトして、図32の処理に移行する。
Thereafter, the
図32において、(70)情報処理装置100は、圧縮ポインタ900が示す位置から始まる「3バイト」のデータ「com」を取得する。次に、情報処理装置100は、圧縮ポインタ900が示す位置よりも先頭側から、取得したデータ「com」と同一データになる先行データを探索する。
In FIG. 32, (70) the
ここで、情報処理装置100は、具体的には、例えば、図5に示した探索テーブル500を参照して、圧縮ポインタ900が示す位置に対応する先行データの位置情報「14」を取得する。次に、情報処理装置100は、位置情報が「14」であるため、圧縮ポインタ900が示す位置から始まるデータ「com」と同一データになる先行データが「14バイト前」にあると判定する。そのため、情報処理装置100は、「com」を圧縮できると判定する。
Here, specifically, for example, the
ここで、情報処理装置100は、「com」より末尾側のデータも、「com」とまとめて圧縮できるか否かを判定する。情報処理装置100は、具体的には、例えば、圧縮ポインタ900が示す位置より「1バイト分」末尾側の位置に対応する先行データの位置情報「14」を取得する。
Here, the
ここで、取得した先行データの位置情報「14」は、圧縮ポインタ900が示す位置に対応する先行データの位置情報「14」と同一である。そのため、情報処理装置100は、圧縮ポインタ900が示す位置にあるデータ「com」とまとめて、圧縮ポインタ900が示す位置より「1バイト分」末尾側の位置にある「omp」を圧縮できると判定する。
Here, the acquired position information “14” of the preceding data is the same as the position information “14” of the preceding data corresponding to the position indicated by the
換言すれば、情報処理装置100は、圧縮ポインタ900が示す位置から始まる「4バイト」のデータ「comp」を、「14バイト前」にある先行データ「comp」を使用して、圧縮できると判定する。
In other words, the
そして、情報処理装置100は、同様にして、圧縮ポインタ900が示す位置から始まる「8バイト」のデータ「compress」を、「14バイト前」にある先行データ「compress」を使用して、圧縮できると判定する。
Similarly, the
次に、情報処理装置100は、参照先データの相対位置を示す「13ビット」のデータ「0000000001110(14)」を生成する。また、情報処理装置100は、参照先データのデータ長を示す「3ビット」のデータ「101(8)」を生成する。次に、情報処理装置100は、生成したデータを連結した圧縮データ「0000000001110(14)101(8)」を生成する。以降、圧縮データ「0000000001110(14)101(8)」を、圧縮データ「14,8」と表す。
Next, the
(71)そして、情報処理装置100は、圧縮ポインタ900が示す位置から始まるデータ「compress」の代わりに、圧縮データ「14,8」を圧縮バッファ920に格納する。(72)また、情報処理装置100は、圧縮ポインタ900が示す位置から始まるデータ「compress」を圧縮したことを示す判別ビット「1」を判別バッファ910に格納する。
(71) The
次に、情報処理装置100は、圧縮ポインタ900を、圧縮したデータのデータ長である「8バイト分」、末尾側にシフトして、図29〜図31と同様にして、圧縮元データの「23バイト目」の位置にあるデータ「 (空白)」を圧縮せずに圧縮バッファ920に格納したとする。そして、情報処理装置100は、圧縮ポインタ900を「1バイト分」、末尾側にシフトしたとして、図33の処理に移行する。
Next, the
図33において、(73)情報処理装置100は、圧縮ポインタ900が示す位置から始まる「3バイト」のデータ「com」を取得する。次に、情報処理装置100は、圧縮ポインタ900が示す位置よりも先頭側から、取得したデータ「com」と同一データになる先行データを探索する。
In FIG. 33, (73) the
ここで、情報処理装置100は、図32と同様にして、圧縮ポインタ900が示す位置から始まる「11バイト」のデータ「compression」を、「23バイト前」にある先行データ「compression」を使用して、圧縮できると判定する。
Here, the
次に、情報処理装置100は、参照先データの相対位置を示す「13ビット」のデータ「0000000010111(23)」を生成する。そして、情報処理装置100は、参照先データのデータ長が9バイトより長いことを示す「3ビット」のデータ「111(10)」を生成する。
Next, the
次に、情報処理装置100は、圧縮ポインタ900の示す位置から、圧縮ポインタ900の直後に出現するアラインされて区切られた位置までの区間長「1バイト」を算出する。そして、情報処理装置100は、参照先データのデータ長「11バイト」から、区間長「1バイト」を減じて、「10バイト」を算出する。
Next, the
次に、情報処理装置100は、減算結果が「10バイト」であるため、「10バイト」のデータのうち、8バイト単位で分割して処理できるデータの個数「1」を示すデータ「00001(1)」を生成する。
Next, since the subtraction result is “10 bytes”, the
そして、情報処理装置100は、参照先データから区間長分のデータを除いた「10バイト」のデータのうち、個数分の8バイト単位のデータを処理した後に、1バイト単位で処理すべき端数データ長「2バイト」を示すデータ「010(2)」を生成する。次に、情報処理装置100は、生成したデータを連結した圧縮データ「0000000010111(23)111(10)00001(1)010(2)」を生成する。以降、圧縮データ「0000000010111(23)111(10)00001(1)010(2)」を、圧縮データ「23,1,2」と表す。
Then, the
(74)そして、情報処理装置100は、圧縮ポインタ900が示す位置から始まるデータ「compression」の代わりに、圧縮データ「23,1,2」を圧縮バッファ920に格納する。(75)また、情報処理装置100は、圧縮ポインタ900が示す位置から始まるデータ「compression」を圧縮したことを示す判別ビット「1」を判別バッファ910に格納する。
(74) The
次に、情報処理装置100は、圧縮ポインタ900を、圧縮したデータのデータ長である「11バイト分」、末尾側にシフトして、図29〜図31と同様にして、圧縮元データの「34バイト目」の位置にあるデータ「.」を圧縮せずに圧縮バッファ920に格納したとする。
Next, the
図29〜図33を用いて説明した処理により圧縮された圧縮データ列を図34に示す。図34に示すように、情報処理装置100は、「35バイト」の圧縮元データ列dsBを、「18ビット」の判別ビット列bsLと、「21バイト」の圧縮データ列cdsLと、に変換している。従って、情報処理装置100は、「35バイト」の圧縮元データ列dsBを、「18ビット」の判別ビット列bsLと、「21バイト」の圧縮データ列cdsLと、に変換したことになる。換言すれば、情報処理装置100は、データ列のデータ長を、「(35バイト)−(21バイト+18ビット)=(11バイト+6ビット)」のデータ長分、低減することができる。
FIG. 34 shows a compressed data string compressed by the processing described with reference to FIGS. As shown in FIG. 34, the
このように、情報処理装置100は、データ列のサイズを低減することができる。結果として、情報処理装置100は、データ列を保存する場合に、圧縮せずに保存する場合と比べて、使用する記憶領域のサイズを低減することができる。また、情報処理装置100は、データ列を他のコンピュータに送信する場合に、データ列を圧縮してから送信することにより、送信時間を短縮することができる。
Thus, the
(圧縮データ列および判別ビット列の保存例)
次に、図29〜図34に示した圧縮データ列cdsLおよび判別ビット列bsLを記憶装置に保存する場合の保存例について説明する。ここで、圧縮データ列cdsLおよび判別ビット列bsLの保存例は、図15に示した圧縮データ列cdsLおよび判別ビット列bsLの保存例と同様のため、説明を省略する。
(Example of saving compressed data string and discrimination bit string)
Next, an example of saving when the compressed data string cdsL and the discrimination bit string bsL shown in FIGS. 29 to 34 are saved in the storage device will be described. Here, the example of storing the compressed data string cdsL and the determination bit string bsL is the same as the example of storing the compressed data string cdsL and the determination bit string bsL shown in FIG.
(データ列圧縮処理)
次に、図35を用いて、図29〜図34に示したデータ列の圧縮を実現するデータ列圧縮処理の詳細な処理手順について説明する。
(Data string compression processing)
Next, a detailed processing procedure of the data string compression processing for realizing the compression of the data strings shown in FIGS. 29 to 34 will be described with reference to FIG.
図35は、図29〜図34に示したデータ列の圧縮を実現するデータ列圧縮処理の詳細な処理手順を示すフローチャートである。図35に示すように、情報処理装置100は、まず、入力バッファにある圧縮元データの中から、圧縮ポインタ900が示す位置にある後続データと同一データになる先行データを検出する(ステップS3501)。
FIG. 35 is a flowchart showing a detailed processing procedure of the data string compression processing for realizing the compression of the data strings shown in FIGS. As shown in FIG. 35, the
次に、情報処理装置100は、先行データが検出されたか否かを判定する(ステップS3502)。ここで、先行データが検出されなかった場合(ステップS3502:No)、情報処理装置100は、圧縮しないことを示す判別ビット「0」を生成して、判別バッファ910に格納する(ステップS3503)。
Next, the
次に、情報処理装置100は、後続データの先頭1バイト分のデータを、そのまま、圧縮バッファ920に格納する(ステップS3504)。そして、情報処理装置100は、圧縮ポインタ900を「1バイト分」末尾側にシフトする(ステップS3505)。
Next, the
次に、情報処理装置100は、圧縮が終了したか否かを判定する(ステップS3506)。ここで、圧縮が終了した場合(ステップS3506:Yes)、情報処理装置100は、データ列圧縮処理を終了する。
Next, the
一方、圧縮が終了していない場合(ステップS3506:No)、情報処理装置100は、ステップS3501に戻る。以上のステップS3501〜ステップS3506を経由する処理により、情報処理装置100は、圧縮できないデータを処理する。
On the other hand, when the compression has not ended (step S3506: No), the
一方、ステップS3502において、先行データが検出された場合(ステップS3502:Yes)、情報処理装置100は、圧縮することを示す判別ビット「1」を生成して、判別バッファ910に格納する(ステップS3507)。
On the other hand, when preceding data is detected in step S3502 (step S3502: Yes), the
次に、情報処理装置100は、先行データのデータ長が9バイトより長いか否かを判定する(ステップS3508)。ここで、先行データのデータ長が9バイト以下の場合(ステップS3508:No)、情報処理装置100は、先行データの位置を示すデータと、先行データのデータ長を示すデータと、を生成して、圧縮バッファ920に格納する(ステップS3509)。
Next, the
次に、情報処理装置100は、圧縮ポインタ900を「先行データのデータ長分」末尾側にシフトする(ステップS3510)。そして、情報処理装置100は、ステップS3506に移行する。以上のステップS3501,S3502,S3507〜S3510,S3506を経由する処理により、情報処理装置100は、9バイト以下のデータ長であって圧縮可能なデータを圧縮する。
Next, the
一方、ステップS3508において、先行データのデータ長が9バイトより長い場合(ステップS3508:Yes)、情報処理装置100は、先行データの位置を示すデータと、先行データのデータ長が9バイトより長いことを示すデータと、を生成する。次に、情報処理装置100は、生成したデータを、圧縮バッファ920に格納する(ステップS3511)。
On the other hand, in step S3508, when the data length of the preceding data is longer than 9 bytes (step S3508: Yes), the
次に、情報処理装置100は、圧縮ポインタ900が示す位置と、入力バッファの先頭からレジスタ幅ごとに区切られた区間のうちで圧縮ポインタ900が示す位置を含む区間の末尾の位置と、の部分区間のデータ長を特定する。そして、情報処理装置100は、先行データのデータ長から特定した部分区間のデータ長を減じてレジスタ幅で除した場合の商と剰余とを算出する。次に、情報処理装置100は、算出した商を示すデータと、算出した剰余を示すデータと、を生成して、圧縮バッファ920に格納する(ステップS3512)。
Next, the
そして、情報処理装置100は、ステップS3510に移行する。以上のステップS3501,S3502,S3507,S3508,S3511,S3512,S3510,S3506を経由する処理により、情報処理装置100は、9バイトより長いデータ長であって圧縮可能なデータを圧縮する。
Then, the
(実施例2にかかる情報処理装置100による圧縮データ列から圧縮元データ列dsBの復元)
次に、実施例2にかかる情報処理装置100による圧縮元データ列dsBの復元について、図36〜図42に示す。
(Restoration of the compression source data string dsB from the compression data string by the
Next, decompression of the compression source data string dsB by the
(実施例2にかかる情報処理装置100の圧縮元データ列dsBの復元に関する機能的構成例)
次に、図36を用いて、実施例2にかかる情報処理装置100の圧縮元データ列dsBの復元に関する機能的構成例について説明する。図36は、実施例2にかかる情報処理装置100の圧縮元データ列dsBの復元に関する機能的構成例を示すブロック図である。情報処理装置100は、特定部3601と、記憶部3602と、検出部3603と、取得部3604と、格納部3605と、を含む構成である。
(Functional configuration example regarding decompression of the compression source data string dsB of the
Next, with reference to FIG. 36, a functional configuration example relating to the decompression of the compression source data string dsB of the
特定部3601は、所定の記憶領域での書込先の位置と、所定の記憶領域の先頭から所定長単位で区切られた複数の位置のうち、書込先より末尾側にあり、かつ、書込先の位置から所定長分の範囲内にある位置と、の区間長を特定する。
The specifying
特定部3601は、具体的には、例えば、圧縮元データの位置と、データ列の先頭から8バイトごとにアラインされて区切られた区間のうちで圧縮元データの位置を含む区間の末尾の位置と、の間にある部分区間のデータ長を特定する。
Specifically, the specifying
特定部3601は、具体的には、例えば、図2に示したROM202、RAM203、磁気ディスク205、光ディスク207などの記憶装置に記憶されたプログラムをプロセッサ201に実行させることにより、その機能を実現する。これにより、取得部3604は、部分区間のデータ長を参照して、参照先データを取得することができる。
Specifically, the specifying
記憶部3602は、参照先となる非圧縮データの参照位置、所定長以上である非圧縮データの長さから区間長を減じた長さを所定長で除した商および剰余を有する圧縮データと、非圧縮データとを含む圧縮データ列を記憶する。参照先となる非圧縮データとは、例えば、上述した参照先データである。所定長とは、2の冪乗になるレジスタ幅であり、例えば、上述した8バイトである。
The
圧縮データは、例えば、参照先データの相対位置「14」を示すデータ「0000000001110(14)」を有する。また、圧縮データは、例えば、参照先データが10バイト以上であることを示すデータ「111(10)」を有する。また、圧縮データは、例えば、参照先データから特定された区間長分のデータを除いたデータのうち、8バイト単位で分割して処理できるデータの個数「1」を示すデータ「00001(1)」を有する。また、圧縮データは、1バイト単位で処理すべき端数データ長「3」を示すデータ「011(3)」を有する。 The compressed data includes, for example, data “0000000001110 (14)” indicating the relative position “14” of the reference destination data. The compressed data includes, for example, data “111 (10)” indicating that the reference destination data is 10 bytes or more. The compressed data is, for example, data “00001 (1)” indicating the number of data “1” that can be divided and processed in units of 8 bytes out of the data excluding the data for the section length specified from the reference destination data. Is included. The compressed data has data “011 (3)” indicating the fraction data length “3” to be processed in units of 1 byte.
記憶部3602は、具体的には、例えば、圧縮データと非圧縮データとを含む圧縮データ列、および判別ビット列を記憶する。記憶部3602は、具体的には、例えば、図2に示したROM202、RAM203、磁気ディスク205、光ディスク207などの記憶装置により、その機能を実現する。これにより、検出部3603は、記憶部3602に記憶された圧縮データ列および判別ビット列を取得することができる。
Specifically, the
検出部3603は、記憶部3602の中から、圧縮データを検出する。検出部3603は、具体的には、例えば、判別ビット列の中から判別ビットを取得し、取得した判別ビットに対応するデータが非圧縮データか圧縮データかを判定する。
The
次に、検出部3603は、圧縮データと判定された場合、「1バイト分」のデータ「0000000001110(14)111(10)」を検出する。検出部3603は、検出したデータの末尾「3ビット」が参照先データのデータ長が「9バイト」より長いことを示す「111(10)」であるため、後続の「1バイト分」のデータ「00001(1)010(2)」をさらに検出する。
Next, when it is determined that the data is compressed data, the
このように、検出部3603は、圧縮データ「0000000001110(14)111(10)00001(1)010(2)」を検出する。検出部3603は、具体的には、例えば、図2に示したROM202、RAM203、磁気ディスク205、光ディスク207などの記憶装置に記憶されたプログラムをプロセッサ201に実行させることにより、その機能を実現する。これにより、取得部3604は、検出部3603によって検出された圧縮データを使用して、参照先データを取得することができる。
In this way, the
取得部3604は、検出された圧縮データに含まれている参照位置から始まる参照先データの先頭から順に、区間長となる第1のデータ列と、所定長に商を乗じた長さとなる所定長単位の第2のデータ列と、剰余分の長さとなる第3のデータ列と、を取得する。
The
取得部3604は、具体的には、例えば、圧縮データ内の「0000000001110(14)」から、参照先データの位置が圧縮データの位置より「14バイト分」先頭側の位置であることを特定する。
Specifically, the
次に、取得部3604は、特定した位置から始まる参照先データのうち、区間長分のデータを取得する。そして、取得部3604は、「8バイト」に圧縮データ内の「00001(1)」が示す商を乗じた「8バイト分」のデータを、「8バイト単位」でまとめて取得する。また、取得部3604は、圧縮データ内の「010(2)」が示す剰余分の「2バイト分」のデータを、「1バイト」ごとに取得する。
Next, the
また、圧縮を実行した他のプロセッサのレジスタ幅が、情報処理装置100のプロセッサ201のレジスタ幅の倍数である場合がある。この場合、取得部3604は、検出された圧縮データに含まれている参照位置から始まる参照先データの先頭から順に、第1のデータ列と、所定長の倍数に商を乗じた長さとなる所定長単位の第2のデータ列と、第3のデータ列と、を取得してもよい。
In addition, the register width of another processor that has performed compression may be a multiple of the register width of the
取得部3604は、具体的には、例えば、図2に示したROM202、RAM203、磁気ディスク205、光ディスク207などの記憶装置に記憶されたプログラムをプロセッサ201に実行させることにより、その機能を実現する。これにより、取得部3604は、圧縮データと置換すべき参照先データを格納部3605に送ることができる。
Specifically, the acquiring
格納部3605は、第1のデータ列、第2のデータ列、および第3のデータ列を所定の記憶領域における書込先の位置から取得順に書き込む。格納部3605は、具体的には、例えば、参照先データ「compression」のうち、取得した区間長分のデータ「c」を復元バッファ1800に格納する。次に、格納部3605は、参照先データ「compression」のうち、「8バイト単位」で取得した「ompressi」を復元バッファ1800に格納し、取得した「2バイト分」の「on」を復元バッファ1800に格納する。
The
格納部3605は、具体的には、例えば、図2に示したROM202、RAM203、磁気ディスク205、光ディスク207などの記憶装置に記憶されたプログラムをプロセッサ201に実行させることにより、その機能を実現する。これにより、格納部3605は、圧縮データを参照先データの複製データと置換することができ、圧縮元データを復元することができる。
Specifically, the
また、格納部3605は、検出部3603によって非圧縮データと判定されたデータを、そのまま、復元バッファ1800に格納する。これにより、格納部3605は、参照先データになる可能性がある非圧縮データを復元バッファ1800に格納しておくことができる。
In addition, the
(圧縮元データ列dsBの復元の流れ)
次に、図37〜図42を用いて、実施例2にかかる情報処理装置100による圧縮元データ列dsBの復元の流れについて説明する。
(Flow of decompression of compression source data string dsB)
Next, the flow of decompression of the compression source data string dsB by the
図37〜図42は、実施例2にかかる情報処理装置100による圧縮元データ列dsBの復元の流れを示す説明図である。図37において、まず、情報処理装置100は、判別ビット列bsLの先頭に判別ポインタ1810を設定する。次に、情報処理装置100は、圧縮データ列cdsLの先頭に復元ポインタ1820を設定する。そして、情報処理装置100は、復元した圧縮元データ列dsBを格納する復元バッファ1800を設定する。
FIGS. 37 to 42 are explanatory diagrams illustrating a flow of decompression of the compression source data string dsB by the
図37において、(81)情報処理装置100は、判別ポインタ1810が示す位置にある判別ビットを検出する。(82)次に、情報処理装置100は、検出した判別ビットが「0」であるため、復元ポインタ1820が示す位置にあるデータが非圧縮データであると判定して、復元ポインタ1820が示す位置にあるデータ「c」を取得する。
In FIG. 37, (81) the
(83)そして、情報処理装置100は、取得した非圧縮データ「c」を、そのまま、復元バッファ1800に格納する。次に、情報処理装置100は、判別ポインタ1810を「1ビット分」末尾側にシフトして、復元ポインタ1820を「1バイト分」末尾側にシフトして、図38の処理に移行する。
(83) The
図38において、(84)情報処理装置100は、図37と同様にして、判別ポインタ1810が示す位置にある判別ビットを検出する。(85)次に、情報処理装置100は、検出した判別ビットが「0」であるため、復元ポインタ1820が示す位置にあるデータが非圧縮データであると判定して、復元ポインタ1820が示す位置にあるデータ「o」を取得する。
38, (84) the
(86)そして、情報処理装置100は、取得した非圧縮データ「o」を、そのまま、復元バッファ1800に格納する。次に、情報処理装置100は、判別ポインタ1810を「1ビット分」末尾側にシフトして、復元ポインタ1820を「1バイト分」末尾側にシフトして、図39の処理に移行する。
(86) The
図39において、(87)情報処理装置100は、図37と同様にして、判別ポインタ1810が示す位置にある判別ビットを検出する。(88)次に、情報処理装置100は、検出した判別ビットが「0」であるため、復元ポインタ1820が示す位置にあるデータが非圧縮データであると判定して、復元ポインタ1820が示す位置にあるデータ「m」を取得する。
39, (87) the
(89)そして、情報処理装置100は、取得した非圧縮データ「m」を、そのまま、復元バッファ1800に格納する。以降、情報処理装置100は、図37〜図39と同様にして、圧縮データの「1バイト目」〜「14バイト目」の各々の位置にあるデータを、そのまま、復元バッファ1800に格納したとする。次に、情報処理装置100は、判別ポインタ1810を「1ビット分」末尾側にシフトして、復元ポインタ1820を「1バイト分」末尾側にシフトして、図40の処理に移行する。
(89) Then, the
図40において、(90)情報処理装置100は、判別ポインタ1810が示す位置にある判別ビットを検出する。(91)次に、情報処理装置100は、検出した判別ビットが「1」であるため、復元ポインタ1820が示す位置にあるデータが圧縮データであると判定して、復元ポインタ1820が示す位置にあるデータ「14,8」を取得する。
40, (90) the
(92)そして、情報処理装置100は、取得した圧縮データ「14,8」を参照して、参照先データが圧縮データより「14バイト前」にあると判定する。次に、情報処理装置100は、取得した圧縮データ「14,8」を参照して、「8バイト分」の参照先データを、1バイト単位で取得して、復元バッファ1800に格納する。
(92) Then, the
次に、情報処理装置100は、判別ポインタ1810を「1バイト分」末尾側にシフトして、復元ポインタ1820を圧縮データのデータ長である「2バイト分」末尾側にシフトしたとする。そして、情報処理装置100は、図37〜図39と同様にして、復元ポインタ1820が示す位置にある非圧縮データ「 (空白)」を復元バッファ1800に格納したとする。次に、情報処理装置100は、判別ポインタ1810を「1ビット分」末尾側にシフトして、復元ポインタ1820を「1バイト分」末尾側にシフトして、図41の処理に移行する。
Next, it is assumed that the
図41において、(93)情報処理装置100は、判別ポインタ1810が示す位置にある判別ビットを検出する。(94)次に、情報処理装置100は、検出した判別ビットが「1」であるため、復元ポインタ1820が示す位置にあるデータが圧縮データであると判定して、復元ポインタ1820が示す位置にあるデータ「23,1,2」を取得する。
In FIG. 41, (93) the
(95)そして、情報処理装置100は、取得した圧縮データ「23,1,2」を参照して、参照先データが圧縮データより「23バイト前」にあると判定する。次に、情報処理装置100は、復元バッファ1800の現在の格納先位置から、格納先位置の直後に出現する復元バッファ1800の先頭からアラインされて区切られた位置までの区間長「1バイト」を算出する。そして、情報処理装置100は、算出した区間長「1バイト」のデータ「c」を取得して、復元バッファ1800に格納する。
(95) Then, the
次に、情報処理装置100は、取得した圧縮データ「23,1,2」を参照して、参照先データからデータ「c」を取得して残ったデータ「ompression」のうち、「8バイト単位」で分割して処理できるデータの個数が「1」であると特定する。そして、情報処理装置100は、残ったデータ「ompression」のうち、1個目の「8バイト分」のデータ「ompressi」を取得して、復元バッファ1800に格納する。
Next, the
次に、情報処理装置100は、取得した圧縮データ「23,1,2」を参照して、「1バイト単位」で処理すべき端数データ長が「3バイト」であると特定する。そして、情報処理装置100は、参照先データからデータ「c」とデータ「ompressi」を取得して残ったデータ「on」を、1バイト単位で取得して、復元バッファ1800に格納する。
Next, the
次に、情報処理装置100は、判別ポインタ1810を「1バイト分」末尾側にシフトして、復元ポインタ1820を圧縮データのデータ長である「3バイト分」末尾側にシフトしたとする。そして、情報処理装置100は、図37〜図39と同様にして、復元ポインタ1820が示す位置にある非圧縮データ「.」を復元バッファ1800に格納したとする。
Next, it is assumed that the
図37〜図41を用いて説明した処理により復元された圧縮元データ列dsBを図42に示す。図42に示すように、情報処理装置100は、圧縮元データ列dsBを、損失なく復元することができる。また、情報処理装置100は、圧縮元データ列dsBの復元において、8バイト単位で取得可能な参照先データがあれば、8バイト単位で取得して復元バッファ1800に格納する。これにより、情報処理装置100は、レジスタ幅を有効活用して、圧縮元データ列dsBの復元にかかる時間を短縮することができる。
FIG. 42 shows the compression source data string dsB restored by the processing described with reference to FIGS. As illustrated in FIG. 42, the
(圧縮元データ列復元処理)
次に、図43を用いて、図37〜図42に示した圧縮元データ列dsBの復元を実現する圧縮元データ列復元処理の詳細な処理手順について説明する。
(Compression source data string restoration processing)
Next, with reference to FIG. 43, a detailed processing procedure of the compression source data sequence decompression processing for realizing the decompression of the compression source data sequence dsB shown in FIGS. 37 to 42 will be described.
図43は、図37〜図42に示した圧縮元データ列dsBの復元を実現する圧縮元データ列復元処理の詳細な処理手順を示すフローチャートである。図43に示すように、情報処理装置100は、まず、判別ポインタ1810が示す位置にある判別ビットを取得する(ステップS4301)。
FIG. 43 is a flowchart showing a detailed processing procedure of the compression source data sequence decompression processing for realizing the decompression of the compression source data sequence dsB shown in FIGS. As shown in FIG. 43, the
次に、情報処理装置100は、取得した判別ビットを参照して、復元ポインタ1820が示す位置にあるデータが圧縮データか否かを判定する(ステップS4302)。ここで、非圧縮データである場合(ステップS4302:No)、情報処理装置100は、復元ポインタ1820が示す位置にある1バイトのデータを取得して、復元バッファ1800に格納する(ステップS4303)。
Next, the
次に、情報処理装置100は、判別ポインタ1810を「1バイト分」末尾側にシフトし、復元ポインタ1820を「1バイト分」末尾側にシフトする(ステップS4304)。そして、情報処理装置100は、復元が終了したか否かを判定する(ステップS4305)。ここで、復元が終了した場合(ステップS4305:Yes)、情報処理装置100は、圧縮元データ列復元処理を終了する。
Next, the
一方、復元が終了していない場合(ステップS4305:No)、情報処理装置100は、ステップS4301に戻る。以上のステップS4301〜S4305を経由する処理により、情報処理装置100は、非圧縮データを処理する。
On the other hand, when the restoration has not ended (step S4305: No), the
一方、ステップS4302において、圧縮データである場合(ステップS4302:Yes)、情報処理装置100は、圧縮データを参照して、参照先データの位置と、参照先データのデータ長と、を取得する(ステップS4306)。
On the other hand, if it is compressed data in step S4302 (step S4302: Yes), the
次に、情報処理装置100は、取得した参照先データのデータ長が9バイトより長いか否かを判定する(ステップS4307)。ここで、参照先データのデータ長が9バイト以下の場合(ステップS4307:No)、情報処理装置100は、参照先データの位置から、参照先データのデータ長分のデータを、1バイト単位で取得して、復元バッファ1800に格納する(ステップS4308)。
Next, the
次に、情報処理装置100は、判別ポインタ1810を「1バイト分」末尾側にシフトし、復元ポインタ1820を「圧縮データのデータ長分」末尾側にシフトする(ステップS4309)。そして、情報処理装置100は、ステップS4305に移行する。
Next, the
以上のステップS4301,S4302,S4306〜S4309,S4305を経由する処理により、情報処理装置100は、9バイト以下のデータ長である圧縮元データを復元する。
The
一方、参照先データのデータ長が9バイトより長い場合(ステップS4307:Yes)、以降の処理を実行する。情報処理装置100は、復元バッファ1800の格納済データの末尾の位置と、復元バッファ1800の先頭からレジスタ幅ごとに区切られた区間のうちで格納済データの末尾の位置を含む区間の末尾の位置と、の部分区間のデータ長を特定する。そして、情報処理装置100は、参照先データを先頭から、特定した部分区間のデータ長分のデータを、1バイト単位で取得して、復元バッファ1800に格納する(ステップS4310)。
On the other hand, when the data length of the reference destination data is longer than 9 bytes (step S4307: Yes), the subsequent processing is executed. The
次に、情報処理装置100は、取得した圧縮データを参照して、参照先データを、「8バイト単位」で分割して処理できるデータの個数を特定する。そして、情報処理装置100は、参照先データから部分区間のデータ長分のデータを取得して残ったデータを、先頭から、特定した個数分の「8バイト分」のデータを取得して、復元バッファ1800に格納する(ステップS4311)。
Next, the
次に、情報処理装置100は、取得した圧縮データを参照して、参照先データを、「1バイト単位」で処理すべき端数データ長を特定する。そして、情報処理装置100は、参照先データから個数分の「8バイト分」のデータを取得して残ったデータを、先頭から、1バイト単位で取得して、復元バッファ1800に格納する(ステップS4312)。
Next, the
次に、情報処理装置100は、判別ポインタ1810を「1バイト分」末尾側にシフトし、復元ポインタ1820を「圧縮データのデータ長分」末尾側にシフトする(ステップS4313)。そして、情報処理装置100は、ステップS4305に移行する。
Next, the
以上のステップS4301,S4302,S4306,S4307,S4310〜S4313,S4305を経由する処理により、情報処理装置100は、9バイトより長いデータ長である圧縮元データを復元する。
The
以上説明したように、情報処理装置100は、参照先データの先頭から、順に、復元バッファの書込先位置と書込先位置の次に出現するアラインされた位置との区間長分のデータを取得する。情報処理装置100は、その後、圧縮データを参照して、残りのデータのうち、レジスタ幅単位で圧縮データが示す個数分のデータに分割して取得し、レジスタ単位で分割して取得しきれなかったデータを1バイト単位で分割して取得する。このように、情報処理装置100は、プロセッサ201によりレジスタ幅分の非圧縮な参照先データをまとめて処理することにより、レジスタ幅分のデータを1バイトずつ順次処理するよりも、短時間で処理を終了することができる。
As described above, the
これにより、情報処理装置100は、レジスタ幅を効率的に活用して参照先データを処理することができ、データ復元の高速化を図ることができる。また、情報処理装置100は、復元した圧縮元データを復元バッファに格納する際に、復元バッファ内のアラインされて区切られた区間内に、レジスタ幅単位で分割して取得したデータを格納することができる。これにより、情報処理装置100は、格納するデータがアラインされて区切られた位置を跨がないようにして、データの格納にかかるアクセス回数の増大を抑制し、データ復元の高速化を図ることができる。
Thereby, the
また、圧縮を実行した他のプロセッサのレジスタ幅が、情報処理装置100のプロセッサ201のレジスタ幅の倍数である場合がある。この場合、情報処理装置100は、圧縮データが示すレジスタ幅単位で分割して取得できるデータの個数に、プロセッサ201のレジスタ幅に対する圧縮を実行した他のプロセッサのレジスタ幅の割合を乗じた個数を算出してもよい。また、情報処理装置100は、復元バッファの書込先位置と書込先位置の次に出現するアラインされた位置との区間長分を特定する。そして、情報処理装置100は、参照先データの先頭から、順に、区間長分のデータを取得した後、算出した個数分にレジスタ幅単位で分割したデータを取得し、端数データ長分のデータを取得する。これにより、圧縮を実行した他のプロセッサのレジスタ幅と、情報処理装置100のプロセッサ201のレジスタ幅と、が異なる場合であっても、データ復元が可能になる。
In addition, the register width of another processor that has performed compression may be a multiple of the register width of the
また、情報処理装置100は、復元を実行するプロセッサにおける復元バッファの書込先位置と書込先位置の次に出現するアラインされた位置との区間長を特定し、参照先データから特定した区間長分のデータを除いたデータ長を特定する。そして、情報処理装置100は、圧縮元データを、参照先データの位置と、上述の除いたデータ長分のデータのうち、レジスタ幅単位で分割して取得できるデータの個数と端数データ長とを示す圧縮データに圧縮する。
Further, the
これにより、圧縮データを復元するプロセッサ201が、圧縮データを参照して、データを復元することが可能になる。具体的には、例えば、プロセッサ201は、参照先データのうち、先頭から順に、特定した区間長分のデータを取得する。情報処理装置100は、その後、圧縮データを参照して、レジスタ幅単位で分割したデータを取得し、レジスタ幅単位で分割して取得しきれなかったデータを1バイト単位で分割して取得することにより、データを復元することができる。また、情報処理装置100は、参照先データのデータ長を8の倍数で表すことにより、参照先データのデータ長をそのまま表した場合に比べて、256バイト以上の参照先データに関しての圧縮効率を向上させることができる。
Thus, the
また、復元を実行する他のプロセッサのレジスタ幅が情報処理装置100のプロセッサ201のレジスタ幅の倍数である場合がある。この場合、情報処理装置100は、圧縮元データを、参照先データの位置と、上述の除いたデータ長分のデータのうち、当該レジスタ幅の倍数単位で分割して取得できるデータの個数と端数データ長とを示す圧縮データに圧縮する。これにより、復元を実行する他のプロセッサのレジスタ幅と、情報処理装置100のプロセッサ201のレジスタ幅と、が異なる場合であっても、データ圧縮が可能になる。
In addition, the register width of another processor that executes restoration may be a multiple of the register width of the
なお、本実施の形態で説明した圧縮方法または復元方法は、予め用意されたプログラムをパーソナル・コンピュータやワークステーション等のコンピュータで実行することにより実現することができる。本圧縮プログラムまたは本復元プログラムは、ハードディスク、フレキシブルディスク、CD−ROM、MO、DVD等のコンピュータで読み取り可能な記録媒体に記録され、コンピュータによって記録媒体から読み出されることによって実行される。また本圧縮プログラムまたは本復元プログラムは、インターネット等のネットワークを介して配布してもよい。 The compression method or decompression method described in this embodiment can be realized by executing a program prepared in advance on a computer such as a personal computer or a workstation. The compression program or the restoration program is recorded on a computer-readable recording medium such as a hard disk, a flexible disk, a CD-ROM, an MO, or a DVD, and is executed by being read from the recording medium by the computer. Further, the compression program or the restoration program may be distributed via a network such as the Internet.
上述した実施の形態に関し、さらに以下の付記を開示する。 The following additional notes are disclosed with respect to the embodiment described above.
(付記1)所定長のレジスタを有するプロセッサに、
参照先となる非圧縮データの参照位置、前記所定長以上である前記非圧縮データの長さを前記所定長で除した商および剰余を有する圧縮データと、前記非圧縮データとを含む圧縮データ列を記憶する記憶部の中から、前記圧縮データを検出し、
検出された圧縮データに含まれている参照位置から始まる参照先データのうち、前記所定長に前記商を乗じた長さとなる第1のデータ列を前記所定長単位で取得するとともに、前記参照先データから前記第1のデータ列を除いた前記剰余分の長さとなる第2のデータ列を取得し、
前記所定長単位で取得された第1のデータ列を所定の記憶領域に書き込むとともに、取得された第2のデータ列を前記所定の記憶領域に書き込む、
処理を実行させることを特徴とする復元プログラム。
(Appendix 1) To a processor having a register of a predetermined length,
A compressed data string including a reference position of uncompressed data to be a reference destination, compressed data having a quotient and a remainder obtained by dividing the length of the uncompressed data that is not less than the predetermined length by the predetermined length, and the uncompressed data Detecting the compressed data from the storage unit for storing
Among reference destination data starting from a reference position included in the detected compressed data, a first data string having a length obtained by multiplying the predetermined length by the quotient is obtained in the predetermined length unit, and the reference destination Obtaining a second data string having the extra length obtained by removing the first data string from data;
Writing the first data string acquired in units of the predetermined length to a predetermined storage area and writing the acquired second data string to the predetermined storage area;
A restoration program characterized by causing a process to be executed.
(付記2)前記取得する処理は、
検出された圧縮データに含まれている参照位置から始まる参照先データのうち、前記所定長の倍数に前記商を乗じた長さとなる第1のデータ列を前記所定長単位で取得するとともに、前記参照先データから前記第1のデータ列を除いた前記剰余分の長さとなる第2のデータ列を取得する、
ことを特徴とする付記1に記載の復元プログラム。
(Supplementary note 2)
Among the reference destination data starting from the reference position included in the detected compressed data, a first data string having a length obtained by multiplying a multiple of the predetermined length by the quotient is obtained in the predetermined length unit, and Obtaining a second data string having the extra length obtained by removing the first data string from reference destination data;
The restoration program according to
(付記3)所定長のレジスタを有するプロセッサに、
所定の記憶領域での書込先の位置と、前記所定の記憶領域の先頭から前記所定長単位で区切られた複数の位置のうち、前記書込先より末尾側にあり、かつ、前記書込先の位置から前記所定長分の範囲内にある位置と、の区間長を特定し、
参照先となる非圧縮データの参照位置、前記所定長以上である前記非圧縮データの長さから前記区間長を減じた長さを前記所定長で除した商および剰余を有する圧縮データと、前記非圧縮データとを含む圧縮データ列を記憶する記憶部の中から、前記圧縮データを検出し、
検出された圧縮データに含まれている参照位置から始まる参照先データの先頭から順に、前記区間長となる第1のデータ列と、前記所定長に前記商を乗じた長さとなる前記所定長単位の第2のデータ列と、前記剰余分の長さとなる第3のデータ列と、を取得し、
前記第1のデータ列、前記第2のデータ列、および前記第3のデータ列を前記所定の記憶領域における前記書込先の位置から取得順に書き込む、
処理を実行させることを特徴とする復元プログラム。
(Supplementary Note 3) To a processor having a register of a predetermined length,
Of the write destination position in a predetermined storage area and a plurality of positions delimited by the predetermined length unit from the beginning of the predetermined storage area, the write destination position is on the end side and the write Specify the section length between the previous position and the position within the predetermined length range,
A reference position of uncompressed data as a reference destination, compressed data having a quotient obtained by dividing the length of the uncompressed data that is equal to or longer than the predetermined length by the predetermined length and a remainder, and the remainder; The compressed data is detected from a storage unit that stores a compressed data string including uncompressed data,
In order from the beginning of the reference destination data starting from the reference position included in the detected compressed data, the first data string that is the section length, and the predetermined length unit that is the length obtained by multiplying the predetermined length by the quotient A second data string and a third data string having the extra length,
Writing the first data string, the second data string, and the third data string in the order of acquisition from the write destination position in the predetermined storage area;
A restoration program characterized by causing a process to be executed.
(付記4)前記取得する処理は、
検出された圧縮データに含まれている参照位置から始まる参照先データの先頭から順に、前記区間長となる第1のデータ列と、前記所定長の倍数に前記商を乗じた長さとなる前記所定長単位の第2のデータ列と、前記剰余分の長さとなる第3のデータ列と、を取得する、
ことを特徴とする付記3に記載の復元プログラム。
(Supplementary note 4)
In order from the beginning of the reference destination data starting from the reference position included in the detected compressed data, the first data string that is the section length, and the predetermined length that is a multiple of the predetermined length multiplied by the quotient Obtaining a second data string in a long unit and a third data string serving as the extra length;
The restoration program according to
(付記5)プロセッサに、
データ列を記憶する記憶部の中から、先行データと、前記先行データと同一のデータである後続データと、を検出し、
検出された前記先行データの位置、所定長以上である前記先行データの長さを前記所定長で除した商および剰余を有する圧縮データを生成し、
前記後続データを生成された圧縮データに置換した前記データ列を保存する、
処理を実行させることを特徴とする圧縮プログラム。
(Supplementary note 5)
Detecting preceding data and subsequent data that is the same data as the preceding data from the storage unit that stores the data string,
Generating the compressed data having the position of the detected preceding data, the quotient obtained by dividing the length of the preceding data that is equal to or longer than the predetermined length by the predetermined length, and the remainder;
Storing the data string in which the subsequent data is replaced with the generated compressed data;
A compression program characterized by causing processing to be executed.
(付記6)前記生成する処理は、
検出された前記先行データの位置、前記所定長以上である前記先行データの長さを前記所定長の倍数で除した商および剰余を有する圧縮データを生成する、
ことを特徴とする付記5に記載の圧縮プログラム。
(Appendix 6) The process to generate is
Generating the compressed data having the detected position of the preceding data, the quotient obtained by dividing the length of the preceding data that is not less than the predetermined length by a multiple of the predetermined length, and a remainder;
The compression program according to
(付記7)プロセッサに、
データ列を記憶する記憶部の中から、先行データと、前記先行データと同一のデータである後続データと、を検出し、
前記データ列での前記後続データの位置と、前記データ列の先頭から所定長単位で区切られた複数の位置のうち、前記後続データの位置より末尾側にあり、かつ、前記後続データの位置から前記所定長分の範囲内にある位置と、の区間長を特定し、
検出された前記先行データの位置、前記所定長以上である前記先行データの長さから前記区間長を減じた長さを前記所定長で除した商および剰余を有する圧縮データを生成し、
前記後続データを生成された圧縮データに置換した前記データ列を保存する、
処理を実行させることを特徴とする圧縮プログラム。
(Supplementary note 7)
Detecting preceding data and subsequent data that is the same data as the preceding data from the storage unit that stores the data string,
Of the position of the subsequent data in the data string and a plurality of positions delimited in units of a predetermined length from the head of the data string, the position is on the end side of the position of the subsequent data, and from the position of the subsequent data Specify the section length of the position within the predetermined length range,
Generating a compressed data having a quotient and a remainder obtained by dividing a length obtained by subtracting the section length from the position of the preceding data detected, the length of the preceding data that is equal to or longer than the predetermined length, and the predetermined length;
Storing the data string in which the subsequent data is replaced with the generated compressed data;
A compression program characterized by causing processing to be executed.
(付記8)前記生成する処理は、
検出された前記先行データの位置、前記所定長以上である前記先行データの長さから前記区間長を減じた長さを前記所定長の倍数で除した商および剰余を有する圧縮データを生成する、
ことを特徴とする付記7に記載の圧縮プログラム。
(Supplementary note 8) The process to generate is
Generating compressed data having a quotient and a remainder obtained by dividing a position obtained by subtracting the section length from the length of the preceding data which is equal to or greater than the predetermined length, the position of the detected preceding data, and a multiple of the predetermined length;
The compression program according to
(付記9)所定長のレジスタを有するプロセッサにより実行する復元装置であって、
参照先となる非圧縮データの参照位置、前記所定長以上である前記非圧縮データの長さを前記所定長で除した商および剰余を有する圧縮データと、前記非圧縮データとを含む圧縮データ列を記憶する記憶部と、
前記圧縮データを前記圧縮データ列の中から検出する検出部と、
前記検出部によって検出された圧縮データに含まれている参照位置から始まる参照先データ列のうち、前記所定長に前記商を乗じた長さとなる第1のデータ列を前記所定長単位で取得するとともに、前記参照先データ列から前記第1のデータ列を除いた前記剰余分の長さとなる第2のデータ列を取得する取得部と、
前記取得部によって前記所定長単位で取得された第1のデータ列を所定の記憶領域に書き込むとともに、前記取得部によって取得された第2のデータ列を前記所定の記憶領域に書き込む格納部と、
を有することを特徴とする復元装置。
(Supplementary note 9) A restoration device executed by a processor having a register of a predetermined length,
A compressed data string including a reference position of uncompressed data to be a reference destination, compressed data having a quotient and a remainder obtained by dividing the length of the uncompressed data that is not less than the predetermined length by the predetermined length, and the uncompressed data A storage unit for storing
A detection unit for detecting the compressed data from the compressed data string;
A first data string having a length obtained by multiplying the predetermined length by the quotient among reference destination data strings starting from a reference position included in the compressed data detected by the detection unit is acquired in units of the predetermined length. And an acquisition unit that acquires the second data string having the extra length obtained by removing the first data string from the reference data string;
A storage unit that writes the first data string acquired by the acquisition unit in the predetermined length unit to a predetermined storage area and writes the second data string acquired by the acquisition unit to the predetermined storage area;
A restoration apparatus comprising:
(付記10)所定長のレジスタを有するプロセッサにより実行する復元装置であって、
所定の記憶領域での書込先の位置と、前記所定の記憶領域の先頭から前記所定長単位で区切られた複数の位置のうち、前記書込先より末尾側にあり、かつ、前記書込先の位置から前記所定長分の範囲内にある位置と、の区間長を特定する特定部と、
参照先となる非圧縮データの参照位置、前記所定長以上である前記非圧縮データの長さから前記区間長を減じた長さを前記所定長で除した商および剰余を有する圧縮データと、前記非圧縮データとを含む圧縮データ列を記憶する記憶部と、
前記圧縮データ列の中から、前記圧縮データを検出する検出部と、
前記検出部によって検出された圧縮データに含まれている参照位置から始まる参照先データの先頭から順に、前記区間長となる第1のデータ列と、前記所定長に前記商を乗じた長さとなる前記所定長単位の第2のデータ列と、前記剰余分の長さとなる第3のデータ列と、を取得する取得部と、
前記取得部によって取得された前記第1のデータ列、前記第2のデータ列、および前記第3のデータ列を前記所定の記憶領域における前記書込先の位置から取得順に書き込む格納部と、
を有することを特徴とする復元装置。
(Supplementary Note 10) A restoration device executed by a processor having a register of a predetermined length,
Of the write destination position in a predetermined storage area and a plurality of positions delimited by the predetermined length unit from the beginning of the predetermined storage area, the write destination position is on the end side and the write A position that is within the range of the predetermined length from the previous position, and a specifying unit that specifies a section length;
A reference position of uncompressed data as a reference destination, compressed data having a quotient obtained by dividing the length of the uncompressed data that is equal to or longer than the predetermined length by the predetermined length and a remainder, and the remainder; A storage unit for storing a compressed data string including uncompressed data;
A detection unit for detecting the compressed data from the compressed data string;
In order from the beginning of the reference destination data starting from the reference position included in the compressed data detected by the detection unit, the first data string that is the section length and the length obtained by multiplying the predetermined length by the quotient An acquisition unit that acquires the second data string in the predetermined length unit and the third data string serving as the extra length;
A storage unit that writes the first data string, the second data string, and the third data string acquired by the acquisition unit in the order of acquisition from the write destination position in the predetermined storage area;
A restoration apparatus comprising:
(付記11)プロセッサにより実行する圧縮装置であって、
データ列を記憶する記憶部と、
前記データ列の中から、先行データと、前記先行データと同一のデータである後続データと、を検出する検出部と、
前記検出部によって検出された前記先行データの位置、所定長以上である前記先行データの長さを前記所定長で除した商および剰余を有する圧縮データを生成する生成部と、
前記後続データを、前記生成部によって生成された圧縮データに置換した前記データ列を保存する保存部と、
を有することを特徴とする圧縮装置。
(Supplementary note 11) A compression device executed by a processor,
A storage unit for storing the data string;
A detection unit that detects preceding data and subsequent data that is the same data as the preceding data from the data string;
A generation unit that generates compressed data having a quotient and a remainder obtained by dividing the position of the preceding data detected by the detection unit, the length of the preceding data that is equal to or longer than a predetermined length by the predetermined length;
A storage unit for storing the data string obtained by replacing the subsequent data with the compressed data generated by the generation unit;
A compression apparatus comprising:
(付記12)プロセッサにより実行する圧縮装置であって、
データ列を記憶する記憶部と、
前記データ列の中から、先行データと、前記先行データと同一のデータである後続データと、を検出する検出部と、
前記データ列での前記後続データの位置と、前記データ列の先頭から所定長単位で区切られた複数の位置のうち、前記後続データの位置より末尾側にあり、かつ、前記後続データの位置から前記所定長分の範囲内にある位置と、の区間長を特定する特定部と、
前記検出部によって検出された前記先行データの位置、前記所定長以上である前記先行データの長さから前記区間長を減じた長さを前記所定長で除した商および剰余を有する圧縮データを生成する生成部と、
前記後続データを、前記生成部によって生成された圧縮データに置換した前記データ列を保存する保存部と、
を有することを特徴とする圧縮装置。
(Supplementary note 12) A compression device executed by a processor,
A storage unit for storing the data string;
A detection unit that detects preceding data and subsequent data that is the same data as the preceding data from the data string;
Of the position of the subsequent data in the data string and a plurality of positions delimited in units of a predetermined length from the head of the data string, the position is on the end side of the position of the subsequent data, and from the position of the subsequent data A position that is within the range of the predetermined length, and a specifying unit that specifies a section length;
Generates compressed data having a quotient and a remainder obtained by dividing the position of the preceding data detected by the detection unit, the length of the preceding data that is equal to or greater than the predetermined length, by subtracting the section length by the predetermined length A generator to
A storage unit for storing the data string obtained by replacing the subsequent data with the compressed data generated by the generation unit;
A compression apparatus comprising:
(付記13)所定長のレジスタを有するプロセッサが、
参照先となる非圧縮データの参照位置、前記所定長以上である前記非圧縮データの長さを前記所定長で除した商および剰余を有する圧縮データと、前記非圧縮データとを含む圧縮データ列を記憶する記憶部の中から、前記圧縮データを検出し、
検出された圧縮データに含まれている参照位置から始まる参照先データ列のうち、前記所定長に前記商を乗じた長さとなる第1のデータ列を前記所定長単位で取得するとともに、前記参照先データ列から前記第1のデータ列を除いた前記剰余分の長さとなる第2のデータ列を取得し、
前記所定長単位で取得された第1のデータ列を所定の記憶領域に書き込むとともに、取得された第2のデータ列を前記所定の記憶領域に書き込む、
処理を実行することを特徴とする復元方法。
(Supplementary note 13) A processor having a register of a predetermined length is
A compressed data string including a reference position of uncompressed data to be a reference destination, compressed data having a quotient and a remainder obtained by dividing the length of the uncompressed data that is not less than the predetermined length by the predetermined length, and the uncompressed data Detecting the compressed data from the storage unit for storing
Among reference destination data strings starting from a reference position included in the detected compressed data, a first data string having a length obtained by multiplying the predetermined length by the quotient is obtained in the predetermined length unit, and the reference Obtaining a second data string having the extra length obtained by removing the first data string from a previous data string;
Writing the first data string acquired in units of the predetermined length to a predetermined storage area and writing the acquired second data string to the predetermined storage area;
A restoration method characterized by executing processing.
(付記14)所定長のレジスタを有するプロセッサが、
所定の記憶領域での書込先の位置と、前記所定の記憶領域の先頭から前記所定長単位で区切られた複数の位置のうち、前記書込先より末尾側にあり、かつ、前記書込先の位置から前記所定長分の範囲内にある位置と、の区間長を特定し、
参照先となる非圧縮データの参照位置、前記所定長以上である前記非圧縮データの長さから前記区間長を減じた長さを前記所定長で除した商および剰余を有する圧縮データと、前記非圧縮データとを含む圧縮データ列を記憶する記憶部の中から、前記圧縮データを検出し、
検出された圧縮データに含まれている参照位置から始まる参照先データの先頭から順に、前記区間長となる第1のデータ列と、前記所定長に前記商を乗じた長さとなる前記所定長単位の第2のデータ列と、前記剰余分の長さとなる第3のデータ列と、を取得し、
前記第1のデータ列、前記第2のデータ列、および前記第3のデータ列を前記所定の記憶領域における前記書込先の位置から取得順に書き込む、
処理を実行することを特徴とする復元方法。
(Supplementary Note 14) A processor having a register of a predetermined length is
Of the write destination position in a predetermined storage area and a plurality of positions delimited by the predetermined length unit from the beginning of the predetermined storage area, the write destination position is on the end side and the write Specify the section length between the previous position and the position within the predetermined length range,
A reference position of uncompressed data as a reference destination, compressed data having a quotient obtained by dividing the length of the uncompressed data that is equal to or longer than the predetermined length by the predetermined length and a remainder, and the remainder; The compressed data is detected from a storage unit that stores a compressed data string including uncompressed data,
In order from the beginning of the reference destination data starting from the reference position included in the detected compressed data, the first data string that is the section length, and the predetermined length unit that is the length obtained by multiplying the predetermined length by the quotient A second data string and a third data string having the extra length,
Writing the first data string, the second data string, and the third data string in the order of acquisition from the write destination position in the predetermined storage area;
A restoration method characterized by executing processing.
(付記15)プロセッサが、
データ列を記憶する記憶部の中から、先行データと、前記先行データと同一のデータである後続データと、を検出し、
検出された前記先行データの位置、所定長以上である前記先行データの長さを前記所定長で除した商および剰余を有する圧縮データを生成し、
前記後続データを生成された圧縮データに置換した前記データ列を保存する、
処理を実行することを特徴とする圧縮方法。
(Supplementary note 15)
Detecting preceding data and subsequent data that is the same data as the preceding data from the storage unit that stores the data string,
Generating the compressed data having the position of the detected preceding data, the quotient obtained by dividing the length of the preceding data that is equal to or longer than the predetermined length by the predetermined length, and the remainder;
Storing the data string in which the subsequent data is replaced with the generated compressed data;
A compression method characterized by executing processing.
(付記16)プロセッサが、
データ列を記憶する記憶部の中から、先行データと、前記先行データと同一のデータである後続データと、を検出し、
前記データ列での前記後続データの位置と、前記データ列の先頭から所定長単位で区切られた複数の位置のうち、前記後続データの位置より末尾側にあり、かつ、前記後続データの位置から前記所定長分の範囲内にある位置と、の区間長を特定し、
検出された前記先行データの位置、前記所定長以上である前記先行データの長さから前記区間長を減じた長さを前記所定長で除した商および剰余を有する圧縮データを生成し、
前記後続データを生成された圧縮データに置換した前記データ列を保存する、
処理を実行することを特徴とする圧縮方法。
(Supplementary Note 16) The processor
Detecting preceding data and subsequent data that is the same data as the preceding data from the storage unit that stores the data string,
Of the position of the subsequent data in the data string and a plurality of positions delimited in units of a predetermined length from the head of the data string, the position is on the end side of the position of the subsequent data, and from the position of the subsequent data Specify the section length of the position within the predetermined length range,
Generating a compressed data having a quotient and a remainder obtained by dividing a length obtained by subtracting the section length from the position of the preceding data detected, the length of the preceding data that is equal to or longer than the predetermined length, and the predetermined length;
Storing the data string in which the subsequent data is replaced with the generated compressed data;
A compression method characterized by executing processing.
100 情報処理装置
2501,3601 特定部
301,1701,2502,3602 記憶部
302,1702,2503,3603 検出部
303,2504 生成部
304,2505 保存部
1703,3604 取得部
1704,3605 格納部
DESCRIPTION OF
Claims (12)
参照先となる非圧縮データの参照位置、前記所定長以上である前記非圧縮データの長さを前記所定長で除した商および剰余を有する圧縮データと、前記非圧縮データとを含む圧縮データ列を記憶する記憶部の中から、前記圧縮データを検出し、
検出された圧縮データに含まれている参照位置から始まる参照先データのうち、前記所定長に前記商を乗じた長さとなる第1のデータ列を前記所定長単位で取得するとともに、前記参照先データから前記第1のデータ列を除いた前記剰余分の長さとなる第2のデータ列を取得し、
前記所定長単位で取得された第1のデータ列を所定の記憶領域に書き込むとともに、取得された第2のデータ列を前記所定の記憶領域に書き込む、
処理を実行させることを特徴とする復元プログラム。 To a processor having a register of a predetermined length,
A compressed data string including a reference position of uncompressed data to be a reference destination, compressed data having a quotient and a remainder obtained by dividing the length of the uncompressed data that is not less than the predetermined length by the predetermined length, and the uncompressed data Detecting the compressed data from the storage unit for storing
Among reference destination data starting from a reference position included in the detected compressed data, a first data string having a length obtained by multiplying the predetermined length by the quotient is obtained in the predetermined length unit, and the reference destination Obtaining a second data string having the extra length obtained by removing the first data string from data;
Writing the first data string acquired in units of the predetermined length to a predetermined storage area and writing the acquired second data string to the predetermined storage area;
A restoration program characterized by causing a process to be executed.
所定の記憶領域での書込先の位置と、前記所定の記憶領域の先頭から前記所定長単位で区切られた複数の位置のうち、前記書込先より末尾側にあり、かつ、前記書込先の位置から前記所定長分の範囲内にある位置と、の区間長を特定し、
参照先となる非圧縮データの参照位置、前記所定長以上である前記非圧縮データの長さから前記区間長を減じた長さを前記所定長で除した商および剰余を有する圧縮データと、前記非圧縮データとを含む圧縮データ列を記憶する記憶部の中から、前記圧縮データを検出し、
検出された圧縮データに含まれている参照位置から始まる参照先データの先頭から順に、前記区間長となる第1のデータ列と、前記所定長に前記商を乗じた長さとなる前記所定長単位の第2のデータ列と、前記剰余分の長さとなる第3のデータ列と、を取得し、
前記第1のデータ列、前記第2のデータ列、および前記第3のデータ列を前記所定の記憶領域における前記書込先の位置から取得順に書き込む、
処理を実行させることを特徴とする復元プログラム。 To a processor having a register of a predetermined length,
Of the write destination position in a predetermined storage area and a plurality of positions delimited by the predetermined length unit from the beginning of the predetermined storage area, the write destination position is on the end side and the write Specify the section length between the previous position and the position within the predetermined length range,
A reference position of uncompressed data as a reference destination, compressed data having a quotient obtained by dividing the length of the uncompressed data that is equal to or longer than the predetermined length by the predetermined length and a remainder, and the remainder; The compressed data is detected from a storage unit that stores a compressed data string including uncompressed data,
In order from the beginning of the reference destination data starting from the reference position included in the detected compressed data, the first data string that is the section length, and the predetermined length unit that is the length obtained by multiplying the predetermined length by the quotient A second data string and a third data string having the extra length,
Writing the first data string, the second data string, and the third data string in the order of acquisition from the write destination position in the predetermined storage area;
A restoration program characterized by causing a process to be executed.
データ列を記憶する記憶部の中から、先行データと、前記先行データと同一のデータである後続データと、を検出し、
検出された前記先行データの位置、復元を実行するプロセッサが有するレジスタの長さとなる所定長以上である前記先行データの長さを前記所定長で除した商および剰余を有する圧縮データを生成し、
前記後続データを生成された圧縮データに置換した前記データ列を保存する、
処理を実行させることを特徴とする圧縮プログラム。 To the processor,
Detecting preceding data and subsequent data that is the same data as the preceding data from the storage unit that stores the data string,
Generating compressed data having a quotient and a remainder obtained by dividing the length of the preceding data by a predetermined length that is equal to or longer than a predetermined length that is a length of a register included in the position of the detected preceding data and a processor that performs restoration ;
Storing the data string in which the subsequent data is replaced with the generated compressed data;
A compression program characterized by causing processing to be executed.
データ列を記憶する記憶部の中から、先行データと、前記先行データと同一のデータである後続データと、を検出し、
前記データ列での前記後続データの位置と、前記データ列の先頭から所定長単位で区切られた複数の位置のうち、前記後続データの位置より末尾側にあり、かつ、前記後続データの位置から前記所定長分の範囲内にある位置と、の区間長を特定し、
検出された前記先行データの位置、前記所定長以上である前記先行データの長さから前記区間長を減じた長さを前記所定長で除した商および剰余を有する圧縮データを生成し、
前記後続データを生成された圧縮データに置換した前記データ列を保存する、
処理を実行させることを特徴とする圧縮プログラム。 To the processor,
Detecting preceding data and subsequent data that is the same data as the preceding data from the storage unit that stores the data string,
Of the position of the subsequent data in the data string and a plurality of positions delimited in units of a predetermined length from the head of the data string, the position is on the end side of the position of the subsequent data, and from the position of the subsequent data Specify the section length of the position within the predetermined length range,
Generating a compressed data having a quotient and a remainder obtained by dividing a length obtained by subtracting the section length from the position of the preceding data detected, the length of the preceding data that is equal to or longer than the predetermined length, and the predetermined length;
Storing the data string in which the subsequent data is replaced with the generated compressed data;
A compression program characterized by causing processing to be executed.
参照先となる非圧縮データの参照位置、前記所定長以上である前記非圧縮データの長さを前記所定長で除した商および剰余を有する圧縮データと、前記非圧縮データとを含む圧縮データ列を記憶する記憶部と、
前記圧縮データを前記圧縮データ列の中から検出する検出部と、
前記検出部によって検出された圧縮データに含まれている参照位置から始まる参照先データ列のうち、前記所定長に前記商を乗じた長さとなる第1のデータ列を前記所定長単位で取得するとともに、前記参照先データ列から前記第1のデータ列を除いた前記剰余分の長さとなる第2のデータ列を取得する取得部と、
前記取得部によって前記所定長単位で取得された第1のデータ列を所定の記憶領域に書き込むとともに、前記取得部によって取得された第2のデータ列を前記所定の記憶領域に書き込む格納部と、
を有することを特徴とする復元装置。 A restoration device executed by a processor having a register of a predetermined length,
A compressed data string including a reference position of uncompressed data to be a reference destination, compressed data having a quotient and a remainder obtained by dividing the length of the uncompressed data that is not less than the predetermined length by the predetermined length, and the uncompressed data A storage unit for storing
A detection unit for detecting the compressed data from the compressed data string;
A first data string having a length obtained by multiplying the predetermined length by the quotient among reference destination data strings starting from a reference position included in the compressed data detected by the detection unit is acquired in units of the predetermined length. And an acquisition unit that acquires the second data string having the extra length obtained by removing the first data string from the reference data string;
A storage unit that writes the first data string acquired by the acquisition unit in the predetermined length unit to a predetermined storage area and writes the second data string acquired by the acquisition unit to the predetermined storage area;
A restoration apparatus comprising:
所定の記憶領域での書込先の位置と、前記所定の記憶領域の先頭から前記所定長単位で区切られた複数の位置のうち、前記書込先より末尾側にあり、かつ、前記書込先の位置から前記所定長分の範囲内にある位置と、の区間長を特定する特定部と、
参照先となる非圧縮データの参照位置、前記所定長以上である前記非圧縮データの長さから前記区間長を減じた長さを前記所定長で除した商および剰余を有する圧縮データと、前記非圧縮データとを含む圧縮データ列を記憶する記憶部と、
前記圧縮データ列の中から、前記圧縮データを検出する検出部と、
前記検出部によって検出された圧縮データに含まれている参照位置から始まる参照先データの先頭から順に、前記区間長となる第1のデータ列と、前記所定長に前記商を乗じた長さとなる前記所定長単位の第2のデータ列と、前記剰余分の長さとなる第3のデータ列と、を取得する取得部と、
前記取得部によって取得された前記第1のデータ列、前記第2のデータ列、および前記第3のデータ列を前記所定の記憶領域における前記書込先の位置から取得順に書き込む格納部と、
を有することを特徴とする復元装置。 A restoration device executed by a processor having a register of a predetermined length,
Of the write destination position in a predetermined storage area and a plurality of positions delimited by the predetermined length unit from the beginning of the predetermined storage area, the write destination position is on the end side and the write A position that is within the range of the predetermined length from the previous position, and a specifying unit that specifies a section length;
A reference position of uncompressed data as a reference destination, compressed data having a quotient obtained by dividing the length of the uncompressed data that is equal to or longer than the predetermined length by the predetermined length and a remainder, and the remainder; A storage unit for storing a compressed data string including uncompressed data;
A detection unit for detecting the compressed data from the compressed data string;
In order from the beginning of the reference destination data starting from the reference position included in the compressed data detected by the detection unit, the first data string that is the section length and the length obtained by multiplying the predetermined length by the quotient An acquisition unit that acquires the second data string in the predetermined length unit and the third data string serving as the extra length;
A storage unit that writes the first data string, the second data string, and the third data string acquired by the acquisition unit in the order of acquisition from the write destination position in the predetermined storage area;
A restoration apparatus comprising:
データ列を記憶する記憶部と、
前記データ列の中から、先行データと、前記先行データと同一のデータである後続データと、を検出する検出部と、
前記検出部によって検出された前記先行データの位置、復元を実行するプロセッサが有するレジスタの長さとなる所定長以上である前記先行データの長さを前記所定長で除した商および剰余を有する圧縮データを生成する生成部と、
前記後続データを、前記生成部によって生成された圧縮データに置換した前記データ列を保存する保存部と、
を有することを特徴とする圧縮装置。 A compression device executed by a processor,
A storage unit for storing the data string;
A detection unit that detects preceding data and subsequent data that is the same data as the preceding data from the data string;
Compressed data having a quotient and remainder obtained by dividing the position of the preceding data detected by the detection unit, the length of the preceding data that is equal to or greater than the length of the register included in the processor that performs restoration, by the predetermined length A generating unit for generating
A storage unit for storing the data string obtained by replacing the subsequent data with the compressed data generated by the generation unit;
A compression apparatus comprising:
データ列を記憶する記憶部と、
前記データ列の中から、先行データと、前記先行データと同一のデータである後続データと、を検出する検出部と、
前記データ列での前記後続データの位置と、前記データ列の先頭から所定長単位で区切られた複数の位置のうち、前記後続データの位置より末尾側にあり、かつ、前記後続データの位置から前記所定長分の範囲内にある位置と、の区間長を特定する特定部と、
前記検出部によって検出された前記先行データの位置、前記所定長以上である前記先行データの長さから前記区間長を減じた長さを前記所定長で除した商および剰余を有する圧縮データを生成する生成部と、
前記後続データを、前記生成部によって生成された圧縮データに置換した前記データ列を保存する保存部と、
を有することを特徴とする圧縮装置。 A compression device executed by a processor,
A storage unit for storing the data string;
A detection unit that detects preceding data and subsequent data that is the same data as the preceding data from the data string;
Of the position of the subsequent data in the data string and a plurality of positions delimited in units of a predetermined length from the head of the data string, the position is on the end side of the position of the subsequent data, and from the position of the subsequent data A position that is within the range of the predetermined length, and a specifying unit that specifies a section length;
Generates compressed data having a quotient and a remainder obtained by dividing the position of the preceding data detected by the detection unit, the length of the preceding data that is equal to or greater than the predetermined length, by subtracting the section length by the predetermined length A generator to
A storage unit for storing the data string obtained by replacing the subsequent data with the compressed data generated by the generation unit;
A compression apparatus comprising:
参照先となる非圧縮データの参照位置、前記所定長以上である前記非圧縮データの長さを前記所定長で除した商および剰余を有する圧縮データと、前記非圧縮データとを含む圧縮データ列を記憶する記憶部の中から、前記圧縮データを検出し、
検出された圧縮データに含まれている参照位置から始まる参照先データ列のうち、前記所定長に前記商を乗じた長さとなる第1のデータ列を前記所定長単位で取得するとともに、前記参照先データ列から前記第1のデータ列を除いた前記剰余分の長さとなる第2のデータ列を取得し、
前記所定長単位で取得された第1のデータ列を所定の記憶領域に書き込むとともに、取得された第2のデータ列を前記所定の記憶領域に書き込む、
処理を実行することを特徴とする復元方法。 A processor having a register of a predetermined length
A compressed data string including a reference position of uncompressed data to be a reference destination, compressed data having a quotient and a remainder obtained by dividing the length of the uncompressed data that is not less than the predetermined length by the predetermined length, and the uncompressed data Detecting the compressed data from the storage unit for storing
Among reference destination data strings starting from a reference position included in the detected compressed data, a first data string having a length obtained by multiplying the predetermined length by the quotient is obtained in the predetermined length unit, and the reference Obtaining a second data string having the extra length obtained by removing the first data string from a previous data string;
Writing the first data string acquired in units of the predetermined length to a predetermined storage area and writing the acquired second data string to the predetermined storage area;
A restoration method characterized by executing processing.
所定の記憶領域での書込先の位置と、前記所定の記憶領域の先頭から前記所定長単位で区切られた複数の位置のうち、前記書込先より末尾側にあり、かつ、前記書込先の位置から前記所定長分の範囲内にある位置と、の区間長を特定し、
参照先となる非圧縮データの参照位置、前記所定長以上である前記非圧縮データの長さから前記区間長を減じた長さを前記所定長で除した商および剰余を有する圧縮データと、前記非圧縮データとを含む圧縮データ列を記憶する記憶部の中から、前記圧縮データを検出し、
検出された圧縮データに含まれている参照位置から始まる参照先データの先頭から順に、前記区間長となる第1のデータ列と、前記所定長に前記商を乗じた長さとなる前記所定長単位の第2のデータ列と、前記剰余分の長さとなる第3のデータ列と、を取得し、
前記第1のデータ列、前記第2のデータ列、および前記第3のデータ列を前記所定の記憶領域における前記書込先の位置から取得順に書き込む、
処理を実行することを特徴とする復元方法。 A processor having a register of a predetermined length
Of the write destination position in a predetermined storage area and a plurality of positions delimited by the predetermined length unit from the beginning of the predetermined storage area, the write destination position is on the end side and the write Specify the section length between the previous position and the position within the predetermined length range,
A reference position of uncompressed data as a reference destination, compressed data having a quotient obtained by dividing the length of the uncompressed data that is equal to or longer than the predetermined length by the predetermined length and a remainder, and the remainder; The compressed data is detected from a storage unit that stores a compressed data string including uncompressed data,
In order from the beginning of the reference destination data starting from the reference position included in the detected compressed data, the first data string that is the section length, and the predetermined length unit that is the length obtained by multiplying the predetermined length by the quotient A second data string and a third data string having the extra length,
Writing the first data string, the second data string, and the third data string in the order of acquisition from the write destination position in the predetermined storage area;
A restoration method characterized by executing processing.
データ列を記憶する記憶部の中から、先行データと、前記先行データと同一のデータである後続データと、を検出し、
検出された前記先行データの位置、復元を実行するプロセッサが有するレジスタの長さとなる所定長以上である前記先行データの長さを前記所定長で除した商および剰余を有する圧縮データを生成し、
前記後続データを生成された圧縮データに置換した前記データ列を保存する、
処理を実行することを特徴とする圧縮方法。 Processor
Detecting preceding data and subsequent data that is the same data as the preceding data from the storage unit that stores the data string,
Generating compressed data having a quotient and a remainder obtained by dividing the length of the preceding data by a predetermined length that is equal to or longer than a predetermined length that is a length of a register included in the position of the detected preceding data and a processor that performs restoration ;
Storing the data string in which the subsequent data is replaced with the generated compressed data;
A compression method characterized by executing processing.
データ列を記憶する記憶部の中から、先行データと、前記先行データと同一のデータである後続データと、を検出し、
前記データ列での前記後続データの位置と、前記データ列の先頭から所定長単位で区切られた複数の位置のうち、前記後続データの位置より末尾側にあり、かつ、前記後続データの位置から前記所定長分の範囲内にある位置と、の区間長を特定し、
検出された前記先行データの位置、前記所定長以上である前記先行データの長さから前記区間長を減じた長さを前記所定長で除した商および剰余を有する圧縮データを生成し、
前記後続データを生成された圧縮データに置換した前記データ列を保存する、
処理を実行することを特徴とする圧縮方法。
Processor
Detecting preceding data and subsequent data that is the same data as the preceding data from the storage unit that stores the data string,
Of the position of the subsequent data in the data string and a plurality of positions delimited in units of a predetermined length from the head of the data string, the position is on the end side of the position of the subsequent data, and from the position of the subsequent data Specify the section length of the position within the predetermined length range,
Generating a compressed data having a quotient and a remainder obtained by dividing a length obtained by subtracting the section length from the position of the preceding data detected, the length of the preceding data that is equal to or longer than the predetermined length, and the predetermined length;
Storing the data string in which the subsequent data is replaced with the generated compressed data;
A compression method characterized by executing processing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012153060A JP5928201B2 (en) | 2012-07-06 | 2012-07-06 | RESTORE PROGRAM, COMPRESSION PROGRAM, RESTORE DEVICE, COMPRESSION DEVICE, RESTORE METHOD, AND COMPRESSION METHOD |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012153060A JP5928201B2 (en) | 2012-07-06 | 2012-07-06 | RESTORE PROGRAM, COMPRESSION PROGRAM, RESTORE DEVICE, COMPRESSION DEVICE, RESTORE METHOD, AND COMPRESSION METHOD |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2014017629A JP2014017629A (en) | 2014-01-30 |
JP5928201B2 true JP5928201B2 (en) | 2016-06-01 |
Family
ID=50111960
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2012153060A Expired - Fee Related JP5928201B2 (en) | 2012-07-06 | 2012-07-06 | RESTORE PROGRAM, COMPRESSION PROGRAM, RESTORE DEVICE, COMPRESSION DEVICE, RESTORE METHOD, AND COMPRESSION METHOD |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5928201B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10305508B2 (en) * | 2018-05-11 | 2019-05-28 | Intel Corporation | System for compressing floating point data |
CN114095570B (en) * | 2021-11-24 | 2023-08-18 | 国网河北省电力有限公司电力科学研究院 | Data transmission method for power transmission and transformation Internet of things and power transmission and transformation Internet of things |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000250718A (en) * | 1999-02-25 | 2000-09-14 | Fuji Xerox Co Ltd | Image compressing/extending device |
JP2000350045A (en) * | 1999-06-03 | 2000-12-15 | Nec Ic Microcomput Syst Ltd | Coding/decoding method and device |
JP4399965B2 (en) * | 2000-07-25 | 2010-01-20 | コニカミノルタビジネステクノロジーズ株式会社 | Printing apparatus and printing method |
JP3889762B2 (en) * | 2002-12-26 | 2007-03-07 | 富士通株式会社 | Data compression method, program, and apparatus |
JP4093200B2 (en) * | 2004-03-26 | 2008-06-04 | セイコーエプソン株式会社 | Data compression method and program, and data restoration method and apparatus |
-
2012
- 2012-07-06 JP JP2012153060A patent/JP5928201B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2014017629A (en) | 2014-01-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR100894002B1 (en) | Device and data method for selective compression and decompression and data format for compressed data | |
EP0584992B1 (en) | Text compression technique using frequency ordered array of word number mappers | |
US4814746A (en) | Data compression method | |
US5374916A (en) | Automatic electronic data type identification process | |
US10305512B2 (en) | Encoding method and apparatus | |
KR101049699B1 (en) | Data Compression Method | |
JP3778087B2 (en) | Data encoding apparatus and data decoding apparatus | |
KR101725223B1 (en) | Data compressing method of storage device | |
JPH0682370B2 (en) | Character processor | |
JPS6148298B2 (en) | ||
EP0127815B1 (en) | Data compression method | |
JP2019036810A (en) | Data compression apparatus, data restoration apparatus, data compression program, data restoration program, data compression method, and data restoration method | |
JP5656593B2 (en) | Apparatus and method for decoding encoded data | |
KR20150092585A (en) | DNA data compression Method and Apparatus based on binary image | |
JP5928201B2 (en) | RESTORE PROGRAM, COMPRESSION PROGRAM, RESTORE DEVICE, COMPRESSION DEVICE, RESTORE METHOD, AND COMPRESSION METHOD | |
US6834283B1 (en) | Data compression/decompression apparatus using additional code and method thereof | |
JP2015534795A (en) | Secure and lossless data compression | |
US8463759B2 (en) | Method and system for compressing data | |
JP4953145B2 (en) | Character string data compression apparatus and method, and character string data restoration apparatus and method | |
CN112506876B (en) | Lossless compression query method supporting SQL query | |
JP2005004560A (en) | Inverted file creation method | |
GB2510198A (en) | Method and device for encoding a header in a message using an indexing table | |
JPH0546357A (en) | Compressing method and restoring method for text data | |
JP2004013680A (en) | Character code compression/decompression device and method | |
JP2005269184A (en) | Data compression method and program, and data restoration method and apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20150406 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20151216 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20151222 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20160222 |
|
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: 20160329 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20160411 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5928201 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |