JP2005252531A - Device and program for compressing data - Google Patents

Device and program for compressing data Download PDF

Info

Publication number
JP2005252531A
JP2005252531A JP2004058645A JP2004058645A JP2005252531A JP 2005252531 A JP2005252531 A JP 2005252531A JP 2004058645 A JP2004058645 A JP 2004058645A JP 2004058645 A JP2004058645 A JP 2004058645A JP 2005252531 A JP2005252531 A JP 2005252531A
Authority
JP
Japan
Prior art keywords
data
data compression
numerical values
compressed
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP2004058645A
Other languages
Japanese (ja)
Inventor
Yukio Sugita
由紀夫 杉田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujifilm Holdings Corp
Original Assignee
Fuji Photo Film Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Photo Film Co Ltd filed Critical Fuji Photo Film Co Ltd
Priority to JP2004058645A priority Critical patent/JP2005252531A/en
Priority to US11/042,535 priority patent/US7684629B2/en
Publication of JP2005252531A publication Critical patent/JP2005252531A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To increase compressibility for a data compressing device, or the like for performing data compression processing to data to be compressed, comprising a sequence of numerical values indicated by a prescribed number of unit bits. <P>SOLUTION: There are a run length coder 550 and a binary coder 530. At the run-length coder 550, a numeric value except one or a plurality of prescribed numerical values to be compressed in the data to be compressed is outputted, as it is, and coding is performed to a numerical value to be compressed and a numerical value for indicating the continuous number of the same numerical values to be compressed as the numerical value to be compressed for outputting for the numerical value to be compressed. At the binary coder 530, two kinds of numerical values are identified by 1 bit, for bringing together the sequence of 1 bit for each number of unit bits, when the data to be compressed are binary data expressed by the two kinds of numerical values only, thus generating new data to be compressed comprising the sequence of numerical values indicated by the number of unit bits for passing to the run-length coder 550. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、画像データ等のデータを圧縮するデータ圧縮装置、およびコンピュータ等の情報処理装置をデータ圧縮装置として動作させるデータ圧縮プログラムに関する。   The present invention relates to a data compression apparatus that compresses data such as image data, and a data compression program that causes an information processing apparatus such as a computer to operate as a data compression apparatus.

従来より、記憶容量の低減化や通信量の低減化等のために、画像データ等のデータを圧縮する技術が広く採用されている。   2. Description of the Related Art Conventionally, techniques for compressing data such as image data have been widely adopted in order to reduce storage capacity and communication volume.

例えば、特許文献1には、原画像から代表色を選定しCLUT(カラールックアップテーブル)を構成する際に、連続する色番号が近い値の色データを持つように色番号を割り当て、次にCLUTに対応したビットマップを作成して隣接画素間の色番号の差分を求め、差分が大きな値を取る場合、画質劣化を起こさない範囲でビットマップの色番号を変更し、差分を小さな値に偏らせ、差分データに対してランレングス符号化を施すという技術が開示されている。   For example, in Patent Document 1, when a representative color is selected from an original image and a CLUT (color look-up table) is configured, color numbers are assigned so that continuous color numbers have color data of close values, When a bitmap corresponding to the CLUT is created to obtain the difference in color number between adjacent pixels, and the difference takes a large value, the color number of the bitmap is changed within a range that does not cause image quality degradation, and the difference is set to a small value. A technique is disclosed in which run length encoding is applied to biased and differential data.

また、特許文献2には、各色に対応してそれぞれ割り当てられたデータが複数集まって構成される画像用データを非可逆圧縮して符号化し、そして、データの1つを透明色に割り当てると共に、その透明色を可逆とし、画像用データを即値(差分符号化の際の最初の値)とその即値に続く複数の差分値(差分符号化の際の前の値)とで構成し、それらの値を非可逆圧縮して符号化等する際、透明色を表す即値と差分値とを可逆とし、さらに、透明色を表す即値を、各一色のデータ値の中間の値としたり、透明色を表す差分値を「0」としたりするという技術が提案されている。   Further, Patent Document 2 encodes image data configured by irreversibly compressing a plurality of data assigned to each color and assigning one of the data to a transparent color, The transparent color is reversible, and the image data is composed of an immediate value (the first value at the time of differential encoding) and a plurality of differential values (the previous value at the time of differential encoding) following the immediate value. When encoding a value by irreversible compression, the immediate value representing the transparent color and the difference value are made reversible, and the immediate value representing the transparent color is set to an intermediate value between the data values of each color, or the transparent color is changed. A technique has been proposed in which the difference value to be expressed is set to “0”.

また、特許文献3には、数を予測された数(s’(j))と実際の数(s(j))との差分によって符号化することが提案されている。   Patent Document 3 proposes that the number is encoded by the difference between the predicted number (s' (j)) and the actual number (s (j)).

さらに、特許文献4には、n列目の画素データ列に対して、副走査方向の同一画素データの分布状況を認識するとともに、主走査方向の同ー画素データの分布状況を認識し、これらの認識結果を基に、副走査方向に連続する同ー画素データを圧縮処理するか、あるいは主走査方向に連続する同一画素データを圧縮処理するかを決定する画像圧縮装置が提案されている。   Further, Patent Document 4 recognizes the distribution status of the same pixel data in the sub-scanning direction and the distribution status of the same pixel data in the main scanning direction with respect to the n-th pixel data column. Based on this recognition result, there has been proposed an image compression device that determines whether to compress the same pixel data continuous in the sub-scanning direction or to compress the same pixel data continuous in the main scanning direction.

ここで、データ圧縮技術を適用した1つのシステムを紹介する。   Here, one system to which the data compression technology is applied is introduced.

図1は、データ圧縮技術が適用されたプリントシステムの一例を示す図、図2は、プリントシステムにおけるデータ処理の流れを示す図である。   FIG. 1 is a diagram illustrating an example of a print system to which a data compression technique is applied, and FIG. 2 is a diagram illustrating a flow of data processing in the print system.

このプリントシステムは、図1に示すように、ホストコントローラ100と、インターフェース機器200と、プリンタ300とで構成されており、ホストコントローラ100とインターフェース機器200との間はSCSI等の汎用インターフェースケーブル150で接続され、さらにインターフェース機器200とプリンタ300との間は専用インターフェースケーブル250で接続されている。   As shown in FIG. 1, the print system includes a host controller 100, an interface device 200, and a printer 300. A general-purpose interface cable 150 such as SCSI is used between the host controller 100 and the interface device 200. Further, the interface device 200 and the printer 300 are connected by a dedicated interface cable 250.

ホストコントローラ100の内部では、図2に示すように、PDF,PS,TIFF等、様々な言語やフォーマットで記述された文字や画像のデータ11が、画像(CT;Continuous Tone)データと文字やライン等(LW;Line Work)のデータとに分けられて、それぞれについてRIP(Raster Image Processing)を行なうことによりビットマップデータ12A,13Aが生成され、さらにそれぞれについてデータ圧縮処理が行なわれて、CTについては非可逆の圧縮データ14、LWについては可逆の圧縮データ15が生成される。これらの圧縮データ14,15は、図1に示す汎用インターフェースケーブル150を経由して、ホストコントローラ100からインターフェース機器200に転送される。インタフェース機器200では、転送されてきた圧縮データ14,15にデータ伸長処理を施して、ホストコントローラ100でデータ圧縮処理を行なう前の状態のビットマップデータ12A,13Aに対応するビットマップデータ12B,13Bを生成する。ここで、CTデータについてはホストコントローラ100でのデータ圧縮の際非可逆圧縮処理が行なわれているため、データ伸長後のCTデータ(ビットマップデータ12B)は完全にはデータ圧縮前のCTデータ(ビットマップデータ12A)には戻らないが、ほぼ同一のビットマップデータが復元される。LWデータについては、ホストコントローラ100でのデータ圧縮の際可逆圧縮処理が行なわれているため、データ伸長後のLWデータ(ビットマップデータ13B)は、データ圧縮前のLWデータ(ビットマップデータ13A)と同一のデータに復元される。   In the host controller 100, as shown in FIG. 2, character and image data 11 described in various languages and formats such as PDF, PS, and TIFF are image (CT) data, characters and lines. Etc. (LW; Line Work) data, RIP (Raster Image Processing) is performed for each to generate bitmap data 12A and 13A, and further, data compression processing is performed for each, and CT is performed. Generates irreversible compressed data 14 and reversible compressed data 15 for LW. These compressed data 14 and 15 are transferred from the host controller 100 to the interface device 200 via the general-purpose interface cable 150 shown in FIG. In the interface device 200, the compressed data 14 and 15 transferred are subjected to data decompression processing, and the bitmap data 12B and 13B corresponding to the bitmap data 12A and 13A in a state before the host controller 100 performs the data compression processing. Is generated. Here, since the CT data is subjected to lossy compression processing at the time of data compression by the host controller 100, the CT data (bitmap data 12B) after data decompression is completely CT data before data compression ( Although it does not return to the bitmap data 12A), almost the same bitmap data is restored. Since the LW data is subjected to lossless compression processing at the time of data compression by the host controller 100, the LW data (bitmap data 13B) after data expansion is the LW data (bitmap data 13A) before data compression. Is restored to the same data.

インタフェース機器200では、データ伸長後のCTデータ(ビットマップデータ12B)とLWデータ(ビットマップデータ13B)とが合成され、さらに網点情報等がタグとして付加されてプリンタ300に送られる。プリンタ300では、インタフェース機器200から受け取ったビットマップデータとそれに付加されたタグ情報とに従って画像がプリント出力される。   In the interface device 200, CT data (bitmap data 12B) after data expansion and LW data (bitmap data 13B) are combined, and halftone dot information and the like are added as tags and sent to the printer 300. In the printer 300, an image is printed out according to the bitmap data received from the interface device 200 and the tag information added thereto.

ホストコントローラ100とインタフェース機器200とが例えば相互に離れている場合、あるいは、インタフェース機器200が複数台のホストコントローラから画像データを受信するシステムの場合など、ホストコントローラ100とインタフェース機器200を別々の装置として構成する必要がある場合には、図2に示すような、ホストコントローラ100でデータ圧縮を行なってインタフェース機器200にデータ転送しインタフェース機器でデータ伸長するように構成することにより、ホストコントローラ100からインタフェース機器200へのデータ転送時間を短縮することができ、プリントの生産性が向上する。   For example, when the host controller 100 and the interface device 200 are separated from each other, or when the interface device 200 is a system that receives image data from a plurality of host controllers, the host controller 100 and the interface device 200 are separated from each other. 2, the host controller 100 compresses data, transfers the data to the interface device 200, and decompresses the data using the interface device, as shown in FIG. Data transfer time to the interface device 200 can be shortened, and print productivity is improved.

ここで、一般的には、CTデータについては、非可逆ではあるが圧縮率の高いJPEG等の圧縮方式が採用され、LWデータについてはPackBits等の可逆圧縮方式が採用される。   Here, generally, a compression method such as JPEG which is irreversible but has a high compression rate is adopted for CT data, and a reversible compression method such as PackBits is adopted for LW data.

以下、後述する本発明の実施形態との対比のために、PackBitsによる符号化方式について説明しておく。   Hereinafter, for comparison with an embodiment of the present invention described later, an encoding method using PackBits will be described.

図3は、PackBits符号化方式の説明図である。   FIG. 3 is an explanatory diagram of the PackBits encoding method.

原データは、上段に並ぶ、「01 02 02 02 03 03 03 03 04 05」であるとする。尚、ここでは、全て16進法で表わされるものとする、原データのうちの最初の数値は「01」、次は「02」、さらにその次も「02」であり、「02」は同一の数値が連続しているため、連続していない数値は「01」の1個のみである。   The original data is “01 02 02 02 03 03 03 03 04 05” arranged in the upper row. In this case, it is assumed that all are expressed in hexadecimal notation, the first numerical value of the original data is “01”, the next is “02”, and the next is “02”, and “02” is the same. Since the numerical values of are consecutive, there is only one numerical value “01” that is not continuous.

そこで、ここでは、連続していない数値の数(ここでは1)から1を引いた数値「00」を置く(図3の下段の最初の数値「00」)。それに続いて、その連続していない数値自体(ここでは「01」)を置く(下段の2番目の数値「01」)。すなわち、ここでは、原データの「01」が、PackBits符号化により、「00 01」に置き換わる。   Therefore, here, a numerical value “00” obtained by subtracting 1 from the number of numerical values that are not continuous (here, 1) is set (the first numerical value “00” in the lower part of FIG. 3). Subsequently, the discontinuous numerical value itself (here, “01”) is placed (the second numerical value “01” in the lower row). That is, here, “01” of the original data is replaced with “00 01” by PackBits encoding.

次に、原データの「02」は、3個連続しているので、連続数(ここでは3)から1を引いた数(ここでは2)を負とした数(−2)を16進法で表現した「FE」を置き(下段の3番目の数値「FE」)、その後ろに、その連続している数値自体(ここでは「02」)を置く(下段の4番目の数値「02」)。すなわち、ここでは、原データの「02 02 02」が、PackBits符号化により、「FE 02」に置き換わる。   Next, since “02” of the original data is continuous, the number (−2) obtained by subtracting 1 (here 2) from the consecutive number (here 3) minus 1 is expressed in hexadecimal. Is placed (the third numerical value “FE” in the lower row), and the continuous numerical value itself (here, “02”) is placed behind it (the fourth numerical value “02” in the lower row). ). That is, here, “02 02 02” of the original data is replaced with “FE 02” by PackBits encoding.

次に、原データ上で「03」が4個連続しているので、上記と同様にして、連続数4から1を引いた数3を負とした数(−3)を16進法で表現した「FD」と、その連続している数値「03」を置く。すなわち、ここでは、原データの「03 03 03 03」が、「FD 03」に置き換わる。   Next, since “03” is consecutive in the original data, the number (−3) in which the number 3 obtained by subtracting 1 from the number 4 is negative is expressed in hexadecimal as in the above. “FD” and the continuous numerical value “03” are placed. That is, here, “03 03 03 03” of the original data is replaced with “FD 03”.

さらに、その後には、原データ上で「04 05」が続くが、これら「04」、「05」はそれぞれが単独であって同一の数値が連続していない。そこで、ここでは、その連続していない数値(「04」、「05」)の数(ここでは2)から1を引いて「01」を置き、それに続いてその連続していない数値自体「04 05」を置く。すなわち、ここでは、原データの「04 05」が、PackBits符号化により「01 04 05」に置き換わる。   Further, “04 05” follows on the original data, but these “04” and “05” are each independent and the same numerical value is not continuous. Therefore, here, 1 is subtracted from the number (in this case, 2) of the non-consecutive numerical values (“04”, “05”) to place “01”, followed by the non-contiguous numerical value itself “04”. 05 ”. That is, here, “04 05” of the original data is replaced with “01 04 05” by PackBits encoding.

PackBitsでは、以上のルールに従って符号化が行なわれる。
特開平5−328142号公報 特開平10−164620号公報 特表2001−5−20822号公報 特開平9−200540号公報
In PackBits, encoding is performed according to the above rules.
JP-A-5-328142 Japanese Patent Laid-Open No. 10-164620 Japanese translation of PCT publication No. 2001-5-20822 Japanese Patent Laid-Open No. 9-200540

上記のPackBits符号化の場合、同一の数値の連続数として取り得る値は−1〜−127である。すなわち連続数として表現できるのは128までである。これを2バイト(8ビット×2)で表現するので、原理的に実現できる最大の圧縮率は2/128=1/64である。   In the case of the PackBits encoding described above, values that can be taken as consecutive numbers of the same numerical value are −1 to −127. That is, up to 128 can be expressed as a continuous number. Since this is expressed by 2 bytes (8 bits × 2), the maximum compression rate that can be realized in principle is 2/128 = 1/64.

ところが、例えばLWデータの場合は連続する空白など、同一の数値が連続することが多く、最大圧縮率が1/64では効率が悪いという問題がある。   However, in the case of LW data, for example, there are many cases where the same numerical value such as continuous blanks continues, and the efficiency is poor when the maximum compression ratio is 1/64.

また、図3から分かるように、原データ「01」は「00 01」に符号化され、原データ「04 05」は「01 04 05」に符号化されるなど、符号化により原データよりも冗長となってしまう場合もある。   Further, as can be seen from FIG. 3, the original data “01” is encoded as “00 01”, the original data “04 05” is encoded as “01 04 05”, and the like. Sometimes it becomes redundant.

また、図3では、「01」,「02」,「03」,「04」,「05」,…なる多値のデータについて説明したが、LWデータの場合、例えば白地に同一の濃さの文字のみからなる画像を表わすLWデータなど、2値のデータの場合も多い。   In FIG. 3, multi-value data “01”, “02”, “03”, “04”, “05”,... Has been described, but in the case of LW data, for example, the same density on a white background. There are many cases of binary data such as LW data representing an image consisting only of characters.

本発明は、上記事情に鑑み、圧縮率を向上させたデータ圧縮処理を行なうことのできるデータ圧縮装置、およびコンピュータ等の情報処理装置を、圧縮率を向上させたデータ圧縮処理を行なうデータ圧縮装置として動作させることのできるデータ圧縮プログラムを提供することを目的とする。   In view of the above circumstances, the present invention provides a data compression apparatus capable of performing data compression processing with an improved compression ratio, and an information compression apparatus for performing data compression processing with an improved compression ratio. An object of the present invention is to provide a data compression program that can be operated as:

上記目的を達成する本発明のデータ圧縮装置は、所定の単位ビット数で表わされる数値の連続からなる被圧縮データにデータ圧縮処理を施すデータ圧縮装置において、
被圧縮データ中、1つもしくは複数の所定の圧縮対象数値を除く数値についてはそのまま出力すると共に、圧縮対象数値については、圧縮対象数値と、その圧縮対象数値と同一の圧縮対象数値の連続数を表わす数値とに符号化して出力する第1のデータ圧縮部と、
被圧縮データが2種類の数値のみで表現される2値データである場合に、それら2種類の数値を1ビットで識別しその1ビットの連続を単位ビット数ごとにまとめることにより単位ビット数で表わされる数値の連続からなる新たな被圧縮データを生成して第1のデータ圧縮部に渡す第2のデータ圧縮部とを備えたことを特徴とする。
A data compression apparatus of the present invention that achieves the above object is a data compression apparatus that performs data compression processing on data to be compressed consisting of a series of numerical values represented by a predetermined unit bit number.
In the data to be compressed, numerical values other than one or a plurality of predetermined compression target values are output as they are, and for the compression target numerical values, the compression target numerical value and the number of consecutive compression target numerical values that are the same as the compression target numerical value are displayed. A first data compression unit that encodes and outputs a numerical value to be represented;
When the data to be compressed is binary data represented by only two kinds of numerical values, the two kinds of numerical values are identified by one bit, and the continuation of the one bit is grouped by the number of unit bits. And a second data compression unit that generates new compressed data composed of a series of represented numerical values and passes the data to the first data compression unit.

ここで、上記本発明のデータ圧縮装置において、上記第1のデータ圧縮部は、同一の圧縮対象数値の連続数に応じ、その連続数を異なるビット数で表現する符号化を行なうものであることが好ましい。その一例として、上記第1のデータ圧縮部は、同一の圧縮対象数値の連続数が所定数以下のときはその連続数を1単位ビット数で表現し、その連続数が所定数を越えるときは2単位ビット数で表現する符号化を行なうものであってもよい。   Here, in the data compression apparatus of the present invention, the first data compression unit performs encoding that expresses the continuous number with a different number of bits according to the continuous number of the same numerical value to be compressed. Is preferred. As an example, the first data compression unit expresses the continuous number by a unit bit number when the number of consecutive compression target numerical values is equal to or smaller than a predetermined number, and when the continuous number exceeds the predetermined number You may perform the encoding expressed by 2 unit bit number.

また、上記本発明のデータ圧縮装置において、上記第1のデータ圧縮部および上記第2のデータ圧縮部の前段に、被圧縮データを構成する数値の連続について隣接する数値どうしの差分を求めることによりその差分を表わす数値の連続からなる新たな被圧縮データを生成する第3のデータ圧縮部を備えることが好ましい。この場合に、この第3のデータ圧縮部は、被圧縮データを構成する数値の連続を順次区切ったときの各区切りごとの先頭の数値についてはそのまま出力するとともに、先頭の数値以外については隣接する数値どうしの差分のうちの下位の単位ビット数で表わされる数値を出力するものであることがさらに好ましい。   In the data compression apparatus of the present invention, the difference between adjacent numerical values for a series of numerical values constituting the data to be compressed is obtained before the first data compression unit and the second data compression unit. It is preferable to include a third data compression unit that generates new compressed data including a series of numerical values representing the difference. In this case, the third data compression unit outputs the first numerical value for each delimiter when the sequence of numerical values constituting the compressed data is sequentially delimited, and adjoins other than the first numerical value. It is more preferable to output a numerical value represented by the lower unit bit number of the difference between the numerical values.

また、上記第3のデータ圧縮部は、被圧縮データが2値データである場合に、その2値データを構成する2種類の数値を16進数で00と80とで識別し00と80との連続からなる被圧縮データについて上記差分を求めてその差分を表わす数値の連続からなる新たな被圧縮データを生成するものであることが好ましい。   In addition, when the compressed data is binary data, the third data compression unit identifies two types of numerical values constituting the binary data as 00 and 80 in hexadecimal notation. It is preferable that the difference is obtained for the continuous compressed data, and new compressed data including a series of numerical values representing the difference is generated.

さらに、上記本発明のデータ圧縮装置において、上記第1のデータ圧縮部および上記第2のデータ圧縮部の後段に、第1のデータ圧縮部で符号化された後のデータにエントロピー符号化を施す第4のデータ圧縮部を備えることも好ましい形態である。   Further, in the data compression apparatus according to the present invention, entropy coding is performed on the data after being encoded by the first data compression unit, following the first data compression unit and the second data compression unit. It is also a preferable form to include a fourth data compression unit.

また、被圧縮データが2種類の数値のみを含む2値データであるかあるいは3種類以上の数値を含む多値データであるかを判定するデータ種別判定部を備えることも好ましい形態である。   It is also a preferred form that a data type determination unit is provided for determining whether the data to be compressed is binary data including only two types of numerical values or multi-value data including three or more types of numerical values.

また、上記目的を達成する本発明のデータ圧縮プログラムは、プログラムを実行する情報処理装置内で実行され、その情報処理装置を、所定の単位ビット数で表わされる数値の連続からなる被圧縮データにデータ圧縮処理を施すデータ圧縮装置として動作させるデータ圧縮プログラムであって、
上記情報処理装置を、
被圧縮データ中、1つもしくは複数の所定の圧縮対象数値を除く数値についてはそのまま出力すると共に、圧縮対象数値については、圧縮対象数値と、その圧縮対象数値と同一の圧縮対象数値の連続数を表わす数値とに符号化して出力する第1のデータ圧縮部と、
被圧縮データが2種類の数値のみを含む2値データである場合に、それら2種類の数値を1ビットで識別しその1ビットの連続を単位ビット数ごとにまとめることにより単位ビット数で表わされる数値の連続からなる新たな被圧縮データを生成して第1のデータ圧縮部に渡す第2のデータ圧縮部とを備えたデータ圧縮装置として動作させることを特徴とする。
The data compression program of the present invention that achieves the above object is executed in an information processing apparatus that executes the program, and converts the information processing apparatus into compressed data consisting of a series of numerical values represented by a predetermined number of unit bits. A data compression program that operates as a data compression device that performs data compression processing,
The information processing apparatus is
In the data to be compressed, numerical values other than one or a plurality of predetermined compression target values are output as they are, and for the compression target numerical values, the compression target numerical value and the number of consecutive compression target numerical values that are the same as the compression target numerical value are displayed. A first data compression unit that encodes and outputs a numerical value to be represented;
When the data to be compressed is binary data including only two kinds of numerical values, these two kinds of numerical values are identified by one bit, and the continuation of the one bit is grouped for each unit bit number, and expressed by the unit bit number. It is characterized by operating as a data compression apparatus comprising a second data compression unit that generates new compressed data consisting of a series of numerical values and passes it to the first data compression unit.

ここで、上記本発明のデータ圧縮プログラムにおいて、上記第1のデータ圧縮部は、同一の圧縮対象数値の連続数に応じ、その連続数を異なるビット数で表現する符号化を行なうものであることが好ましく、その一例として、上記第1のデータ圧縮部は、同一の圧縮対象数値の連続数が所定数以下のときはその連続数を1単位ビット数で表現し、連続数がその所定数を越えるときは2単位ビット数で表現する符号化を行なうものであってもよい。   Here, in the data compression program of the present invention, the first data compression unit performs encoding that expresses the continuous number with a different number of bits according to the continuous number of the same numerical value to be compressed. As an example, the first data compression unit expresses the continuous number by a unit bit number when the consecutive number of the same numerical value to be compressed is a predetermined number or less, and the continuous number indicates the predetermined number. When exceeding, encoding expressed by the number of 2 unit bits may be performed.

また、上記本発明のデータ圧縮装置において、上記第1のデータ圧縮部および上記第2のデータ圧縮部の前段に、被圧縮データを構成する数値の連続について隣接する数値どうしの差分を求めることによりその差分を表わす数値の連続からなる新たな被圧縮データを生成する第3のデータ圧縮部を備えることが好ましい。この場合に、この第3のデータ圧縮部は、被圧縮データを構成する数値の連続を順次区切ったときの各区切りごとの先頭の数値についてはそのまま出力するとともに、先頭の数値以外については隣接する数値どうしの差分のうちの下位の単位ビット数で表わされる数値を出力するものであることがさらに好ましい。   In the data compression apparatus of the present invention, the difference between adjacent numerical values for a series of numerical values constituting the data to be compressed is obtained before the first data compression unit and the second data compression unit. It is preferable to include a third data compression unit that generates new compressed data including a series of numerical values representing the difference. In this case, the third data compression unit outputs the first numerical value for each delimiter when the sequence of numerical values constituting the compressed data is sequentially delimited, and adjoins other than the first numerical value. It is more preferable to output a numerical value represented by the lower unit bit number of the difference between the numerical values.

また、上記第3のデータ圧縮部は、被圧縮データが2値データである場合に、その2値データを構成する2種類の数値を16進数で00と80とで識別し00と80との連続からなる被圧縮データについて上記差分を求めてその差分を表わす数値の連続からなる新たな被圧縮データを生成するものであることが好ましい。   In addition, when the compressed data is binary data, the third data compression unit identifies two types of numerical values constituting the binary data as 00 and 80 in hexadecimal notation. It is preferable that the difference is obtained for the continuous compressed data, and new compressed data including a series of numerical values representing the difference is generated.

さらに、上記本発明のデータ圧縮プログラムにおいて、上記第1のデータ圧縮部および上記第2のデータ圧縮部の後段に、第1のデータ圧縮部で符号化された後のデータにエントロピー符号化を施す第4のデータ圧縮部を備えることも好ましい形態である。   Furthermore, in the data compression program of the present invention, entropy coding is performed on the data after being encoded by the first data compression unit after the first data compression unit and the second data compression unit. It is also a preferable form to include a fourth data compression unit.

さらに、被圧縮データが2種類の数値のみで表現される2値データであるかあるいは3種類以上の数値で表現される多値データであるかを判定するデータ種別判定部を備えることも好ましい形態である。   Furthermore, it is preferable that a data type determination unit that determines whether the data to be compressed is binary data expressed by only two types of numerical values or multi-value data expressed by three or more types of numerical values is also preferable. It is.

上記本発明のデータ圧縮装置ないしデータ圧縮プログラムによれば、圧縮対象数値のみが、その圧縮対象数値と連続数とを表わす数値とに符号化されるため、図3を参照して説明したような、原データよりも冗長度が増すという事態が回避され、圧縮率が向上する。   According to the data compression apparatus or data compression program of the present invention, only the numerical value to be compressed is encoded into the numerical value representing the numerical value to be compressed and the continuous number, and therefore as described with reference to FIG. Thus, a situation in which redundancy is increased as compared with the original data is avoided, and the compression rate is improved.

また、本発明によれば、2値データの場合にその2値を1ビットで識別しその1ビットの連続を単位ビット数ごとにまとめることにより新たな多値データを生成するものであるため、2値データについては圧縮率が一層向上する。   Further, according to the present invention, in the case of binary data, the binary value is identified by 1 bit, and a new multi-value data is generated by collecting the continuation of the 1 bit for each unit bit number. For binary data, the compression ratio is further improved.

ここで、上記第1のデータ圧縮部を、同一の圧縮対象数値の連続数に応じ、その連続数を異なるビット数で表現する符号化を行なう構成、例えば、同一の圧縮対象数値の連続数が所定数以下のときはその連続数を1単位ビット数で表現し、その連続数が所定数を越えるときは2単位ビット数で表現する符号化を行なう構成とすると、同一の圧縮対象数値の連続数が大きな数であるときに高圧縮率で圧縮され、圧縮率が更に向上する。   Here, the first data compression unit is configured to perform encoding that expresses the continuous number with different bit numbers in accordance with the continuous number of the same compression target numerical value, for example, the continuous number of the same compression target numerical value is When the encoding is performed such that when the number is less than the predetermined number, the continuous number is expressed by 1 unit bit number, and when the continuous number exceeds the predetermined number, the encoding is expressed by 2 unit bit number. When the number is a large number, the compression is performed at a high compression rate, and the compression rate is further improved.

さらに、上記第3のデータ圧縮部を備えると、同一の数値が続く場合はその差分は数値ゼロとなり、数値ゼロの出現確率が増加し、上記第1および第2のデータ圧縮部との組合せにより圧縮率を更に向上させることができる。   Further, when the third data compression unit is provided, if the same numerical value continues, the difference becomes a numerical value zero, the appearance probability of the numerical value zero increases, and the combination with the first and second data compression units The compression rate can be further improved.

ここで、数値の差分を求めると、例えばその数値が1バイト(8ビット)で表現されている数値である場合に、差分は符号を含め9ビットで表現されることになる。後述する実施形態で示されるように、先頭の数値をそのまま保存しておくことにより、差分を表わす数値としてMSBの1ビットを省き、下位8ビット(1バイト)を保存しておくことで元の数値を復元することができる。   Here, when the numerical difference is obtained, for example, when the numerical value is expressed by 1 byte (8 bits), the difference is expressed by 9 bits including the sign. As shown in the embodiment described later, by storing the first numerical value as it is, by omitting 1 bit of the MSB as a numerical value representing the difference and storing the lower 8 bits (1 byte), The numerical value can be restored.

そこで、上記第3のデータ圧縮部を、被圧縮データを構成する数値の連続を順次で区切ったときの各区切りごとの先頭の数値についてはそのまま出力するとともに、先頭の数値以外については隣接する数値どうしの差分のうちの下位の単位ビット数で表わされる数値を出力する構成とすることにより、差分により1つの差分値について1ビット増加するのを防ぐことができ、更なる圧縮率向上に役立つ。   Therefore, the third data compression unit outputs the first numerical value for each delimiter when the series of numerical values constituting the compressed data are sequentially delimited, and the adjacent numerical values other than the first numerical value. By adopting a configuration that outputs a numerical value represented by the number of lower unit bits among the differences, it is possible to prevent one difference from increasing by one bit due to the difference, which helps to further improve the compression rate.

ここで、16進数で00と80とで構成される数値列の場合、差分演算を行なった結果も符号ビットを除くと00と80とで表現される。したがって、被圧縮データが2値データである場合にその2値データを構成する2種類の数値を16進数で00と80とで識別すると、差分演算を行なった後も00と80とからなる2値データとして表現されるとともに、差分演算により数値ゼロ(00)の出現確率が増加し、圧縮率の更なる向上に寄与する。   Here, in the case of a numerical string composed of 00 and 80 in hexadecimal, the result of the difference calculation is also expressed as 00 and 80 excluding the sign bit. Therefore, when the compressed data is binary data, if the two types of numerical values constituting the binary data are identified as 00 and 80 in hexadecimal, 2 which consists of 00 and 80 even after the difference calculation is performed. In addition to being expressed as value data, the difference probability increases the appearance probability of the numerical value zero (00), which contributes to further improvement of the compression rate.

さらに、上記第4のデータ圧縮部を備えると、エントロピー符号化による、圧縮率の更なる向上が見込まれる。   Furthermore, when the fourth data compression unit is provided, further improvement of the compression rate by entropy coding is expected.

本発明は被圧縮データが2値データである場合、あるいは被圧縮データに2値データが含まれる場合を予定したものであるが、被圧縮データが2値データであるか多値データであるかという情報を別途取得できるときはその情報に従ってもよく、あるいは、上記データ種別判別部を備え、その被圧縮データ等を調べることにより2値データであるか多値データであるかを判別してもよい。   The present invention is intended for the case where the data to be compressed is binary data, or the case where the data to be compressed includes binary data. Whether the data to be compressed is binary data or multi-value data. Can be obtained separately, or the data type discriminating section may be provided to determine whether the data is binary data or multi-value data by examining the data to be compressed. Good.

以下、本発明の実施形態について説明する。   Hereinafter, embodiments of the present invention will be described.

以下において説明する実施形態は、図1に示す全体システムの中のホストコントローラ100内に組み込まれるデータ圧縮装置であり、さらに具体的には、図2に示すホストコントローラ内のLWのビットマップデータ13Aについてデータ圧縮を行なう処理に関するものである。したがって、ここでは、図1,図2を参照して説明したLWデータについてのデータ圧縮処理およびデータ伸長処理が以下に説明する本発明の実施形態としての処理に置き換わるものと理解し、図1に示す全体システムおよび図2に示す処理の流れについての重複した図示および重複説明は省略する。   The embodiment described below is a data compression apparatus incorporated in the host controller 100 in the overall system shown in FIG. 1. More specifically, the LW bitmap data 13A in the host controller shown in FIG. Is related to the data compression processing. Therefore, it is understood here that the data compression processing and data decompression processing for the LW data described with reference to FIGS. 1 and 2 replaces the processing according to the embodiment of the present invention described below. Duplicate illustrations and duplicate descriptions of the overall system shown and the processing flow shown in FIG. 2 are omitted.

図4は、本発明のデータ圧縮装置の一実施形態を示すブロック構成図である。   FIG. 4 is a block diagram showing an embodiment of the data compression apparatus of the present invention.

この図4に示すデータ圧縮装置500は、データ種別判別部510と、差分符号化部520と、2値符号化部530と、特定数値検出部540と、ランレングス符号化部550と、データスキャニング部560と、ハフマン符号化部570とを備えている。各部510〜570の詳細は後述するが、このデータ圧縮装置500内での画像データの流れは以下のとおりである。   The data compression apparatus 500 shown in FIG. 4 includes a data type determination unit 510, a differential encoding unit 520, a binary encoding unit 530, a specific numerical value detection unit 540, a run length encoding unit 550, and a data scanning. Part 560 and a Huffman encoding part 570. Although details of the respective units 510 to 570 will be described later, the flow of image data in the data compression apparatus 500 is as follows.

入力画像ファイル(本実施形態では、図2に示すように、ビットマップに展開されたLWデータ13Aが格納されたファイル)は、図4に示すデータ圧縮装置500の、データ種別判定部510と差分符号化部520とに入力される。データ種別判定部510では今回入力されてきた入力画像ファイル中の画像データが2値データであるか3値以上の多値データであるかが判定される。このデータ種別の判定にあたっては、データ種別判定部510では、今回入力されてきた入力画像ファイル中の画像データを構成する各数値を順次調べてその画像データの途中で3種類目の数値を検出したときは多値データである旨判定し、その画像データの最後まで2種類の数値しか出現しなかったことを持って2値データであると判定する。   An input image file (in this embodiment, a file storing LW data 13A expanded in a bitmap as shown in FIG. 2) is different from the data type determination unit 510 of the data compression apparatus 500 shown in FIG. The data is input to the encoding unit 520. The data type determination unit 510 determines whether the image data in the input image file input this time is binary data or multi-value data of three or more values. In determining the data type, the data type determination unit 510 sequentially checks each numerical value constituting the image data in the input image file input this time, and detects the third type numerical value in the middle of the image data. In some cases, it is determined that the data is multi-value data, and it is determined that the data is binary data with the fact that only two types of numerical values have appeared until the end of the image data.

その判定結果は、差分符号化部520に伝えられるとともに、その判定結果に応じて、2値データであったときにはその差分符号化部520の出力データが2値符号化部530に入力されて2値符号化(この内容については後述する)が行なわれるように、また多値データであったときは、差分符号化部520の出力データは、2値データ符号化部530による2値符号化処理を受けずに特定数値検出部540およびランレングス符号化部550に入力されるように、差分符号化部520の出力データの送り先が切り替えられる。   The determination result is transmitted to the differential encoding unit 520. When the determination result is binary data, the output data of the differential encoding unit 520 is input to the binary encoding unit 530 and 2 In order to perform value encoding (this content will be described later), and in the case of multi-value data, the output data of the differential encoding unit 520 is binary encoded by the binary data encoding unit 530 The destination of the output data of the differential encoding unit 520 is switched so that it is input to the specific numerical value detection unit 540 and the run length encoding unit 550 without receiving the signal.

差分符号化部520では、入力されてきた入力画像ファイルについて、差分符号化処理、すなわち、入力されてきたデータを構成する数値の連続について隣接する数値どうしの差分を求めることによりその差分を表わす数値の連続からなるデータを生成する処理が行なわれる。この差分符号化部520は、本発明にいう第3のデータ圧縮部の一例に相当する。さらに具体的には、この差分符号化部520では、入力されてきたデータを構成する数値の連続を順次区切ったときの各区切りごとの先頭の数値についてはそのまま出力するとともに、先頭の数値以外については隣接する数値どうしの差分のうちの下位の単位ビット数で表わされる数値を出力する処理が行なわれる。また2値データについては、この差分符号化部520では、その2値データを構成する2値を16進数で00と80とで識別し、00と80との連続からなる被圧縮データと見なして差分演算が行なわれる。詳細は後述する。   In the differential encoding unit 520, for the input image file that has been input, a differential encoding process, that is, a numerical value representing the difference by obtaining a difference between adjacent numerical values for a series of numerical values constituting the input data. A process for generating data consisting of a series of is performed. The differential encoding unit 520 corresponds to an example of a third data compression unit referred to in the present invention. More specifically, the differential encoding unit 520 outputs the first numerical value for each segment when the sequence of the numerical values constituting the input data is sequentially segmented, and also outputs other than the first numeric value. Is processed to output a numerical value represented by the number of lower unit bits of the difference between adjacent numerical values. For binary data, the differential encoding unit 520 identifies binary values constituting the binary data as hexadecimal numbers 00 and 80, and regards it as compressed data consisting of a series of 00 and 80. Difference calculation is performed. Details will be described later.

差分符号化部520において差分符号化されたデータは、2値データについては2値符号化部530により2値符号化処理が行なわれた後、特定数値検出部540とランレングス符号化部550との双方に入力される。特定数値検出部540では、入力されてきたデータの中から1つもしくは複数の圧縮対象数値の存在及び同一の圧縮対象数値の連続数が検出される。ランレングス符号化部550では、特定数値検出部540における検出結果を受けて、入力されてきたデータ中、圧縮対象数値を除く数値についてはそのまま出力すると共に、圧縮対象数値については、その圧縮対象数値と、その圧縮対象数値と同一の圧縮対象数値の連続数を表わす数値とに符号化して出力するという符号化処理が行なわれる。このランレングス符号化部550では、その符号化処理にあたっては、同一の圧縮対象数値の連続数に応じ、その連続数を異なるビット数で表現する符号化が行なわれる。ここでは、具体的には、同一の圧縮対象数値の連続数が所定数以下のときはその連続数を1単位ビット数で表現し、その連続数が所定数を越えるときは2単位ビット数で表現する符号化が行なわれる。本実施形態では、これら特定数値検出部540とランレングス符号化部550とを合わせたものが、本発明にいう第1のデータ圧縮部に相当する。   The data encoded by the differential encoding unit 520 is subjected to binary encoding processing by the binary encoding unit 530 for binary data, and then the specific numerical value detection unit 540, the run length encoding unit 550, and the like. Are input to both. The specific numerical value detection unit 540 detects the presence of one or a plurality of compression target numerical values and the continuous number of the same compression target numerical values from the input data. The run-length encoding unit 550 receives the detection result from the specific numerical value detection unit 540 and outputs the numerical values excluding the numerical values to be compressed in the input data as they are, and the numerical values to be compressed with respect to the numerical values to be compressed. Then, an encoding process is performed in which the compressed numerical value is encoded into a numerical value representing the continuous number of the numerical values to be compressed and output. In the run-length encoding unit 550, in the encoding process, encoding is performed in which the continuous number is expressed by a different number of bits according to the continuous number of the same numerical value to be compressed. More specifically, when the number of consecutive compression target numerical values is less than or equal to a predetermined number, the number of consecutive numbers is expressed by one unit bit number, and when the number of consecutive values exceeds the predetermined number, it is expressed by two unit bit numbers. Encoding to represent is performed. In the present embodiment, the combination of the specific numerical value detection unit 540 and the run length encoding unit 550 corresponds to the first data compression unit referred to in the present invention.

また、ランレングス符号化部550での符号化後のデータは、次に、データスキャニング部560とハフマン符号化部570との双方に入力される。データスキャニング部560では、ランレングス符号化部550で符号化された後のデータの全てをスキャニングして、そのデータ中に出現する全ての数値の出現頻度(ヒストグラム)が求められる。ここで、この出現頻度を求めるデータは、本実施形態では、図4に示す入力画像ファイル1つずつを単位として、各入力画像ファイルの、ランレングス符号化部550で符号化された後のデータ中の数値の出現頻度が求められる。データスキャニング部560で求められたデータヒストグラム(数値の出現頻度)はハフマン符号化部570に入力される。ハフマン符号化部570では、ハフマン符号化のルールに従って、このハフマン符号化部570に入力されてきたデータを構成する数値を出現頻度の高い数値ほど短かいビット長で表わされる値に置き換える符号化処理が行なわれる。   Further, the data encoded by the run-length encoding unit 550 is then input to both the data scanning unit 560 and the Huffman encoding unit 570. The data scanning unit 560 scans all the data after being encoded by the run length encoding unit 550, and obtains the appearance frequency (histogram) of all the numerical values appearing in the data. Here, in this embodiment, the data for obtaining the appearance frequency is the data after each input image file is encoded by the run-length encoding unit 550 in units of one input image file shown in FIG. Appearance frequency of the numerical value inside is calculated. The data histogram (numerical frequency appearance frequency) obtained by the data scanning unit 560 is input to the Huffman coding unit 570. In the Huffman coding unit 570, in accordance with the rules of Huffman coding, a coding process that replaces the numerical value constituting the data input to the Huffman coding unit 570 with a value represented by a shorter bit length as a numerical value having a higher appearance frequency. Is done.

このハフマン符号化は、エントロピィ符号化の一種であり、本実施形態では、データスキャニング部560およびハフマン符号化部570を合わせたものが本発明にいう第4のデータ圧縮部に相当する。   This Huffman coding is a kind of entropy coding. In this embodiment, the combination of the data scanning unit 560 and the Huffman coding unit 570 corresponds to the fourth data compression unit referred to in the present invention.

ハフマン符号化部570でハフマン符号化された後のデータは、データスキャニング部560で求められたデータヒストグラムに従って設定された、ハフマン符号化部570への入力データの数値とハフマン符号化後の値との割当表やその他データ伸長に必要な情報が添付されて、図2に示すLW可逆圧縮データ15が格納された圧縮画像ファイルとして、図1に示すSCSI等の汎用インタフェース150を経由してインタフェース機器200に転送される。インタフェース機器200では、その受け取ったLW可逆圧縮データ15にデータ伸長処理が施されるが、このデータ伸長処理にあたっては、先ず、図4のハフマン符号化部570で行なわれた符号化処理に対する復号化処理が施され、次いで、図4のランレングス符号化部550で行なわれた符号化処理に対する復号化処理が施され、さらに、2値データについては図4の2値符号化部530で行なわれた符号化処理に対する復号化処理が施された後、図4の差分符号化部520で行われた符号化処理に対する復号化処理が施されて、元の入力画像ファイル中の画像データと同一の画像データに復元される。   The data after Huffman coding by the Huffman coding unit 570 is set according to the data histogram obtained by the data scanning unit 560, the value of the input data to the Huffman coding unit 570, and the value after Huffman coding. Interface table and other information necessary for data decompression are attached to the interface device via a general-purpose interface 150 such as SCSI shown in FIG. 1 as a compressed image file storing the LW lossless compressed data 15 shown in FIG. 200. In the interface device 200, the received LW lossless compression data 15 is subjected to data expansion processing. In this data expansion processing, first, decoding for the encoding processing performed in the Huffman encoding unit 570 of FIG. Next, a decoding process is performed on the encoding process performed by the run-length encoding unit 550 shown in FIG. 4, and the binary data is further processed by the binary encoding unit 530 shown in FIG. 4, the decoding process for the encoding process performed by the differential encoding unit 520 in FIG. 4 is performed, and the same image data as the original input image file is obtained. Restored to image data.

図5は、図1に示すホストコントローラのハードウェア構成図である。   FIG. 5 is a hardware configuration diagram of the host controller shown in FIG.

図1に示すホストコントローラ100は、図5に示す構成のコンピュータシステムで構成されている。   The host controller 100 shown in FIG. 1 is configured by a computer system having the configuration shown in FIG.

この図5に示す、コンピュータシステムで構成されたホストコントローラ100には、CPU111、RAM112、通信インタフェース113、ハードディスクコントローラ114、FDドライブ115、CDROMドライブ116、マウスコントローラ117、キーボードコントローラ118、ディスプレイコントローラ119、および通信用ボード120が備えられており、これらはバス110で相互に接続されている。   5 includes a CPU 111, a RAM 112, a communication interface 113, a hard disk controller 114, an FD drive 115, a CDROM drive 116, a mouse controller 117, a keyboard controller 118, a display controller 119, And a communication board 120 are connected to each other via a bus 110.

ハードディスクコントローラ114は、このホストコントローラ100に内蔵されているハードディスク104のアクセスを制御するものであり、FDドライブ115、CDROMドライブ116は、このホストコントローラ100に取出し自在に装填されるフレキシブルディスク(FD)130、CDROM140のアクセスを制御するものである。また、マウスコントローラ117、キーボードコントローラ118は、このホストコントローラ100に備えられたマウス107、キーボード108の操作を検出してCPU111に伝達する役割を担っている。さらに、ディスプレイコントローラ119は、このCPU111の指示に基づいて、ホストコントローラ100に備えられた画像ディスプレイ109の表示画面上に画像を表示する役割を担っている。   The hard disk controller 114 controls access to the hard disk 104 built in the host controller 100, and the FD drive 115 and the CDROM drive 116 are flexible disks (FD) loaded in the host controller 100 so as to be removable. 130, controls access to the CDROM 140. The mouse controller 117 and the keyboard controller 118 play a role of detecting operations of the mouse 107 and keyboard 108 provided in the host controller 100 and transmitting them to the CPU 111. Further, the display controller 119 plays a role of displaying an image on the display screen of the image display 109 provided in the host controller 100 based on the instruction of the CPU 111.

通信用ボード120は、SCSI等の汎用インタフェースプロトコルに準拠した通信を担っており、圧縮後の画像データをインタフェースケーブル150を介してインタフェース機器200(図1参照)に転送する役割を担っている。   The communication board 120 is responsible for communication conforming to a general-purpose interface protocol such as SCSI, and is responsible for transferring the compressed image data to the interface device 200 (see FIG. 1) via the interface cable 150.

さらに、通信用インタフェース113は、インターネット等の汎用の通信を担っており、このホストコントローラ100は、この通信用インタフェース113を経由して画像データを取り込むこともできる。   Furthermore, the communication interface 113 is responsible for general-purpose communication such as the Internet, and the host controller 100 can also capture image data via the communication interface 113.

RAM112には、ハードディスク104に格納されているプログラムが読み出されてCPU111での実行のために展開され、CPU111では、そのRAM112に展開されたプログラムが読み出されて実行される。   A program stored in the hard disk 104 is read into the RAM 112 and expanded for execution by the CPU 111, and the program expanded in the RAM 112 is read out and executed by the CPU 111.

図6は、本発明のデータ圧縮処理プログラムの模式構成図である。   FIG. 6 is a schematic configuration diagram of the data compression processing program of the present invention.

ここでは、このデータ圧縮プログラム600は、CDROM140に記憶されている。   Here, the data compression program 600 is stored in the CDROM 140.

このデータ圧縮プログラムは、データ種別判定部610、差分符号化部620、2値符号化部630、特定数値検出部640、ランレングス符号化部650、データスキャニング部660、およびハフマン符号化部670から構成されている。このCDROM140には、ここに示すデータ圧縮プログラム600のほか、図1に示すホストコントローラ100における図2に示す一連の処理を実行するための各種プログラムが記憶されているが、それらについては従来と同様であるため図示および説明は省略する。   The data compression program includes a data type determination unit 610, a differential encoding unit 620, a binary encoding unit 630, a specific numerical value detection unit 640, a run length encoding unit 650, a data scanning unit 660, and a Huffman encoding unit 670. It is configured. In addition to the data compression program 600 shown here, the CDROM 140 stores various programs for executing the series of processing shown in FIG. 2 in the host controller 100 shown in FIG. Therefore, illustration and description are omitted.

この図6に示すCDROM140が、図5に示すホストコントローラ100に装填されCDROMドライブ116でアクセスされてそのCDROM140に記憶されているプログラムがこのホストコントローラ100にアップロードされ、ハードディスク104に記憶される。このハードディスク104に記憶されたプログラムがそのハードディスク104から読み出されてRAM112に展開されCPU111で実行されると、このホストコントローラ100は、図4に示すデータを圧縮装置500としての処理を含む、図2に示すホストコントローラとしての各種処理を実行する装置として動作する。   The CDROM 140 shown in FIG. 6 is loaded into the host controller 100 shown in FIG. 5 and accessed by the CDROM drive 116, and the program stored in the CDROM 140 is uploaded to the host controller 100 and stored in the hard disk 104. When the program stored in the hard disk 104 is read from the hard disk 104, loaded into the RAM 112, and executed by the CPU 111, the host controller 100 includes the data shown in FIG. 2 operates as a device that executes various processes as the host controller shown in FIG.

ここで、図6に示すデータ圧縮プログラム600は、ホストコントローラ100にインストールされてCPU111で実行されることにより、そのホストコントローラ100内に図4に示すデータ圧縮装置500を実現するものであり、データ種別判定部610、差分符号化部620、2値符号化部630、特定数値検出部640、ランレングス符号化部650、データスキャニング部660、およびハフマン符号化部670は、CPU111で実行されることにより、そのホストコントローラ100を、それぞれ、図4に示すデータ圧縮装置500を構成する、データ種別判定部510、差分符号化部520、2値符号化部530、特定数値検出部540、ランレングス符号化部550、データスキャニング部560、およびハフマン符号化部570として動作させるプログラム部品である。図6のデータ圧縮プログラム600を構成する各部620〜670の、CPU111で実行されたときの作用は、それぞれ、図5のデータ圧縮装置500を構成する各部510〜570の作用そのものである。したがって、図4のデータ圧縮装置500の各部510〜570に関する、これまでの説明、および、以下に説明する詳細説明をもって、図6のデータ圧縮プログラム600を構成する各部620〜670の説明を兼ねるものとする。   Here, the data compression program 600 shown in FIG. 6 is installed in the host controller 100 and executed by the CPU 111, thereby realizing the data compression apparatus 500 shown in FIG. Type determination unit 610, differential encoding unit 620, binary encoding unit 630, specific numerical value detection unit 640, run length encoding unit 650, data scanning unit 660, and Huffman encoding unit 670 are executed by CPU 111. Thus, the host controller 100 is configured by the data type determination unit 510, the differential encoding unit 520, the binary encoding unit 530, the specific numerical value detection unit 540, and the run length code, respectively, constituting the data compression apparatus 500 shown in FIG. 550, data scanning unit 560, and Huffman code A program component that operates as a part 570. The operations of the units 620 to 670 constituting the data compression program 600 of FIG. 6 when executed by the CPU 111 are the operations themselves of the units 510 to 570 constituting the data compression apparatus 500 of FIG. Therefore, the description so far regarding each of the units 510 to 570 of the data compression apparatus 500 of FIG. 4 and the detailed description described below also serve as the description of the units 620 to 670 constituting the data compression program 600 of FIG. And

図7は、図4のデータ圧縮装置500に入力される入力画像ファイル中の画像データのデータ構造および差分符号化の概念を示す図である。   FIG. 7 is a diagram illustrating the data structure of image data in the input image file input to the data compression apparatus 500 of FIG. 4 and the concept of differential encoding.

図7に示すように、図4に示すデータ圧縮装置500に入力される画像データは、所定の主走査方向に画素がM個並んでいる。その主走査方向とは直角な副走査方向に教えていったときのN番目のラインについて、主走査方向に並ぶ各画素の画素値は、その並び順に、
n,1,Dn,2,…,Dn,m-2,Dn,m-1,Dn,m
と表現される。
As shown in FIG. 7, the image data input to the data compression apparatus 500 shown in FIG. 4 has M pixels arranged in a predetermined main scanning direction. For the Nth line when taught in the sub-scanning direction perpendicular to the main scanning direction, the pixel values of the pixels arranged in the main scanning direction are as follows:
Dn , 1 , Dn , 2 ,..., Dn , m-2 , Dn , m-1 , Dn , m
It is expressed.

これと同様に、副走査方向の(N+1)番目のラインについて、主走査方向に並ぶ各画素の画素値は、その並びの順に、
n+1,1,Dn+1,2,…,Dn+1,m-2,Dn+1,m-1,Dn+1,m
と表現される。
Similarly, for the (N + 1) th line in the sub-scanning direction, the pixel values of the pixels arranged in the main scanning direction are as follows:
Dn + 1,1 , Dn + 1,2 ,..., Dn + 1, m-2 , Dn + 1, m-1 , Dn + 1, m
It is expressed.

ここで、図4に示すデータ圧縮装置500を構成する差分符号化部520では、上記のような画像データを入力し、副走査方向に隣接する画素どうしの差分が求められる。すなわち、N番目のラインと(N+1)番目のラインとの差分であって、主走査方向に並ぶj番目の画素の差分をSn,jとすると、この差分Sn,jは、
n,j=Dn+1,j−Dn,j (j=1〜m)
と表現される。
Here, the difference encoding unit 520 constituting the data compression apparatus 500 shown in FIG. 4 inputs the image data as described above, and obtains a difference between pixels adjacent in the sub-scanning direction. That is, if the difference between the Nth line and the (N + 1) th line and the jth pixel lined up in the main scanning direction is Sn , j , the difference Sn, j is
S n, j = D n + 1, j −D n, j (j = 1 to m )
It is expressed.

この差分演算を具体的に説明する。   This difference calculation will be specifically described.

図8は、図4のデータ圧縮装置500を構成する差分符号化部520における差分符号化処理を例示して示す図である。   FIG. 8 is a diagram illustrating a differential encoding process in the differential encoding unit 520 constituting the data compression apparatus 500 of FIG.

ここでは、図7に示す副走査方向に並ぶある縦一列の画素値が、図8の「画像データ」
の欄に示すように、
「12 01 02 FF 64 … 40 40 3F …」
であったとする。尚、ここでは、各画素値は、16進2桁(1バイト=8ビット)で表現されている。ここでは「ライン」は主走査方向に並ぶ画素を指している。
Here, the pixel values in one vertical line arranged in the sub-scanning direction shown in FIG. 7 are “image data” in FIG.
As shown in the column
"12 01 02 FF 64 ... 40 40 3F ..."
Suppose that Here, each pixel value is represented by two hexadecimal digits (1 byte = 8 bits). Here, “line” indicates pixels arranged in the main scanning direction.

先ず、1ライン目の画素値「12」については、そのまま出力する。   First, the pixel value “12” on the first line is output as it is.

次に、2ライン目の画素値「01」から1ライン目の画素値「12」を引き算し、その結果を出力する。ここで、「01」から「12」を引き算した結果は負の数となり、9ビットで「1EF」と表わされるが、MSBの1ビットである「1」は省略し、下位8ビットである「EF」のみを出力する。   Next, the pixel value “12” of the first line is subtracted from the pixel value “01” of the second line, and the result is output. Here, the result of subtracting “12” from “01” is a negative number and is expressed as “1EF” by 9 bits, but “1” that is 1 bit of the MSB is omitted and “8” is the lower 8 bits. Only “EF” is output.

次に、3ライン目の画素値「02」から2ライン目の画素値「01」を引き算し、その結果の値「01」を出力する。   Next, the pixel value “01” of the second line is subtracted from the pixel value “02” of the third line, and the resultant value “01” is output.

次に、4ライン目の画素値「FF」から3ライン目の画素値「02」を引き算し、その結果の値「FD」を出力する。   Next, the pixel value “02” of the third line is subtracted from the pixel value “FF” of the fourth line, and the resultant value “FD” is output.

次に、5ライン目の画素値「64」から4ライン目の画素値「FF」を引き算し、その結果の値から、MSBの1ビットである「1」を省略し、下位8ビットである「65」を出力する。   Next, the pixel value “FF” of the fourth line is subtracted from the pixel value “64” of the fifth line, and “1” that is 1 bit of the MSB is omitted from the resulting value, and the lower 8 bits. “65” is output.

以下、これと同じ演算を繰り返すことにより、図8の「差分エンコード(下位8ビット)」の欄に表わされている。   Hereinafter, by repeating the same operation, it is represented in the column of “differential encoding (lower 8 bits)” in FIG.

「(12) EF 01 FD 65 … L0 00 FF …」
が出力される。
"(12) EF 01 FD 65 ... L0 00 FF ..."
Is output.

図1に示すインタフェース機器200では、この差分符号化されたデータを復号化するにあたり、図8の右側に示す演算が行なわれる。   In decoding the differentially encoded data, the interface device 200 shown in FIG. 1 performs the operation shown on the right side of FIG.

先ず1ライン目の画素値は「12」のそのままである。   First, the pixel value of the first line remains “12”.

2ライン目の画素値は、差分値「EF」に1ライン目の画素値「12」を足し算した結果のうちの下位8ビットで表わされる「01」である。   The pixel value of the second line is “01” represented by the lower 8 bits of the result of adding the pixel value “12” of the first line to the difference value “EF”.

3ライン目の画素値は、差分値「01」に、上記で求めた2ライン目の画素値「01」を足し算することにより求められる「02」である。   The pixel value of the third line is “02” obtained by adding the pixel value “01” of the second line obtained above to the difference value “01”.

4ライン目の画素値は、差分値「FD」に、上記で求めた3ライン目の画素値「02」を足し算することにより求められる「FF」である。   The pixel value of the fourth line is “FF” obtained by adding the pixel value “02” of the third line obtained above to the difference value “FD”.

5ライン目の画素値は差分値「65」に、上記で求めた4ライン目の画素値「FF」を足し算した結果のうちの下位8ビットで表わされる「64」である。   The pixel value of the fifth line is “64” represented by the lower 8 bits of the result obtained by adding the pixel value “FF” of the fourth line obtained above to the difference value “65”.

以下これと同様の演算を繰り返すことにより、差分符号化を行なう前のデータと同一のデータに復号化される。   Thereafter, the same calculation is repeated, whereby the same data as the data before differential encoding is decoded.

ここでは、主走査方向の1ライン目に並ぶ各画素の画素値を演算における先頭の数値として、図8に例示した演算が行なわれる。すなわち、ここに示す例では、副走査方向の一列を、本発明にいう、「入力されてきたデータを構成する数値の連続を順次区切ったときの各区切り」として取り扱っており、1ライン目の画素値を、「各区切りごとの先頭の数値」として取り扱っている。   Here, the calculation illustrated in FIG. 8 is performed with the pixel value of each pixel arranged in the first line in the main scanning direction as the first numerical value in the calculation. In other words, in the example shown here, one column in the sub-scanning direction is treated as “each delimiter when the sequence of numerical values constituting the input data is sequentially delimited” according to the present invention. The pixel value is handled as “the first numerical value for each segment”.

尚、ここでは副走査方向の一列を1つの区切りとしているが、どの単位で区切るかは任意であり、例えば副走査方向の一列を複数に区切ってもよく、副走査方向の複数の列をひとまとめにして1つの区切りとしてもよい。   Here, one column in the sub-scanning direction is defined as one segment, but the unit of segmentation is arbitrary. For example, one column in the sub-scanning direction may be segmented into a plurality of columns, and a plurality of columns in the sub-scanning direction are grouped together. It is good also as one division.

図9は、差分符号化による作用説明図である。   FIG. 9 is a diagram for explaining the operation by differential encoding.

図9(A)は、画像の概念を表わしており、ここでは、図の縦方向を主走査方向、横方向を副走査方向とし、副走査方向(横方向)に引いた矢印A上の各画素の画素値に着目している。   FIG. 9A shows the concept of an image. Here, the vertical direction in the figure is the main scanning direction, the horizontal direction is the sub scanning direction, and each of the arrows A drawn in the sub scanning direction (horizontal direction) is shown in FIG. Focus is on the pixel value of the pixel.

この画像上には、主走査方向に延びる画素値「63」の濃度を持つ直線L1と、画素値「FF」の濃度を持つ直線L2が描かれており、その右側には、CT画像があて嵌められるCT画像領域が存在する。CT画像があて嵌められる領域は、画素値「00」で表わされている。   On this image, a straight line L1 having a density of pixel value “63” extending in the main scanning direction and a straight line L2 having a density of pixel value “FF” are drawn. There is a CT image area to be fitted. A region to which a CT image is fitted is represented by a pixel value “00”.

図9(A)の矢印A上に並ぶ画素の画素値は、図9(B)示すように、左側から順に、最初は「01」が続き直線L1上では「63」が続き、再度「01」が続き、直線L2上では「FF」となり、再度「01」に戻り、CT画像があて嵌められる領域では「00」が続き、CT画像領域が終わるともう一度「01」が続く。ここで、画素値「01」は、何も描かれていない領域(用紙の地の領域)であることを表わしている。   As shown in FIG. 9B, the pixel values of the pixels arranged on the arrow A in FIG. 9A are, in order from the left, first “01”, followed by “63” on the straight line L1, and again “01 ”Continues to“ FF ”on the straight line L2, returns to“ 01 ”again,“ 00 ”continues in the area where the CT image is fitted, and“ 01 ”continues again when the CT image area ends. Here, the pixel value “01” represents an area in which nothing is drawn (paper area).

図9(B)に示す元データに対し、差分演算を行なうと図9(C)に示す差分後データとなり、「00」の出現確率が大きく増加する。図8を参照して説明した、図4の差分符号化部520では、MSBの1ビット(符号ビット)は省略するため、その差分符号化部520から出力されるデータは、図9(D)のようになる。この場合であっても、図8を参照して説明したように、最初の画素値(図8の場合の1ライン目の画素値「12」)をそのまま伝えることによって、元データを順次復元することができる。   When the difference calculation is performed on the original data shown in FIG. 9B, the difference data shown in FIG. 9C is obtained, and the appearance probability of “00” is greatly increased. In the differential encoding unit 520 of FIG. 4 described with reference to FIG. 8, one bit (code bit) of the MSB is omitted, so that the data output from the differential encoding unit 520 is as shown in FIG. become that way. Even in this case, as described with reference to FIG. 8, the original data is sequentially restored by transmitting the first pixel value (the pixel value “12” of the first line in the case of FIG. 8) as it is. be able to.

次に、データ種別判定部510で2値データである旨判定された場合の差分符号化部520での処理について説明する。   Next, processing in the differential encoding unit 520 when the data type determination unit 510 determines that the data is binary data will be described.

この差分符号化部520では、データ種別判定部510から、今回入力されてきた入力画像ファイル中の画像データが2値データである旨の判定結果を受け取ると、その画像データを構成する2値がどのような値(例えば16進数で「01」と「FF」など)であっても、その2値のうちの一方の値を16進数で「00」もう一方の値を16進数で「80」に変換し、その後、この差分符号化部520では図8に示す差分符号化処理が行なわれる。   When the differential encoding unit 520 receives a determination result indicating that the image data in the input image file input this time is binary data from the data type determination unit 510, the binary constituting the image data is changed. Whatever value (for example, “01” and “FF” in hexadecimal), one of the two values is “00” in hexadecimal and the other is “80” in hexadecimal. Thereafter, the differential encoding unit 520 performs the differential encoding process shown in FIG.

図10は、00と80からなる2値データのときの差分符号化処理を示す図である。   FIG. 10 is a diagram showing a differential encoding process for binary data consisting of 00 and 80.

ここでは一列に並ぶ画素値が図10の「2値画像データ」欄に示すように、
「00 80 80 00 00 80 00 00 80 …」
であったとする。図8の場合と同様、ここでも、各画像値は、16進数2桁(1バイト=8ビット)で表現されている。先ず、1ライン目の画素値「00」については、そのまま出力する。
Here, as shown in the “binary image data” column of FIG.
"00 80 80 00 00 80 00 00 80 ..."
Suppose that As in the case of FIG. 8, here, each image value is expressed by two hexadecimal digits (1 byte = 8 bits). First, the pixel value “00” on the first line is output as it is.

次に、2ライン目の画素値「80」から1ライン目の画素値「00」を引き算し、その結果の値「80」を出力する。   Next, the pixel value “00” of the first line is subtracted from the pixel value “80” of the second line, and the resultant value “80” is output.

次に、3ライン目の画素値「80」から2ライン目の画素値「80」を引き算し、その結果の値「00」を出力する。   Next, the pixel value “80” of the second line is subtracted from the pixel value “80” of the third line, and the resulting value “00” is output.

次に、4ライン目の画素値「00」から3ライン目の画素値「80」を引き算し、その結果の値を出力する。ここで、「00」から「80」を引き算した結果は負の数となり、9ビットで「180」と表わされるが、MSBの1ビットである「1」は省略し、下位ビット8である「80」のみ出力する。   Next, the pixel value “80” of the third line is subtracted from the pixel value “00” of the fourth line, and the resultant value is output. Here, the result of subtracting “80” from “00” is a negative number and is expressed as “180” with 9 bits, but “1”, which is 1 bit of the MSB, is omitted, and the lower bit 8 is “ Only 80 "is output.

次に、5ライン目の画素値「00」から4ライン目の画素値「00」を引き算し、その結果の「00」を出力する。   Next, the pixel value “00” of the fourth line is subtracted from the pixel value “00” of the fifth line, and the result “00” is output.

以下、これと同じ演算を繰り返すことにより、図8の「差分エンコード」の欄に表わされている。   Hereinafter, by repeating the same calculation, it is represented in the “difference encoding” column of FIG.

「(00) 80 00 80 00 80 80 00 80…」
が出力される。
"(00) 80 00 80 00 80 80 00 80 ..."
Is output.

図1に示すインタフェース機器200では、この差分符号化されたデータを復号化するにあたり、図12の右側に示す演算が行なわれる。   In decoding the differentially encoded data, the interface device 200 shown in FIG. 1 performs the operation shown on the right side of FIG.

この復号化演算は、取り扱う数値が「00」と「80」との2値であることを除き、図8を参照して説明した復号化演算と同一であり、ここでは重複説明は省略する。   This decoding operation is the same as the decoding operation described with reference to FIG. 8 except that the numerical values to be handled are binary values of “00” and “80”, and redundant description is omitted here.

尚、上述したように差分符号化部520では、2値データの場合、その2値データを構成する2値がどのような値(例えば「01」と「FF」など)であっても「00」と「80」とに変換したが、図1に示すホストコントローラ100からインタフェース機器200に送信される圧縮情報には、どの値(例えば「01」と「FF」)をそれぞれ「00」と「80」に割り当てたか(例えば「01」を「00」に割り当て、「FF」を「80」に割り当てたなど)という情報を含ませておき、インタフェース機器では、図10の「デコード結果」の欄に示す、「00」と「80」とからなる2値データに復号化した後、それら「00」と「80」がそれら「00」と「80」に割り当てられたもともとの値に戻される(例えば「00」が「01」に戻され、「80」が「FF」に戻される)。   As described above, in the differential encoding unit 520, in the case of binary data, any value (for example, “01” and “FF”) constituting the binary data is “00”. ”And“ 80 ”. In the compression information transmitted from the host controller 100 shown in FIG. 1 to the interface device 200, which values (for example,“ 01 ”and“ FF ”) are“ 00 ”and“ 80 ”, respectively. In the interface device, the “decoding result” field in FIG. 10 is included. For example, the “decoding result” field in FIG. 10 includes the information that “80” is assigned (eg, “01” is assigned to “00” and “FF” is assigned to “80”). After being decoded into binary data consisting of “00” and “80”, these “00” and “80” are restored to the original values assigned to “00” and “80” ( For example, “00” is “0” Returned to "," 80 "is returned to" FF ").

図11は、図4の2値符号化部530における2値符号化処理の説明図である。   FIG. 11 is an explanatory diagram of the binary encoding process in the binary encoding unit 530 of FIG.

この2値符号化部530では、図4に示す差分符号化部520で差分符号化処理が行なわれた後の、「00」と「80」とからなる2値の画像データについて2値符号化処理が行なわれる。   In the binary encoding unit 530, binary encoding is performed on binary image data composed of “00” and “80” after the differential encoding process is performed by the differential encoding unit 520 shown in FIG. Processing is performed.

図4の差分符号化部520で差分符号化された画像データが、図11の「差分符号化された画像データ」の欄に示すように、
「00 00 00 00 00 80 80 80 …」
であったとする。
As shown in the column of “differential encoded image data” in FIG. 11, the image data differentially encoded by the differential encoding unit 520 of FIG.
"00 00 00 00 00 80 80 80 ..."
Suppose that

ここでは、これら「00」と「80」の2種類の数値が1ビットで識別される。ここでは、「00」が1ビットで「0」、「80」が1ビットで「1」で識別され、図11の「差分符号化された画像データ」の欄に示す、
「00 00 00 00 00 80 80 80 …」
の数値列が、図11の「2値符号化されたビットストリーム」の欄に示すように、
「0 0 0 0 0 1 1 1 …」
に変換され、さらにこのビットストリームを8ビットずつまとめて、「バイトパッキング化されたバイトストリーム」の欄に示すように、
「07 C0 03 81 …」
の数値列に変換される。この変換後の数値列は、図4の特定数値検出部540およびランレングス符号化部550に入力される。
Here, these two types of numerical values “00” and “80” are identified by one bit. Here, “00” is identified by 1 bit “0”, “80” is identified by 1 bit “1”, and is shown in the column of “differential encoded image data” in FIG.
"00 00 00 00 00 80 80 80 ..."
As shown in the column of “binary encoded bitstream” in FIG.
"0 0 0 0 0 1 1 1 ..."
In addition, as shown in the “byte-packeted byte stream” column, the bit stream is further grouped by 8 bits.
"07 C0 03 81 ..."
Converted to a numeric column. The converted numerical sequence is input to the specific numerical value detection unit 540 and the run length encoding unit 550 of FIG.

図1に示すインタフェース機器200における復号化にあたっては、上記の説明とは逆順序で処理が行なわれる。   In decoding in the interface device 200 shown in FIG. 1, processing is performed in the reverse order to the above description.

2値データの場合、この図11に示す2値符号化処理を行なうことにより、データ量を大幅に削減することができる。   In the case of binary data, the amount of data can be greatly reduced by performing the binary encoding process shown in FIG.

図4に示す差分符号化部520で前述の差分符号化処理が行なわれた後のデータは、多値データの場合はそのまま、2値データについては2値符号化部530で上記の2値符号化処理が行なわれた後、今度は、図4に示す特定数値検出部540とランレングス符号化部550の双方に入力される。   The data after the above-described differential encoding process is performed by the differential encoding unit 520 shown in FIG. 4 is the same as that in the case of multilevel data. After the conversion processing is performed, this is input to both the specific numerical value detection unit 540 and the run length encoding unit 550 shown in FIG.

ランレングス符号化部550では、差分符号化部520から受け取ったデータを構成する複数の数値のうちの特定の数値についてのみ符号化処理が行なわれるが、特定数値検出部540では差分符号化部520あるいは2値符号化部530から受け取ったデータの中からランレングス符号化部550で符号化処理を行なう数値(ここでは、この数値を「圧縮対象数値」と称する)と、その圧縮対象数値の連続数が検出される。   The run-length encoding unit 550 performs encoding processing only on specific numerical values among a plurality of numerical values constituting the data received from the differential encoding unit 520, while the specific numerical value detection unit 540 performs differential encoding unit 520. Alternatively, a numerical value (in this case, this numerical value is referred to as a “compression target numerical value”) in which the run-length encoding unit 550 performs encoding processing from the data received from the binary encoding unit 530 and a series of compression target numerical values. A number is detected.

本実施形態における、図4の特定数値検出部540では、一例として、「01」、「FF」および「00」の3つの数値を圧縮対象数値としている。   In the specific numerical value detection unit 540 of FIG. 4 in this embodiment, as an example, three numerical values “01”, “FF”, and “00” are used as compression target numerical values.

LW画像の背景等は、用紙の地の色そのものを表わす「01」が多いと考えられるため、ここでは、この「01」を圧縮対象数値の1つとしている。   Since it is considered that the background of the LW image has a lot of “01” representing the color of the background of the paper, “01” is one of the numerical values to be compressed here.

また、「FF」は最大濃度を表わす値である。LW画像の文字の部分は画素値が「FF」とは限らないが、「FF」の出現頻度が比較的多いため、ここでは「FF」も圧縮対象数値の1つとしている。   “FF” is a value representing the maximum density. The character portion of the LW image does not always have a pixel value of “FF”, but “FF” appears relatively frequently, so “FF” is also one of the numerical values to be compressed here.

さらに、LW画像中の「00」は、図2に示すインタフェース機器内部処理中の合成/タグ付加処理においてLWデータではなくCTデータの方を選択することを指示する値であり、図1に示すプリンタ300で最終的にプリントされる画像1枚中にLW画像とCT画像とが混在した画像である場合に、LWデータ中「00」も出現頻度が高い画素値となる。このため、ここでは、この「00」も圧縮対象数値の1つとしている。   Further, “00” in the LW image is a value for instructing to select CT data instead of LW data in the synthesis / tag addition processing in the interface device internal processing shown in FIG. In the case where the LW image and the CT image are mixed in one image finally printed by the printer 300, “00” in the LW data is also a pixel value having a high appearance frequency. For this reason, here, “00” is also one of the numerical values to be compressed.

ここでは、上記のとおり「01」、「FF」、「00」の3つの数値を圧縮対象数値としているが、以下の理由から「FD」、「02」も圧縮対象数値として指定してもよい。   Here, as described above, the three numerical values “01”, “FF”, and “00” are the compression target numerical values, but “FD” and “02” may also be specified as the compression target numerical values for the following reason. .

図4に示す実施形態では、図4のランレングス符号化部550の前段に差分符号化部520が置かれている。そこで、上記の出現頻度の高い3つの数値「00」、「FF」、「01」の間の差分を求めると、符号ビットを除き、
FF−00=FF
00−FF=01
01−00=01
01−01=FF
FF−01=FE
02−FF=02
となるが、これら6つの差分値のうちの、「FF」と「01」は既に上の理由により圧縮対象数値として挙げられており、残りの、「FE」と「02」を圧縮対象数値として加えて、「01」、「FF」、「00」、「FE」、および「02」の5つを圧縮対象数値としてもよい。
In the embodiment shown in FIG. 4, a differential encoding unit 520 is placed in the preceding stage of the run length encoding unit 550 of FIG. 4. Therefore, when the difference between the above three frequently occurring numerical values “00”, “FF”, “01” is obtained, the sign bit is excluded,
FF-00 = FF
00-FF = 01
01-00 = 01
01-01 = FF
FF-01 = FE
02-FF = 0
Of these six difference values, “FF” and “01” have already been cited as compression target values for the above reasons, and the remaining “FE” and “02” are used as compression target values. In addition, five values “01”, “FF”, “00”, “FE”, and “02” may be set as the compression target numerical values.

ただし、ここでは、「01」、「FF」、「00」の3つが圧縮対象数値として指定されているものとして説明を続ける。   However, here, the description will be continued on the assumption that three of “01”, “FF”, and “00” are designated as compression target numerical values.

図12は、図4に示すランレングス符号化部550での符号化の説明図である。図12の上のラインは、差分符号化部520あるいは2値符号化部530から受け取ったデータ、下のラインは、ランレングス符号化部550での符号化処理を行なった後のデータである。   FIG. 12 is an explanatory diagram of encoding in the run-length encoding unit 550 shown in FIG. The upper line in FIG. 12 is data received from the differential encoding unit 520 or the binary encoding unit 530, and the lower line is data after the encoding process in the run length encoding unit 550 is performed.

ここでは、図12の上のラインに示すように、差分符号化部520あるいは2値符号化部530からは、
「06 02 02 02 01 01 01 01 04 05 00 … 」
なるデータが入力されたものとする。このとき、図4の特定数値検出部540では、先頭の「06」は圧縮対象数値ではなく、次に続く「02 02 02」も圧縮対象数値ではなく、次に、圧縮対象数値である「01」が4つ連続していること、次に、圧縮対象数値ではない「04」、「05」を間に置いて、圧縮対象数値である「00」が32767個連続していることが検出され、その情報が図4のランレングス符号化部550に伝達される。
Here, as shown in the upper line of FIG. 12, from the differential encoding unit 520 or the binary encoding unit 530,
"06 02 02 02 01 01 01 01 01 04 05 00 ..."
It is assumed that the following data is input. At this time, in the specific numerical value detection unit 540 of FIG. 4, the leading “06” is not the compression target numerical value, and the subsequent “02 02 02” is not the compression target numerical value. ”Is consecutive, and next, it is detected that 32767 consecutive“ 00 ”numerical values to be compressed with“ 04 ”and“ 05 ”that are not numerical values to be compressed in between. The information is transmitted to the run-length encoding unit 550 of FIG.

図13は、ランレングス符号化部における、圧縮対象数値を対象にした符号化のアルゴリズムを示す図である。   FIG. 13 is a diagram illustrating an encoding algorithm for a numerical value to be compressed in the run-length encoding unit.

この図13中、Zは同一の圧縮対象数値の連続数、例えば図12の上のラインの「01」についてはZ=4、「00」についてはZ=32767である。   In FIG. 13, Z is a continuous number of the same numerical values to be compressed, for example, Z = 4 for “01” in the upper line of FIG. 12, and Z = 32767 for “00”.

また、図13中、「YY」は、16進2桁で表わされた圧縮対象数値自体を表わしている。その「YY」に続く、「0」又は「1」は1ビットで表現された「0」又は「1」であり、さらにそれに続く「XX…」は、1つの「X」が1ビットを表わしており、この「XX…」でZの値を表現している。   In FIG. 13, “YY” represents the numerical value to be compressed itself represented by two hexadecimal digits. “0” or “1” following “YY” is “0” or “1” expressed by 1 bit, and “XX...” That follows “XY” represents one bit. This “XX...” Represents the value of Z.

すなわち、図13は、圧縮対象数値「YY」がZ<128連続するときは、1バイト目で圧縮対象数値「YY」を表現し、それに続く1バイトで、先頭ビットが「0」、それに続く7ビットでZの値を表現すること、また、圧縮対象数値「YY」がZ≧128連続するときは、1バイト目で圧縮対象数値「YY」を表現し、それに続く2バイト(16ビット)のうちの先頭の1ビットを「1」とすることで2バイトに跨って表現されていることを表現し、それに続く15ビットで、Zの値を表現することを意味している。   That is, in FIG. 13, when the compression target numerical value “YY” continues for Z <128, the compression target numerical value “YY” is expressed by the first byte, the first bit is “0”, and the subsequent byte is the subsequent one. Express the value of Z with 7 bits, and when the compression target numerical value “YY” continues Z ≧ 128, express the compression target numerical value “YY” with the first byte, followed by 2 bytes (16 bits) The first 1 bit of “1” is expressed as “1” to express that it is expressed over 2 bytes, and the subsequent 15 bits indicate that the value of Z is expressed.

この図13に示す規則に従って図12に示す符号化の例について説明する。   An example of encoding shown in FIG. 12 will be described in accordance with the rules shown in FIG.

図4の差分符号化部520あるいは2値符号化部530から入力されてきたデータ(上のライン)を構成する先頭の数値「06」は圧縮対象数値ではないため、その「06」のまま出力される。また、それに続く「02 02 02」も、「02」は圧縮対象数値ではなく、これら3つの「02」もそのまま出力される。次に、圧縮対象数値である「01」が4個連続するため、「01 04」に符号化される。次の「04」及び「05」は圧縮対象数値ではないため、そのまま「04 05」が出力される。   Since the first numerical value “06” constituting the data (upper line) input from the differential encoding unit 520 or the binary encoding unit 530 in FIG. 4 is not a compression target numerical value, the “06” is output as it is. Is done. In addition, “02 02 02” that follows, “02” is not a numerical value to be compressed, and these three “02” are output as they are. Next, since “01”, which is a numerical value to be compressed, continues, it is encoded into “01 04”. Since the next “04” and “05” are not compression target numerical values, “04 05” is output as it is.

次に「00」が32767個連続しているため、「00」を置き、次の1バイトのうちの先頭の1ビットを「1」とし、次いで15ビットで32767−128を表現することにより、「00 FF 7F」の3バイトで「00」が32767個連続していることを表現する。すなわち、連続数128は、最初のビット「1」を除き、「00 00」と表現される。   Next, since there are 32767 consecutive “00s”, “00” is placed, the first 1 bit of the next 1 byte is set to “1”, and then 32767-128 is expressed by 15 bits. It represents that 32767 “00” s are consecutive in 3 bytes of “00 FF 7F”. That is, the consecutive number 128 is expressed as “00 00” except for the first bit “1”.

図14は、図4のランレングス符号化部550における、連続数に応じた符号化処理の例を示す図である。
・「00」が127個連続するときは、2バイトを用いて「00 7E」に符号化され、
・「00」が32767個連続するときは、3バイトを用いて「00 FF 7E」に符号化され、
・「00」が32895個連続するときは、3バイトを用いて「00 FF FF」に符号化され、
・「00」が128個連続するときは、3バイトを用いて「00 80 00」に符号化され、
・「FF」が4096個連続するときは、3バイトを用いて「FF 8F 80」に符号化される。
FIG. 14 is a diagram illustrating an example of an encoding process according to the number of consecutive steps in the run-length encoding unit 550 of FIG.
When “00” is 127 consecutive, it is encoded to “00 7E” using 2 bytes,
When “00” is 32767 consecutive, it is encoded into “00 FF 7E” using 3 bytes,
When “00” is 32895 consecutive, it is encoded into “00 FF FF” using 3 bytes,
When “00” is 128 consecutive, it is encoded to “00 80 00” using 3 bytes,
-When 4096 "FFs" are contiguous, they are encoded into "FF 8F 80" using 3 bytes.

図4に示すランレングス符号化部550では、上記のような符号化処理が行なわれる。   The run-length encoding unit 550 shown in FIG. 4 performs the encoding process as described above.

この場合、圧縮対象数値以外の数値についてはそのまま出力されるため、図3を参照して説明したPackBits符号化のような、かえって冗長になってしまうという事態が回避される。また、図3のPackBits符号化の場合は、最大圧縮率は1/64であるが、本実施形態によるランレングス符号化部550によれば、最大圧縮率は、3/32895=1/10,965にまで向上する。   In this case, since the numerical values other than the compression target numerical values are output as they are, the situation of becoming redundant rather than the PackBits encoding described with reference to FIG. 3 is avoided. 3, the maximum compression rate is 1/64, but according to the run-length encoding unit 550 according to the present embodiment, the maximum compression rate is 3/32895 = 1/10, It improves to 965.

図4のランレングス符号化部550で上記の符号化処理の行なわれた後のデータは、次に図4のデータスキャニング部560およびハフマン符号化部570に入力される。   The data after the above-described encoding process is performed by the run-length encoding unit 550 in FIG. 4 is then input to the data scanning unit 560 and the Huffman encoding unit 570 in FIG.

データスキャニング部560では、1枚のLW画像全体を構成する画素について画素値の出現頻度を求め、その出現頻度の順序をハフマン符号化部570に伝える。   The data scanning unit 560 obtains the appearance frequency of pixel values for the pixels constituting the entire LW image, and informs the Huffman coding unit 570 of the order of the appearance frequencies.

ここでは、「A1」の出現頻度が最も強く、以下順に、「A2」、「A3」、「A4」、…の順であるとする。尚、これら「A1」、「A2」等は数値を直接表わしている訳ではなく、数値を表わす符号である。すなわち、「A1」は例えば数値「00」、「A2」は数値「FF」等である。また、ここでは、簡単のため、図4のランレングス符号化部550から送られてくるデータは全ての画素が「A1」〜「A16」の16個の数値のうちのいずれかの数値で表わされるものとする。   Here, the appearance frequency of “A1” is the strongest, and it is assumed that “A2”, “A3”, “A4”,. These “A1”, “A2” and the like do not directly represent numerical values, but are symbols representing numerical values. That is, “A1” is, for example, a numerical value “00”, “A2” is a numerical value “FF”, and the like. Here, for simplicity, the data sent from the run-length encoding unit 550 of FIG. 4 is expressed by any one of the 16 numerical values “A1” to “A16” for all pixels. Shall be.

図15は、図4に示すハフマン符号化部570における符号化処理を例示した図である。   FIG. 15 is a diagram illustrating an encoding process in the Huffman encoder 570 illustrated in FIG. 4.

ここでは、出現頻度の最も高い「A1」は、2ビットで表わされた「00」に置き換えられ、次の「A2」は、やはり2ビットで表わされた「01」に置き換えられ、次の「A3」、さらに次の「A4」は、3ビットで表わされる、それぞれ、「100」、「101」に置き換えられ、次の「A5」〜「A8」は、5ビットで表わされる各数値に置き換えられ、以下同様に、出現頻度が低い数値ほど多くのビット数で表わされた数値に置き換えられる。   Here, “A1” having the highest appearance frequency is replaced with “00” represented by 2 bits, and the next “A2” is replaced with “01” also represented by 2 bits. "A3" and further "A4" are replaced by "100" and "101", respectively, and the following "A5" to "A8" are numerical values expressed by 5 bits. In the same manner, a numerical value with a lower appearance frequency is replaced with a numerical value represented by a larger number of bits.

図16は、ハフマンテーブルの一例を示す図である。   FIG. 16 is a diagram illustrating an example of the Huffman table.

このハフマンテーブルは、図15と一致させてあり、出現頻度が高いほど短かいビット数で表わされた数値に置き換えられるように並べた、符号化前(置き換え前)の数値と符号化後(置き換え後)の数値との対応テーブルである。   This Huffman table is consistent with FIG. 15 and is arranged so that the higher the appearance frequency is, the shorter the number of bits is, and the number before encoding (before replacement) and after encoding ( It is a correspondence table with numerical values after replacement.

図1に示すインタフェース機器200では、このハフマンテーブルを参照することにより、ハフマン符号化に対する復号化が行なわれる。   The interface device 200 shown in FIG. 1 performs decoding for Huffman coding by referring to the Huffman table.

図17は、図4に示すデータ圧縮装置500から出力される画像データのデータフォーマットの一例を示す図である。   FIG. 17 is a diagram illustrating an example of a data format of image data output from the data compression apparatus 500 illustrated in FIG.

最初に画像データファイルの先頭であることを表わすSOI(Start Of Image)であることを表わすの符号が配置され、次いで画像のサイズ等の情報が記録されたヘッダが続き、さらにその後に、図4のデータ圧縮装置500で行なわれたデータ圧縮処理に関する圧縮情報が配置される。この圧縮情報には、図4のデータ種別判定部510で判定された2値データと多値データとの区別を表わす情報、2値データのときは、2値符号化部530における、「00」と「80」に割り当てた各数値を表わす情報、ハフマン符号化部570で用いられたハフマンテーブル(図16参照)等、図1のインタフェース機器200での復号化に必要な全ての情報が含まれている。   First, a code indicating SOI (Start Of Image) indicating the beginning of the image data file is arranged, followed by a header in which information such as the size of the image is recorded, followed by FIG. The compression information related to the data compression processing performed by the data compression apparatus 500 is arranged. The compressed information includes information indicating the distinction between binary data and multi-value data determined by the data type determination unit 510 in FIG. 4. In the case of binary data, “00” in the binary encoding unit 530. 1 and information representing each numerical value assigned to “80”, the Huffman table used in the Huffman encoder 570 (see FIG. 16), etc., all information necessary for decoding by the interface device 200 in FIG. ing.

この圧縮情報の後には、ハフマン符号化後の実際の画像データが続き、最後にEOI(End Of Image)の符号で締め括られる。   This compressed information is followed by actual image data after Huffman coding, and finally concluded with a code of EOI (End Of Image).

図4に示すデータ圧縮装置500からは、図17に示すように形式が整えられた画像データファイルが図1に示すインタフェース機器200に転送され、インタフェース機器200では、これまで説明してきた符号化とは逆の順序で復号化が行なわれることによりデータ伸長が行なわれ、図4に示すデータ圧縮装置500に入力する前の入力画像ファイル内の画像データと同一の画像データに復元される。   From the data compression apparatus 500 shown in FIG. 4, the image data file whose format is arranged as shown in FIG. 17 is transferred to the interface device 200 shown in FIG. 1, and the interface device 200 performs the encoding described above. The data is decompressed by decoding in the reverse order, and restored to the same image data as the image data in the input image file before being input to the data compression apparatus 500 shown in FIG.

尚、図4に示すデータ圧縮装置500では、差分符号化部520を備えており、この差分符号化部520を備えると、前述したように数値「00」の出現頻度が増加するため好ましいが、本発明ではこの差分符号化部520を備えることは必ずしも必要ではなく、入力されてきたデータに差分符号化処理を行なうことなく、2値データについては直接に2値符号化部530に入力し、あるいは多値データについては直接に特定数値検出部540およびランレングス符号化部550に入力してもよい。あるいは、上述の差分符号化を行なう差分符号化部520に代えて、他のデータ圧縮処理を行なう符号化部をそこに配置してもよい。   Note that the data compression apparatus 500 shown in FIG. 4 includes the differential encoding unit 520, and it is preferable to include the differential encoding unit 520 because the appearance frequency of the numerical value “00” increases as described above. In the present invention, it is not always necessary to include the differential encoding unit 520. Binary data is directly input to the binary encoding unit 530 without performing differential encoding processing on the input data. Alternatively, the multi-value data may be directly input to the specific numerical value detection unit 540 and the run length encoding unit 550. Alternatively, instead of the above-described differential encoding unit 520 that performs differential encoding, an encoding unit that performs other data compression processing may be arranged there.

また、図4に示すデータ圧縮装置500では、ランレングス符号化部550の後段にハフマン符号化部570を置いており、ランレングス符号化部550により符号化された後のデータに対しさらにハフマン符号化処理が行なわれる構成となっているが、ランレングス符号化部550により符号化された後のデータに対しハフマン符号化処理を行なうことは必ずしも必要ではなく、ハフマン符号化処理に代えて他のエントロピー符号化処理を行なってもよく、ランレングス符号化部550により符号化されたデータをそのままこのデータ圧縮装置500から出力してもよい。   Also, in the data compression apparatus 500 shown in FIG. 4, a Huffman encoding unit 570 is placed after the run length encoding unit 550, and the Huffman code is further added to the data encoded by the run length encoding unit 550. However, it is not always necessary to perform the Huffman encoding process on the data encoded by the run-length encoding unit 550, and other Huffman encoding processes may be used instead of the Huffman encoding process. Entropy encoding processing may be performed, and the data encoded by the run length encoding unit 550 may be output from the data compression apparatus 500 as it is.

さらに、図4のデータ圧縮装置500にはデータ種別判定部510を備え、入力画像ファイル中の画像データが2値データであるか多値データであるかの判定を行なっているが、外部から2値データと多値データの区別を表わす情報を入手できるときは、このデータ種別判定部510は必ずしも必要ではない。   Further, the data compression apparatus 500 of FIG. 4 includes a data type determination unit 510 that determines whether the image data in the input image file is binary data or multi-value data. When information representing the distinction between value data and multi-value data can be obtained, this data type determination unit 510 is not necessarily required.

また、上述の実施形態は、本発明をLWデータに適用した例であるが、本発明はそのデータ圧縮の対象がLWデータのみに限られるものではなく、画像の性質等によってはCTデータやLWとCTとが混在した画像データに適用しても十分なデータ圧縮を行なうことができるものである。   The above-described embodiment is an example in which the present invention is applied to LW data. However, the present invention is not limited to data compression only for LW data. Depending on the properties of an image, CT data and LW Even when applied to image data in which CT and CT are mixed, sufficient data compression can be performed.

データ圧縮技術が適用されたプリントシステムの一例を示す図である。1 is a diagram illustrating an example of a print system to which a data compression technique is applied. プリントシステムにおけるデータ処理の流れを示す図である。FIG. 6 is a diagram illustrating a flow of data processing in the print system. PackBits符号化方式の説明図である。It is explanatory drawing of a PackBits encoding system. 本発明のデータ圧縮装置の一実施形態を示すブロック構成図である。It is a block block diagram which shows one Embodiment of the data compression apparatus of this invention. 図1に示すホストコントローラのハードウェア構成図である。It is a hardware block diagram of the host controller shown in FIG. 本発明のデータ圧縮処理プログラムの模式構成図である。It is a schematic block diagram of the data compression processing program of this invention. 図4のデータ圧縮装置に入力される入力画像ファイル中の画像データのデータ構造および差分符号化の概念を示す図である。FIG. 5 is a diagram illustrating a data structure of image data in an input image file input to the data compression apparatus in FIG. 4 and a concept of differential encoding. 図4のデータ圧縮装置を構成する差分符号化部における差分符号化処理を例示して示す図である。It is a figure which illustrates and illustrates the differential encoding process in the differential encoding part which comprises the data compression apparatus of FIG. 差分符号化による作用説明図である。It is operation | movement explanatory drawing by difference encoding. 00と80からなる2値データのときの差分符号化処理を示す図である。It is a figure which shows the difference encoding process in the case of the binary data which consists of 00 and 80. 図4の2値符号化部における2値符号化処理の説明図である。It is explanatory drawing of the binary encoding process in the binary encoding part of FIG. 図4に示すランレングス符号化部での符号化の説明図である。It is explanatory drawing of the encoding in the run length encoding part shown in FIG. ランレングス符号化部における、圧縮対象数値を対象にした符号化のアルゴリズムを示す図である。It is a figure which shows the algorithm of the encoding for the numerical value for compression in a run length encoding part. 図4のランレングス符号化部における、連続数に応じた符号化処理の例を示す図である。FIG. 5 is a diagram illustrating an example of an encoding process according to a continuous number in the run length encoding unit of FIG. 4. 図4に示すハフマン符号化部における符号化処理を例示した図である。It is the figure which illustrated the encoding process in the Huffman encoding part shown in FIG. ハフマンテーブルの一例を示す図である。It is a figure which shows an example of a Huffman table. 図4に示すデータ圧縮装置から出力される画像データのデータフォーマットの一例を示す図である。FIG. 5 is a diagram illustrating an example of a data format of image data output from the data compression apparatus illustrated in FIG. 4.

符号の説明Explanation of symbols

11 データ
12A,12B,13A,13B, ビットマップデータ
14 圧縮データ
15 LW可逆圧縮データ
100 ホストコントローラ
140 CDROM
150 汎用インタフェース
200 インタフェース機器
250 専用インターフェース
300 プリンタ
500 データ圧縮装置
510 データ種別判別部
520 差分符号化部
530 2値符号化部
540 特定数値検出部
550 ランレングス符号化部
560 データスキャニング部
570 ハフマン符号化部
600 データ圧縮プログラム
610 データ種別判定部
620 差分符号化部
630 2値符号化部
640 特定数値検出部
650 ランレングス符号化部
660 データスキャニング部
670 ハフマン符号化部
11 data 12A, 12B, 13A, 13B, bitmap data 14 compressed data 15 LW lossless compressed data 100 host controller 140 CDROM
DESCRIPTION OF SYMBOLS 150 General-purpose interface 200 Interface apparatus 250 Dedicated interface 300 Printer 500 Data compression apparatus 510 Data type discrimination | determination part 520 Differential encoding part 530 Binary encoding part 540 Specific numerical value detection part 550 Run length encoding part 560 Data scanning part 570 Huffman encoding Unit 600 data compression program 610 data type determination unit 620 differential encoding unit 630 binary encoding unit 640 specific numerical value detection unit 650 run length encoding unit 660 data scanning unit 670 Huffman encoding unit

Claims (16)

所定の単位ビット数で表わされる数値の連続からなる被圧縮データにデータ圧縮処理を施すデータ圧縮装置において、
被圧縮データ中、1つもしくは複数の所定の圧縮対象数値を除く数値についてはそのまま出力すると共に、圧縮対象数値については、該圧縮対象数値と、該圧縮対象数値と同一の圧縮対象数値の連続数を表わす数値とに符号化して出力する第1のデータ圧縮部と、
被圧縮データが2種類の数値のみで表現される2値データである場合に、該2種類の数値を1ビットで識別し該1ビットの連続を単位ビット数ごとにまとめることにより単位ビット数で表わされる数値の連続からなる新たな被圧縮データを生成して前記第1のデータ圧縮部に渡す第2のデータ圧縮部とを備えたことを特徴とするデータ圧縮装置。
In a data compression apparatus that performs data compression processing on data to be compressed consisting of a series of numerical values represented by a predetermined number of unit bits,
Among the data to be compressed, numerical values other than one or a plurality of predetermined compression target numerical values are output as they are, and for the compression target numerical values, the compression target numerical value and the number of consecutive compression target numerical values that are the same as the compression target numerical value A first data compression unit that encodes and outputs a numerical value representing
When the data to be compressed is binary data represented by only two kinds of numerical values, the two kinds of numerical values are identified by one bit, and the continuation of the one bit is collected for each unit bit number. A data compression apparatus comprising: a second data compression unit that generates new compressed data composed of a series of expressed numerical values and passes the data to the first data compression unit.
前記第1のデータ圧縮部は、同一の圧縮対象数値の連続数に応じ、該連続数を異なるビット数で表現する符号化を行なうものであることを特徴とする請求項1記載のデータ圧縮装置。   2. The data compression apparatus according to claim 1, wherein the first data compression unit performs encoding to express the continuous number with a different number of bits according to the continuous number of the same numerical value to be compressed. . 前記第1のデータ圧縮部は、同一の圧縮対象数値の連続数が所定数以下のときは該連続数を1単位ビット数で表現し、該連続数が該所定数を越えるときは2単位ビット数で表現する符号化を行なうものであることを特徴とする請求項2記載のデータ圧縮装置。   The first data compression unit expresses the continuous number by one unit bit number when the number of consecutive identical numerical values to be compressed is equal to or smaller than a predetermined number, and two unit bits when the continuous number exceeds the predetermined number 3. The data compression apparatus according to claim 2, wherein encoding is performed by a number. 前記第1のデータ圧縮部および前記第2のデータ圧縮部の前段に、被圧縮データを構成する数値の連続について隣接する数値どうしの差分を求めることにより該差分を表わす数値の連続からなる新たな被圧縮データを生成する第3のデータ圧縮部を備えたことを特徴とする請求項1記載のデータ圧縮装置。   The first stage of the first data compression unit and the second data compression unit is a new stage consisting of a series of numerical values representing the difference by obtaining a difference between adjacent numerical values for a series of numerical values constituting the compressed data. The data compression apparatus according to claim 1, further comprising a third data compression unit that generates data to be compressed. 前記第3のデータ圧縮部は、被圧縮データを構成する数値の連続を順次区切ったときの各区切りごとの先頭の数値についてはそのまま出力するとともに、該先頭の数値以外については隣接する数値どうしの差分のうちの下位の単位ビット数で表わされる数値を出力するものであることを特徴とする請求項4記載のデータ圧縮装置。   The third data compression unit outputs the first numerical value for each delimiter when the sequence of the numerical values constituting the compressed data is sequentially delimited, and the other numerical values other than the first numerical value are adjacent to each other. 5. The data compression apparatus according to claim 4, wherein a numerical value represented by a lower unit bit number of the difference is output. 前記第3のデータ圧縮部は、被圧縮データが前記2値データである場合に、該2値データを構成する2種類の数値を16進数で00と80とで識別し00と80との連続からなる被圧縮データについて前記差分を求めて該差分を表わす数値の連続からなる新たな被圧縮データを生成するものであることを特徴とする請求項4記載のデータ圧縮装置。   When the data to be compressed is the binary data, the third data compression unit identifies the two types of numerical values constituting the binary data as 00 and 80 in hexadecimal numbers, and continues the 00 and 80. 5. The data compression apparatus according to claim 4, wherein the difference is obtained for data to be compressed, and new data to be compressed consisting of a series of numerical values representing the difference is generated. 前記第1のデータ圧縮部および前記第2のデータ圧縮部の後段に、前記第1のデータ圧縮部で符号化された後のデータにエントロピー符号化を施す第4のデータ圧縮部を備えたことを特徴とする請求項1記載のデータ圧縮装置。   A fourth data compression unit that performs entropy coding on the data that has been encoded by the first data compression unit is provided at a stage subsequent to the first data compression unit and the second data compression unit. The data compression apparatus according to claim 1. 被圧縮データが2種類の数値のみを含む2値データであるかあるいは3種類以上の数値を含む多値データであるかを判定するデータ種別判定部を備えたことを特徴とする請求項1記載のデータ圧縮装置。   2. A data type determination unit for determining whether the data to be compressed is binary data including only two types of numerical values or multi-value data including three or more types of numerical values. Data compression device. プログラムを実行する情報処理装置内で実行され、該情報処理装置を、所定の単位ビット数で表わされる数値の連続からなる被圧縮データにデータ圧縮処理を施すデータ圧縮装置として動作させるデータ圧縮プログラムであって、
前記情報処理装置を、
被圧縮データ中、1つもしくは複数の所定の圧縮対象数値を除く数値についてはそのまま出力すると共に、圧縮対象数値については、該圧縮対象数値と、該圧縮対象数値と同一の圧縮対象数値の連続数を表わす数値とに符号化して出力する第1のデータ圧縮部と、
被圧縮データが2種類の数値のみを含む2値データである場合に、該2種類の数値を1ビットで識別し該1ビットの連続を単位ビット数ごとにまとめることにより単位ビット数で表わされる数値の連続からなる新たな被圧縮データを生成して前記第1のデータ圧縮部に渡す第2のデータ圧縮部とを備えたデータ圧縮装置として動作させることを特徴とするデータ圧縮プログラム。
A data compression program that is executed in an information processing apparatus that executes a program, and causes the information processing apparatus to operate as a data compression apparatus that performs data compression processing on data to be compressed consisting of a series of numerical values represented by a predetermined number of unit bits. There,
The information processing apparatus;
Among the data to be compressed, numerical values other than one or a plurality of predetermined compression target numerical values are output as they are, and for the compression target numerical values, the compression target numerical value and the continuous number of the compression target numerical values that are the same as the compression target numerical value A first data compression unit that encodes and outputs a numerical value representing
When the data to be compressed is binary data including only two kinds of numerical values, the two kinds of numerical values are identified by one bit, and the continuation of the one bit is grouped by the unit bit number to be expressed by the unit bit number. A data compression program that operates as a data compression apparatus including a second data compression unit that generates new compressed data composed of a series of numerical values and passes the data to the first data compression unit.
前記第1のデータ圧縮部は、同一の圧縮対象数値の連続数に応じ、該連続数を異なるビット数で表現する符号化を行なうものであることを特徴とする請求項9記載のデータ圧縮プログラム。   10. The data compression program according to claim 9, wherein the first data compression unit performs encoding to express the continuous number with a different number of bits according to the continuous number of the same numerical value to be compressed. . 前記第1のデータ圧縮部は、同一の圧縮対象数値の連続数が所定数以下のときは該連続数を1単位ビット数で表現し、該連続数が該所定数を越えるときは2単位ビット数で表現する符号化を行なうものであることを特徴とする請求項10記載のデータ圧縮プログラム。   The first data compression unit expresses the continuous number by one unit bit number when the number of consecutive identical numerical values to be compressed is equal to or smaller than a predetermined number, and two unit bits when the continuous number exceeds the predetermined number 11. The data compression program according to claim 10, wherein the data compression program performs encoding expressed by a number. 前記第1のデータ圧縮部および前記第2のデータ圧縮部の前段に、被圧縮データを構成する数値の連続について隣接する数値どうしの差分を求めることにより該差分を表わす数値の連続からなる新たな被圧縮データを生成する第3のデータ圧縮部を備えたデータ圧縮装置として動作させることを特徴とする請求項9記載のデータ圧縮プログラム。   The first stage of the first data compression unit and the second data compression unit is a new stage consisting of a series of numerical values representing the difference by obtaining a difference between adjacent numerical values for a series of numerical values constituting the compressed data. The data compression program according to claim 9, wherein the data compression program is operated as a data compression apparatus including a third data compression unit that generates data to be compressed. 前記第3のデータ圧縮部は、被圧縮データを構成する数値の連続を順次区切ったときの各区切りごとの先頭の数値についてはそのまま出力するとともに、該先頭の数値以外については隣接する数値どうしの差分のうちの下位の単位ビット数で表わされる数値を出力するものであることを特徴とする請求項12記載のデータ圧縮プログラム。   The third data compression unit outputs the first numerical value for each delimiter when the sequence of the numerical values constituting the compressed data is sequentially delimited, and the other numerical values other than the first numerical value are adjacent to each other. 13. The data compression program according to claim 12, wherein a numerical value represented by a lower unit bit number of the difference is output. 前記第3のデータ圧縮部は、被圧縮データが前記2値データである場合に、該2値データを構成する2種類の数値を16進数で00と80とで識別し00と80との連続からなる被圧縮データについて前記差分を求めて該差分を表わす数値の連続からなる新たな被圧縮データを生成するものであることを特徴とする請求項12記載のデータ圧縮プログラム。   When the data to be compressed is the binary data, the third data compression unit identifies the two types of numerical values constituting the binary data as 00 and 80 in hexadecimal numbers, and continues the 00 and 80. 13. The data compression program according to claim 12, wherein the difference is obtained for data to be compressed and new data to be compressed consisting of a series of numerical values representing the difference is generated. 前記第1のデータ圧縮部および前記第2のデータ圧縮部の後段に、前記第1のデータ圧縮部で符号化された後のデータにエントロピー符号化を施す第4のデータ圧縮部を備えたデータ圧縮装置として動作させることを特徴とする請求項9記載のデータ圧縮プログラム。   Data provided with a fourth data compression unit that performs entropy coding on the data that has been encoded by the first data compression unit after the first data compression unit and the second data compression unit The data compression program according to claim 9, wherein the data compression program is operated as a compression device. 被圧縮データが2種類の数値のみで表現される2値データであるかあるいは3種類以上の数値で表現される多値データであるかを判定するデータ種別判定部を備えたデータ圧縮装置として動作させることを特徴とする請求項9記載のデータ圧縮プログラム。   Operates as a data compression device having a data type determination unit that determines whether the data to be compressed is binary data represented by only two types of numeric values or multi-value data represented by three or more types of numeric values The data compression program according to claim 9, wherein the data compression program is executed.
JP2004058645A 2004-01-26 2004-03-03 Device and program for compressing data Withdrawn JP2005252531A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2004058645A JP2005252531A (en) 2004-03-03 2004-03-03 Device and program for compressing data
US11/042,535 US7684629B2 (en) 2004-01-26 2005-01-26 Data compression apparatus, and data compression program storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004058645A JP2005252531A (en) 2004-03-03 2004-03-03 Device and program for compressing data

Publications (1)

Publication Number Publication Date
JP2005252531A true JP2005252531A (en) 2005-09-15

Family

ID=35032620

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004058645A Withdrawn JP2005252531A (en) 2004-01-26 2004-03-03 Device and program for compressing data

Country Status (1)

Country Link
JP (1) JP2005252531A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008017115A (en) * 2006-07-05 2008-01-24 Fujifilm Corp Data compression apparatus and data compression program
JP2008022310A (en) * 2006-07-13 2008-01-31 Fujifilm Corp Data compression method and apparatus, and program
JP2008035066A (en) * 2006-07-27 2008-02-14 Fujifilm Corp Data compression apparatus and data compression program
JP2009188000A (en) * 2008-02-04 2009-08-20 Nuflare Technology Inc Writing apparatus and writing data conversion method

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008017115A (en) * 2006-07-05 2008-01-24 Fujifilm Corp Data compression apparatus and data compression program
JP4689545B2 (en) * 2006-07-05 2011-05-25 富士フイルム株式会社 Data compression apparatus and data compression program
JP2008022310A (en) * 2006-07-13 2008-01-31 Fujifilm Corp Data compression method and apparatus, and program
JP4709086B2 (en) * 2006-07-13 2011-06-22 富士フイルム株式会社 Data compression method, apparatus and program
JP2008035066A (en) * 2006-07-27 2008-02-14 Fujifilm Corp Data compression apparatus and data compression program
JP4699307B2 (en) * 2006-07-27 2011-06-08 富士フイルム株式会社 Data compression apparatus and data compression program
JP2009188000A (en) * 2008-02-04 2009-08-20 Nuflare Technology Inc Writing apparatus and writing data conversion method

Similar Documents

Publication Publication Date Title
US7826670B2 (en) Data compression apparatus and data compression program storage medium
JP4689545B2 (en) Data compression apparatus and data compression program
US7183950B2 (en) Data compression apparatus, and data compression program storage medium
JP2006121645A (en) Image compression apparatus and image compression program
JP3461309B2 (en) Huffman coded data compression device
US7684629B2 (en) Data compression apparatus, and data compression program storage medium
JP3872217B2 (en) Dither image binary expression processing method, dither image compression binary expression decompression method, and dither image compression and decompression system
JP2008311792A (en) Device for encoding image and control method therefor
JP4633576B2 (en) Data compression apparatus and data compression program
JP4173498B2 (en) Data compression apparatus and data compression program
JP2005252531A (en) Device and program for compressing data
JP2005277932A (en) Device and program for compressing data
JP4435586B2 (en) Data compression apparatus and data compression program
JP4377351B2 (en) Data compression apparatus and data compression program
JP2007174464A (en) Data compression apparatus and program
JP2005260408A (en) Data compression apparatus and data compression program
JP4131969B2 (en) Data compression apparatus and data compression program
JP2005260420A (en) Data compression apparatus and data compression program
JP4181147B2 (en) Data compression apparatus and data compression program
JP4629512B2 (en) Data compression apparatus and data compression program
JP4131970B2 (en) Data compression apparatus and data compression program
JP4699307B2 (en) Data compression apparatus and data compression program
JP4377352B2 (en) Data compression apparatus and data compression program
JP2006060490A (en) Image compressor and image compression program
JP4579793B2 (en) Data compression apparatus and data compression program

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20070605