JP4435586B2 - Data compression apparatus and data compression program - Google Patents

Data compression apparatus and data compression program Download PDF

Info

Publication number
JP4435586B2
JP4435586B2 JP2004016430A JP2004016430A JP4435586B2 JP 4435586 B2 JP4435586 B2 JP 4435586B2 JP 2004016430 A JP2004016430 A JP 2004016430A JP 2004016430 A JP2004016430 A JP 2004016430A JP 4435586 B2 JP4435586 B2 JP 4435586B2
Authority
JP
Japan
Prior art keywords
data
data compression
unit
numerical values
compressed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP2004016430A
Other languages
Japanese (ja)
Other versions
JP2005210539A (en
Inventor
由紀夫 杉田
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 Corp
Original Assignee
Fujifilm Corp
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 Fujifilm Corp filed Critical Fujifilm Corp
Priority to JP2004016430A priority Critical patent/JP4435586B2/en
Priority to US11/042,535 priority patent/US7684629B2/en
Publication of JP2005210539A publication Critical patent/JP2005210539A/en
Application granted granted Critical
Publication of JP4435586B2 publication Critical patent/JP4435586B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime 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)

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.

本発明は、上記事情に鑑み、圧縮率を向上させたデータ圧縮処理を行なうことのできるデータ圧縮装置、およびコンピュータ等の情報処理装置を、圧縮率を向上させたデータ圧縮処理を行なうデータ圧縮装置として動作させることのできるデータ圧縮プログラムを提供することを目的とする。   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つもしくは複数の圧縮対象数値の存在及び同一の圧縮対象数値の連続数を検出する数値検出部と、
被圧縮データ中、圧縮対象数値を除く数値についてはそのまま出力すると共に、圧縮対象数値については、その圧縮対象数値と、その圧縮対象数値と同一の圧縮対象数値の連続数を表わす数値とに符号化して出力する符号化部とを備えたことを特徴とする。
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 number of unit bits.
A numerical value detection unit for detecting the presence of one or more numerical values to be compressed from the data to be compressed and the continuous number of the same numerical values to be compressed;
In the data to be compressed, numerical values other than the numerical value to be compressed are output as they are, and the numerical value to be compressed is encoded into the numerical value to be compressed and the numerical value representing the continuous number of the numerical values to be compressed that is the same as the numerical value to be compressed. And an encoding unit for outputting the output.

ここで、上記本発明のデータ圧縮装置によって、上記符号化部は、同一の圧縮対象数値の連続数に応じ、その連続数を異なるビット数で表現する符号化を行なうものであることが好ましい。その一例として、上記符号化部は、同一の圧縮対象数値の連続数が所定数以下のときはその連続数を1単位ビット数で表現し、その連続数が所定数を越えるときは2単位ビット数で表現する符号化を行なうものであってもよい。   Here, according to the data compression apparatus of the present invention, it is preferable that the encoding 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. As an example, the encoding unit expresses the continuous number by one unit bit number when the number of consecutive identical numerical values to be compressed is a predetermined number or less, and 2 unit bits when the continuous number exceeds the predetermined number. You may perform the encoding expressed by a number.

また、上記本発明のデータ圧縮装置において、上記数値検出部と上記符号化部とからなる第1のデータ圧縮部の前段に、被圧縮データを構成する数値の連続について隣接する数値どうしの差分を求めることによりその差分を表わす数値の連続からなるデータを生成して第1のデータ圧縮部に渡す第2のデータ圧縮部を備えることが好ましい。この場合に、この第2のデータ圧縮部は、被圧縮データを構成する数値の連続を順次区切ったときの各区切りごとの先頭の数値についてはそのまま出力するとともに、先頭の数値以外については隣接する数値どうしの差分のうちの下位の単位ビット数で表わされる数値を出力するものであることがさらに好ましい。   Further, in the data compression apparatus of the present invention, a difference between adjacent numerical values for a series of numerical values constituting the data to be compressed is provided in a preceding stage of the first data compression unit including the numerical value detection unit and the encoding unit. It is preferable to provide a second data compression unit that generates data consisting of a series of numerical values representing the difference by obtaining and passes the data to the first data compression unit. In this case, the second 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.

また、上記本発明のデータ圧縮装置において、上記第1のデータ圧縮部の後段に、その第1のデータ圧縮部で符号化された後のデータにエントロピー符号化を施す第3のデータ圧縮部を備えることも好ましい形態である。   In the data compression apparatus of the present invention, a third data compression unit that performs entropy coding on the data that has been encoded by the first data compression unit is provided after the first data compression unit. It is also a preferable form to provide.

また、上記目的を達成する本発明のデータ圧縮プログラムは、プログラムを実行する情報処理装置内で実行され、その情報処理装置を、所定の単位ビット数で表わされる数値の連続からなる被圧縮データにデータ圧縮処理を施すデータ圧縮装置として動作させるデータ圧縮プログラムであって、
上記情報処理装置を、
被圧縮データの中から1つもしくは複数の圧縮対象数値の存在及び同一の圧縮対象数値の連続数を検出する数値検出部と、
被圧縮データ中、圧縮対象数値を除く数値についてはそのまま出力すると共に、圧縮対象数値については、その圧縮対象数値と、その圧縮対象数値と同一の圧縮対象数値の連続数を表わす数値とに符号化して出力する符号化部とを備えたデータ圧縮装置として動作させることを特徴とする。
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
A numerical value detection unit for detecting the presence of one or more numerical values to be compressed from the data to be compressed and the continuous number of the same numerical values to be compressed;
In the data to be compressed, numerical values other than the numerical value to be compressed are output as they are, and the numerical value to be compressed is encoded into the numerical value to be compressed and the numerical value representing the continuous number of the numerical values to be compressed that is the same as the numerical value to be compressed And an encoding unit that outputs the data as a data compression device.

ここで、上記本発明のデータ圧縮プログラムにおいて、上記符号化部は、同一の圧縮対象数値の連続数に応じ、その連続数を異なるビット数で表現する符号化を行なうものであることが好ましく、その一例として、上記符号化部は、同一の圧縮対象数値の連続数が所定数以下のときはその連続数を1単位ビット数で表現し、その連続数が所定数を越えるときは2単位ビット数で表現する符号化を行なうものであってもよい。   Here, in the data compression program of the present invention, the encoding unit preferably 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 encoding unit expresses the continuous number by one unit bit number when the number of consecutive identical numerical values to be compressed is a predetermined number or less, and 2 unit bits when the continuous number exceeds the predetermined number. You may perform the encoding expressed by a number.

また、上記本発明のデータ圧縮プログラムは、上記情報処理装置を、さらに、上記数値検出部と上記符号化部とからなる第1のデータ圧縮部の前段に、被圧縮データについて隣接する数値どうしの差分を求めることによりその差分を表わす数値の連続からなるデータを生成して第1のデータ圧縮部に渡す第2のデータ圧縮部を備えたデータ圧縮装置として動作させるものであることが好ましい。この場合に、この第2のデータ圧縮部は、被圧縮データを構成する数値の連続を順次区切ったときの各区切りごとの先頭の数値についてはそのまま出力するとともに、先頭の数値以外については隣接する数値どうしの差分のうちの下位の単位ビット数で表わされる数値を出力するものであることがさらに好ましい。   Further, the data compression program of the present invention provides the information processing apparatus further including the numerical values adjacent to the data to be compressed before the first data compression unit including the numerical value detection unit and the encoding unit. It is preferable to operate as a data compression apparatus including a second data compression unit that obtains a difference and generates data composed of a series of numerical values representing the difference and passes the data to the first data compression unit. In this case, the second 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.

また、上記本発明のデータ圧縮プログラムは、上記情報処理装置を、さらに、上記第1のデータ圧縮部の後段に、その第1のデータ圧縮部で符号化された後のデータにエントロピー符号化を施す第3のデータ圧縮部を備えたデータ圧縮装置として動作させるものであることが好ましい。   Further, the data compression program of the present invention performs entropy coding on the data after encoded by the first data compression unit and further after the information processing apparatus, by the first data compression unit. It is preferable to operate as a data compression device including a third data compression unit to be applied.

上記本発明のデータ圧縮装置ないしデータ圧縮プログラムによれば、圧縮対象数値のみが、その圧縮対象数値と連続数とを表わす数値とに符号化されるため、図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.

ここで、上記符号化部を、同一の圧縮対象数値の連続数に応じ、その連続数を異なるビット数で表現する符号化を行なう構成、例えば、同一の圧縮対象数値の連続数が所定数以下のときはその連続数を1単位ビット数で表現し、その連続数が所定数を越えるときは2単位ビット数で表現する符号化を行なう構成とすると、同一の圧縮対象数値の連続数が大きな数であるときに高圧縮率で圧縮され、圧縮率が更に向上する。   Here, the encoding unit is configured to perform 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, for example, the continuous number of the same numerical value to be compressed is a predetermined number or less. In this case, if the encoding is performed such that the number of consecutive bits is expressed by one unit bit number, and if the number of consecutive bits exceeds a predetermined number, it is expressed by two unit bit numbers. When it is a number, it is compressed at a high compression rate, and the compression rate is further improved.

さらに、上記第2のデータ圧縮部を備えると、同一の数値が続く場合はその差分は数値ゼロとなり、数値ゼロの出現確率が増加し、上記第1のデータ圧縮部との組合せにより圧縮率を更に向上させることができる。   Further, when the second 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 compression rate is increased by the combination with the first data compression unit. Further improvement can be achieved.

ここで、数値の差分を求めると、例えばその数値が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.

そこで、上記第2のデータ圧縮部を、被圧縮データを構成する数値の連続を順次で区切ったときの各区切りごとの先頭の数値についてはそのまま出力するとともに、先頭の数値以外については隣接する数値どうしの差分のうちの下位の単位ビット数で表わされる数値を出力する構成とすることにより、差分により1つの差分値について1ビット増加するのを防ぐことができ、更なる圧縮率向上に役立つ。   Therefore, the second 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.

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

以下、本発明の実施形態について説明する。   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と、ランレングス符号化部530と、データスキャニング部540と、ハフマン符号化部550とを備えている。各部510〜550の詳細は後述するが、このデータ圧縮装置500内での画像データの流れは以下のとおりである。   4 includes a differential encoding unit 510, a specific numerical value detection unit 520, a run length encoding unit 530, a data scanning unit 540, and a Huffman encoding unit 550. Although details of the respective units 510 to 550 will be described later, the flow of image data in the data compression apparatus 500 is as follows.

入力画像ファイル(本実施形態では、図2に示すように、ビットマップに展開されたLWデータ13Aが格納されたファイル)は、図4に示すデータ圧縮装置500の、差分符号化部510に入力されて、差分符号化処理、すなわち、入力されてきたデータを構成する数値の連続について隣接する数値どうしの差分を求めることによりその差分を表わす数値の連続からなる画像データを生成する処理が行なわれる。この差分符号化部510は、本発明にいう第2のデータ圧縮部の一例に相当する。さらに具体的には、この差分符号化部510では、入力されてきたデータを構成する数値の連続を順次区切ったときの各区切りごとの先頭の数値についてはそのまま出力するとともに、先頭の数値以外については隣接する数値どうしの差分のうちの下位の単位ビット数で表わされる数値を出力する処理が行なわれる。   An input image file (in this embodiment, a file storing LW data 13A expanded into a bitmap as shown in FIG. 2) is input to the differential encoding unit 510 of the data compression apparatus 500 shown in FIG. Then, a differential encoding process, that is, a process of generating image data composed 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 input data. . The differential encoding unit 510 corresponds to an example of a second data compression unit referred to in the present invention. More specifically, the differential encoding unit 510 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.

差分符号化部510において差分符号化されたデータは、特定数値検出部520とランレングス符号化部530との双方に入力される。特定数値検出部520では、入力されてきたデータの中から1つもしくは複数の圧縮対象数値の存在及び同一の圧縮対象数値の連続数が検出される。ランレングス符号化部530では、特定数値検出部520における検出結果を受けて、差分符号化部510から入力されてきたデータ中、圧縮対象数値を除く数値についてはそのまま出力すると共に、圧縮対象数値については、その圧縮対象数値と、その圧縮対象数値と同一の圧縮対象数値の連続数を表わす数値とに符号化して出力するという符号化処理が行なわれる。このランレングス符号化部530では、その符号化処理にあたっては、同一の圧縮対象数値の連続数に応じ、その連続数を異なるビット数で表現する符号化が行なわれる。ここでは、具体的には、同一の圧縮対象数値の連続数が所定数以下のときはその連続数を1単位ビット数で表現し、その連続数が所定数を越えるときは2単位ビット数で表現する符号化が行なわれる。本実施形態では、これら特定数値検出部520とランレングス符号化部530とを合わせたものが、本発明にいう第1のデータ圧縮部に相当し、本発明の根幹をなす部分である。   The data differentially encoded by the differential encoding unit 510 is input to both the specific numerical value detection unit 520 and the run length encoding unit 530. The specific numerical value detection unit 520 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 530 receives the detection result from the specific numerical value detection unit 520 and outputs the numerical values excluding the numerical values to be compressed in the data input from the differential encoding unit 510 as well as the numerical values to be compressed. Is subjected to an encoding process in which the numerical value to be compressed and the numerical value representing the continuous number of the numerical values to be compressed that are the same as the numerical value to be compressed are encoded and output. In the run-length encoding unit 530, in the encoding process, encoding is performed to express the continuous number with 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 520 and the run length encoding unit 530 corresponds to the first data compression unit referred to in the present invention, and is a part that forms the basis of the present invention.

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

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

ハフマン符号化部550でハフマン符号化された後のデータは、データスキャニング部540で求められたデータヒストグラムに従って設定された、ハフマン符号化部550への入力データの数値とハフマン符号化後の値との割当表が添付されて、図2に示すLW可逆圧縮データ15として、図1に示すSCSI等の汎用インタフェース150を経由してインタフェース機器200に転送される。インタフェース機器200では、その受け取ったLW可逆圧縮データ15にデータ伸長処理が施されるが、このデータ伸長処理にあたっては、先ず、図4のハフマン符号化部550で行なわれた符号化処理に対する復号化処理が施され、次いで、図4のランレングス符号化部530で行なわれた符号化処理に対する復号化処理が施され、さらに、図4の差分符号化部510で行われた符号化処理に対する復号化処理が施されて、元の入力画像ファイル中の画像データと同一の画像データが復元される。   The data after the Huffman coding by the Huffman coding unit 550 is set according to the data input to the Huffman coding unit 550 and the value after the Huffman coding set according to the data histogram obtained by the data scanning unit 540. Is attached to the interface device 200 via the general-purpose interface 150 such as SCSI shown in FIG. 1 as the LW lossless compressed data 15 shown in FIG. 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 550 of FIG. Next, a decoding process for the encoding process performed by the run-length encoding unit 530 in FIG. 4 is performed, and a decoding process for the encoding process performed by the differential encoding unit 510 in FIG. 4 is performed. The image data identical to the image data in the original input image file is restored.

図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は、CD−ROM140に記憶されている。   Here, the data compression program 600 is stored in the CD-ROM 140.

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

この図6に示すCD−ROM140が、図5に示すホストコントローラ100に装填されCDROMドライブ116でアクセスされてそのCD−ROM140に記憶されているプログラムがこのホストコントローラ100にアップロードされ、ハードディスク104に記憶される。このハードディスク104に記憶されたプログラムがそのハードディスク104から読み出されてRAM112に展開されCPU111で実行されると、このホストコントローラ100は、図4に示すデータを圧縮装置500としての処理を含む、図2に示すホストコントローラとしての各種処理を実行する装置として動作する。   The CD-ROM 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 CD-ROM 140 is uploaded to the host controller 100 and stored in the hard disk 104. Is done. 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、ランレングス符号化部630、データスキャニング部640、およびハフマン符号化部650は、CPU111で実行されることにより、そのホストコントローラ100を、それぞれ、図4に示すデータ圧縮装置500を構成する、差分符号化部510、特定数値検出部520、ランレングス符号化部530、データスキャニング部540、およびハフマン符号化部550として動作させるプログラム部品である。図6のデータ圧縮プログラム600を構成する各部610〜650の、CPU111で実行されたときの作用は、それぞれ、図5のデータ圧縮装置500を構成する各部510〜550の作用そのものである。したがって、図4のデータ圧縮装置500の各部510〜550に関する、これまでの説明、および、以下に説明する詳細説明をもって、図6のデータ圧縮プログラム600を構成する各部610〜650の説明を兼ねるものとする。   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. The encoding unit 610, the specific numerical value detection unit 620, the run length encoding unit 630, the data scanning unit 640, and the Huffman encoding unit 650 are executed by the CPU 111, so that the host controller 100 is shown in FIG. These are program parts that operate as a differential encoding unit 510, a specific numerical value detection unit 520, a run length encoding unit 530, a data scanning unit 540, and a Huffman encoding unit 550 that constitute the data compression apparatus 500 shown. The operations of the units 610 to 650 constituting the data compression program 600 of FIG. 6 when executed by the CPU 111 are the operations themselves of the units 510 to 550 constituting the data compression apparatus 500 of FIG. Accordingly, the above description and the detailed description of the units 510 to 550 of the data compression apparatus 500 of FIG. 4 also serve as the description of the units 610 to 650 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を構成する差分符号化部510では、上記のような画像データを入力し、副走査方向に隣接する画素どうしの差分が求められる。すなわち、N番目のラインと(N+1)番目のラインとの差分であって、主走査方向に並ぶj番目の画素の差分をSn,jとすると、この差分Sn,jは、
n,j=Dn+1,j−Dn,j (j=1〜m)
と表現される。
Here, in the differential encoding unit 510 constituting the data compression apparatus 500 shown in FIG. 4, the above-described image data is input, and a difference between pixels adjacent in the sub-scanning direction is obtained. 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を構成する差分符号化部510における差分符号化処理を例示して示す図である。   FIG. 8 is a diagram illustrating a differential encoding process in the differential encoding unit 510 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-scan direction may be segmented into a plurality of rows, and a plurality of columns in the sub-scan 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の差分符号化部510では、MSBの1ビット(符号ビット)は省略するため、その差分符号化部510から出力されるデータは、図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 510 of FIG. 4 described with reference to FIG. 8, 1 bit (code bit) of the MSB is omitted, so that the data output from the differential encoding unit 510 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.

図4に示す差分符号化部510で上記の差分符号化処理が行なわれた後のデータは、今度は、図4に示す特定数値検出部520とランレングス符号化部530の双方に入力される。   The data after the above-described differential encoding process is performed by the differential encoding unit 510 shown in FIG. 4 is input to both the specific numerical value detection unit 520 and the run length encoding unit 530 shown in FIG. .

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

本実施形態における、図4の特定数値検出部520では、一例として、「01」、「FF」および「00」の3つの数値を圧縮対象数値としている。   In the specific numerical value detection unit 520 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のランレングス符号化部530の前段に差分符号化部510が置かれている。そこで、上記の出現頻度の高い3つの数値「00」、「FF」、「01」の間の差分を求めると、符号ビットを除き、
FF−00=FF
00−FF=01
01−00=01
−01=FF
FF−01=FE
−FF=02
となるが、これら6つの差分値のうちの、「FF」と「01」は既に上の理由により圧縮対象数値として挙げられており、残りの、「FE」と「02」を圧縮対象数値として加えて、「01」、「FF」、「00」、「FE」、および「02」の5つを圧縮対象数値としてもよい。
In the embodiment shown in FIG. 4, a differential encoding unit 510 is placed before the run length encoding unit 530 in 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
0 0 -01 = FF
FF-01 = FE
0 1 −FF = 02
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.

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

ここでは、図10の上のラインに示すように、差分符号化部510からは、
「06 02 02 02 01 01 01 01 04 05 00 … 」
なるデータが入力されたものとする。このとき、図4の特定数値検出部520では、先頭の「06」は圧縮対象数値ではなく、次に続く「02 02 02」も圧縮対象数値ではなく、次に、圧縮対象数値である「01」が4つ連続していること、次に、圧縮対象数値ではない「04」、「05」を間に置いて、圧縮対象数値である「00」が32767個連続していることが検出され、その情報が図4のランレングス符号化部530に伝達される。
Here, as shown in the upper line of FIG. 10, from the differential encoding unit 510,
"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 520 of FIG. 4, the leading “06” is not a compression target numerical value, and the following “02 02 02” is not a compression target numerical value. ”Is consecutive, and next, it is detected that there are 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 530 of FIG.

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

この図11中、Zは同一の圧縮対象数値の連続数、例えば図10の上のラインの「01」についてはZ=4、「00」についてはZ=32767である。   In FIG. 11, 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. 10, and Z = 32767 for “00”.

また、図11中、「YY」は、16進2桁で表わされた圧縮対象数値自体を表わしている。その「YY」に続く、「0」又は「1」は1ビットで表現された「0」又は「1」であり、さらにそれに続く「XX…」は、1つの「X」が1ビットを表わしており、この「XX…」でZの値を表現している。   In FIG. 11, “YY” represents the compression target numerical value 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.

すなわち、図11は、圧縮対象数値「YY」がZ<128連続するときは、1バイト目で圧縮対象数値「YY」を表現し、それに続く1バイトで、先頭ビットが「0」、それに続く7ビットでZの値を表現すること、また、圧縮対象数値「YY」がZ≧128連続するときは、1バイト目で圧縮対象数値「YY」を表現し、それに続く2バイト(16ビット)のうちの先頭の1ビットを「1」とすることで2バイトに跨って表現されていることを表現し、それに続く15ビットで、Zの値を表現することを意味している。   That is, FIG. 11 shows that 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.

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

図4の差分符号化部510から入力されてきたデータ(上のライン)を構成する先頭の数値「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 510 in FIG. 4 is not a compression target numerical value, it is output as “06”. Also, “02 02 02” that follows, “02” is not a compression target numerical value, 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”.

図12は、図4のランレングス符号化部530における、連続数に応じた符号化処理の例を示す図である。
・「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. 12 is a diagram illustrating an example of an encoding process according to the number of consecutive steps in the run-length encoding unit 530 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に示すランレングス符号化部530では、上記のような符号化処理が行なわれる。   The run-length encoding unit 530 shown in FIG. 4 performs the encoding process as described above.

この場合、圧縮対象数値以外の数値についてはそのまま出力されるため、図3を参照して説明したPackBits符号化のような、かえって冗長になってしまうという事態が回避される。また、図3のPackBits符号化の場合は、最大圧縮率は1/64であるが、本実施形態によるランレングス符号化部530によれば、最大圧縮率は、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 530 according to the present embodiment, the maximum compression rate is 3/32895 = 1/10, It improves to 965.

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

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

ここでは、「A1」の出現頻度が最も強く、以下順に、「A2」、「A3」、「A4」、…の順であるとする。尚、これら「A1」、「A2」等は数値を直接表わしている訳ではなく、数値を表わす符号である。すなわち、「A1」は例えば数値「00」、「A2」は数値「FF」等である。また、ここでは、簡単のため、図4のランレングス符号化部530から送られてくるデータは全ての画素が「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. Also, here, for the sake of simplicity, the data sent from the run-length encoding unit 530 in FIG. 4 is expressed by any one of the 16 numerical values “A1” to “A16” for all pixels. Shall be.

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

ここでは、出現頻度の最も高い「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.

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

最初に画像データファイルの先頭であることを表わすSOI(Start Of Image)であることを表わすの符号が配置され、次いで画像のサイズ等の情報が記録されたヘッダが続き、さらにその後に、図4のハフマン符号化部550での符号化に用いたハフマンテーブルが配置される。   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 Huffman table used for encoding by the Huffman encoder 550 is arranged.

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

このハフマンテーブルは、図13と一致させてあり、出現頻度が高いほど短かいビット数で表わされた数値に置き換えられるように並べた、符号化前(置き換え前)の数値と符号化後(置き換え後)の数値との対応テーブルである。   This Huffman table is consistent with FIG. 13 and is arranged so that it is replaced with a numerical value represented by a shorter number of bits as the appearance frequency is higher, and the numerical value 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.

図14に示すように、ハフマンテーブルの後には、ハフマン符号化後の実際の画像データが続き、最後にEOI(End Of Image)の符号で締め括られる。   As shown in FIG. 14, the Huffman table is followed by the actual image data after Huffman coding, and is finally concluded with a code of EOI (End Of Image).

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

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

また、上述の実施形態は、本発明を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のデータ圧縮装置を構成する差分符号化部における差分符号化処理を例示して示す図である。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. 図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. 図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. ハフマンテーブルの一例を示す図である。It is a figure which shows an example of a Huffman table.

符号の説明Explanation of symbols

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

Claims (10)

所定の単位ビット数で表わされる数値の連続からなるラインが複数本並んでなる被圧縮データにデータ圧縮処理を施すデータ圧縮装置において、
複数の圧縮対象数値の存在及び同一の圧縮対象数値の連続数を検出する数値検出部と、被圧縮データ中、圧縮対象数値を除く数値についてはそのまま出力すると共に、圧縮対象数値については、該圧縮対象数値と、該圧縮対象数値と同一の圧縮対象数値の連続数を表わす数値とに符号化して出力する符号化部とからなる第1のデータ圧縮部と、
前記第1のデータ圧縮部の前段に設けられ、被圧縮データを構成する複数本のラインのうちの最初のラインと、被圧縮データを構成する複数本のラインのうち互いに隣接するライン間で互いに隣接する数値どうしの差分値の連続からなる新たなラインとからなるデータを生成して前記第1のデータ圧縮部に渡す第2のデータ圧縮部とを備え
前記第1のデータ圧縮部が、前記複数の圧縮対象数値として、差分ゼロ前後の各差分を表す予め決められた複数の数値を用いるものであることを特徴とするデータ圧縮装置。
In a data compression apparatus that performs data compression processing on compressed data in which a plurality of lines composed of a series of numerical values represented by a predetermined number of unit bits are arranged,
A numerical value detection unit that detects the presence of multiple numerical values to be compressed and a continuous number of the same numerical values to be compressed, and outputs the numerical values excluding the numerical values to be compressed in the compressed data as they are. A first data compression unit comprising a target numerical value and an encoding unit that encodes and outputs a numerical value that represents the number of consecutive compression target numerical values that is the same as the compression target numerical value;
Provided before the first data compression unit, between the first line of the plurality of lines constituting the compressed data and the lines adjacent to each other among the plurality of lines constituting the compressed data. A second data compression unit that generates data including a new line consisting of a series of difference values between adjacent numerical values and passes the data to the first data compression unit ,
The data compression apparatus, wherein the first data compression unit uses a plurality of predetermined numerical values representing differences before and after the difference zero as the plurality of compression target numerical values .
前記符号化部は、同一の圧縮対象数値の連続数に応じ、該連続数を異なるビット数で表現する符号化を行なうものであることを特徴とする請求項1記載のデータ圧縮装置。   2. The data compression apparatus according to claim 1, wherein the encoding 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単位ビット数で表現し、該連続数が該所定数を越えるときは2単位ビット数で表現する符号化を行なうものであることを特徴とする請求項2記載のデータ圧縮装置。   The encoding unit expresses the continuous number by a 1-unit bit number when the number of consecutive identical numerical values to be compressed is a predetermined number or less, and expresses the unit number by 2 unit bits when the continuous number exceeds the predetermined number. 3. The data compression apparatus according to claim 2, wherein the data compression apparatus performs encoding. 前記第2のデータ圧縮部は、被圧縮データを構成する数値の連続を順次区切ったときの各区切りごとの先頭の数値についてはそのまま出力するとともに、該先頭の数値以外については隣接する数値どうしの差分のうちの下位の単位ビット数で表わされる数値を出力するものであることを特徴とする請求項1記載のデータ圧縮装置。   The second data compression unit outputs the first numerical value for each delimiter when the sequence of numerical values constituting the compressed data is sequentially delimited, as well as the adjacent numerical values other than the first numerical value. 2. The data compression apparatus according to claim 1, wherein a numerical value represented by a lower unit bit number of the difference is output. 前記第1のデータ圧縮部の後段に、前記第1のデータ圧縮部で符号化された後のデータにエントロピー符号化を施す第3のデータ圧縮部を備えたことを特徴とする請求項1記載のデータ圧縮装置。   2. The third data compression unit that performs entropy coding on data after being encoded by the first data compression unit, subsequent to the first data compression unit. Data compression device. プログラムを実行する情報処理装置内で実行され、該情報処理装置を、所定の単位ビット数で表わされる数値の連続からなるラインが複数本並んでなる被圧縮データにデータ圧縮処理を施すデータ圧縮装置として動作させるデータ圧縮プログラムであって、
前記情報処理装置を、
複数の圧縮対象数値の存在及び同一の圧縮対象数値の連続数を検出する数値検出部と、被圧縮データ中、圧縮対象数値を除く数値についてはそのまま出力すると共に、圧縮対象数値については、該圧縮対象数値と、該圧縮対象数値と同一の圧縮対象数値の連続数を表わす数値とに符号化して出力する符号化部とからなる第1のデータ圧縮部と、
前記第1のデータ圧縮部の前段に設けられ、被圧縮データを構成する複数本のラインのうちの最初のラインと、被圧縮データを構成する複数本のラインのうち互いに隣接するライン間で互いに隣接する数値どうしの差分値の連続からなる新たなラインとからなるデータを生成して前記第1のデータ圧縮部に渡す第2のデータ圧縮部とを備え
前記第1のデータ圧縮部が、前記複数の圧縮対象数値として、差分ゼロ前後の各差分を表す予め決められた複数の数値を用いるものであるデータ圧縮装置として動作させることを特徴とするデータ圧縮プログラム。
A data compression apparatus that is executed in an information processing apparatus that executes a program and that performs data compression processing on data to be compressed in which a plurality of lines composed of a series of numerical values represented by a predetermined number of unit bits are arranged A data compression program that operates as
The information processing apparatus;
A numerical value detection unit that detects the presence of multiple numerical values to be compressed and a continuous number of the same numerical values to be compressed, and outputs the numerical values excluding the numerical values to be compressed in the compressed data as they are. A first data compression unit comprising a target numerical value and an encoding unit that encodes and outputs a numerical value that represents the number of consecutive compression target numerical values that is the same as the compression target numerical value;
Provided before the first data compression unit, between the first line of the plurality of lines constituting the compressed data and the lines adjacent to each other among the plurality of lines constituting the compressed data. A second data compression unit that generates data including a new line consisting of a series of difference values between adjacent numerical values and passes the data to the first data compression unit ,
The first data compression unit is operated as a data compression device that uses a plurality of predetermined numerical values representing respective differences before and after the difference zero as the plurality of compression target numerical values. program.
前記符号化部は、同一の圧縮対象数値の連続数に応じ、該連続数を異なるビット数で表現する符号化を行なうものであることを特徴とする請求項6記載のデータ圧縮プログラム。   7. The data compression program according to claim 6, wherein the encoding 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単位ビット数で表現し、該連続数が該所定数を越えるときは2単位ビット数で表現する符号化を行なうものであることを特徴とする請求項7記載のデータ圧縮プログラム。   The encoding unit expresses the continuous number by one unit bit number when the number of consecutive consecutive compression target numerical values is less than a predetermined number, and expresses by two unit bit numbers when the continuous number exceeds the predetermined number 8. The data compression program according to claim 7, wherein the data compression program performs encoding. 前記第2のデータ圧縮部は、被圧縮データを構成する数値の連続を順次区切ったときの各区切りごとの先頭の数値についてはそのまま出力するとともに、該先頭の数値以外については隣接する数値どうしの差分のうちの下位の単位ビット数で表わされる数値を出力するものであることを特徴とする請求項6記載のデータ圧縮プログラム。   The second data compression unit outputs the first numerical value for each delimiter when the sequence of numerical values constituting the compressed data is sequentially delimited, as well as the adjacent numerical values other than the first numerical value. 7. The data compression program according to claim 6, wherein a numerical value represented by a lower unit bit number of the difference is output. 前記情報処理装置を、さらに、前記第1のデータ圧縮部の後段に、前記第1のデータ圧縮部で符号化された後のデータにエントロピー符号化を施す第3のデータ圧縮部を備えたデータ圧縮装置として動作させることを特徴とする請求項6記載のデータ圧縮プログラム。   The information processing device further includes a third data compression unit that performs entropy coding on the data that has been encoded by the first data compression unit at a stage subsequent to the first data compression unit. The data compression program according to claim 6, wherein the data compression program is operated as a compression device.
JP2004016430A 2004-01-26 2004-01-26 Data compression apparatus and data compression program Expired - Lifetime JP4435586B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2004016430A JP4435586B2 (en) 2004-01-26 2004-01-26 Data compression apparatus and data compression program
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
JP2004016430A JP4435586B2 (en) 2004-01-26 2004-01-26 Data compression apparatus and data compression program

Publications (2)

Publication Number Publication Date
JP2005210539A JP2005210539A (en) 2005-08-04
JP4435586B2 true JP4435586B2 (en) 2010-03-17

Family

ID=34901581

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004016430A Expired - Lifetime JP4435586B2 (en) 2004-01-26 2004-01-26 Data compression apparatus and data compression program

Country Status (1)

Country Link
JP (1) JP4435586B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4689545B2 (en) * 2006-07-05 2011-05-25 富士フイルム株式会社 Data compression apparatus and data compression program
JP4699307B2 (en) * 2006-07-27 2011-06-08 富士フイルム株式会社 Data compression apparatus and data compression program

Also Published As

Publication number Publication date
JP2005210539A (en) 2005-08-04

Similar Documents

Publication Publication Date Title
JP4689545B2 (en) Data compression apparatus and data compression program
US7826670B2 (en) Data compression apparatus and data compression program storage medium
JP2006121645A (en) Image compression apparatus and image compression program
US20060176196A1 (en) Data compression apparatus, and data compression program storage medium
WO2004068844A1 (en) Image compression method, image restoration method, program, and apparatus
JP3461309B2 (en) Huffman coded data compression device
JP3278298B2 (en) Bitmap data compression method and compression apparatus
US7684629B2 (en) Data compression apparatus, and data compression program storage medium
JP2008311792A (en) Device for encoding image and control method therefor
JP4633576B2 (en) Data compression apparatus and data compression program
JP4173505B2 (en) Data compression apparatus and data compression program
JP4173498B2 (en) Data compression apparatus and data compression program
JP4435586B2 (en) Data compression apparatus and data compression program
JP2005277932A (en) Device and program for compressing data
JP2005252531A (en) Device and program for compressing data
JP4377351B2 (en) Data compression apparatus and data compression program
JP2005260408A (en) Data compression apparatus and data compression program
JP4131969B2 (en) Data compression apparatus and data compression program
JP4629512B2 (en) Data compression apparatus and data compression program
JP4181147B2 (en) Data compression apparatus and data compression program
JP4131970B2 (en) Data compression apparatus and data compression program
JP2005260420A (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

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060420

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20061212

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080117

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080122

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080311

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20080408

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080529

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20080616

A912 Re-examination (zenchi) completed and case transferred to appeal board

Free format text: JAPANESE INTERMEDIATE CODE: A912

Effective date: 20080627

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20091224

R150 Certificate of patent or registration of utility model

Ref document number: 4435586

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20130108

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20130108

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20140108

Year of fee payment: 4

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250