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

Data compression apparatus and data compression program Download PDF

Info

Publication number
JP4377352B2
JP4377352B2 JP2005098256A JP2005098256A JP4377352B2 JP 4377352 B2 JP4377352 B2 JP 4377352B2 JP 2005098256 A JP2005098256 A JP 2005098256A JP 2005098256 A JP2005098256 A JP 2005098256A JP 4377352 B2 JP4377352 B2 JP 4377352B2
Authority
JP
Japan
Prior art keywords
data
compression
unit
numerical values
numerical value
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.)
Active
Application number
JP2005098256A
Other languages
Japanese (ja)
Other versions
JP2006279734A (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 JP2005098256A priority Critical patent/JP4377352B2/en
Publication of JP2006279734A publication Critical patent/JP2006279734A/en
Application granted granted Critical
Publication of JP4377352B2 publication Critical patent/JP4377352B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Compression Or Coding Systems Of Tv Signals (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 a 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 the state before the data compression processing is performed by the host controller 100. 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, the CT data (bitmap data 12B) after data expansion and the 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 performs data compression, 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等の可逆圧縮方式が採用される。
特開平5−328142号公報 特開平10−164620号公報 特表2001−5−20822号公報 特開平9−200540号公報
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.
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

しかし、JPEG等の圧縮方式では、ソフトウェアでの圧縮処理に時間を要し、圧縮処理のシステム全体としての処理能力を劣化させる要因となっていた。   However, in a compression method such as JPEG, it takes time to perform compression processing by software, which causes a deterioration in the processing capability of the entire compression processing system.

また、JPEG等は非可逆な圧縮処理であるため画質の劣化を必然的に伴うが、近年、高画質化への要求がますます高まってきており、CTデータについても画質の劣化を招かないよう可逆圧縮を行うことが検討されてきている。   In addition, JPEG and the like are irreversible compression processes, and therefore there is a inevitably deterioration in image quality. However, in recent years, there has been an increasing demand for higher image quality, and CT data will not deteriorate. It has been studied to perform lossless compression.

本発明は上記事情に鑑み、CTデータも圧縮可能な新たな好ましい可逆圧縮処理を行うことができるデータ圧縮装置およびデータ圧縮プログラムを提供することを目的とする。   In view of the above circumstances, an object of the present invention is to provide a data compression apparatus and a data compression program capable of performing a new preferable lossless compression process capable of compressing CT data.

上記目的を達成する本発明のデータ圧縮装置は、
所定の単位ビット数で表わされる数値の連続からなる被圧縮データにデータ圧縮処理を施すデータ圧縮装置において、
被圧縮データを構成する数値の連続について隣接する数値どうしの差分を求めることによりその差分を表わす数値の連続からなる新たな被圧縮データを生成する差分生成部と、
上記差分生成部で生成された新たな被圧縮データに基づいて、その被圧縮データの種別を判定する種別判定部と、
上記種別判定部によって所定の第1種別のデータであると判定された被圧縮データに可逆圧縮処理を施す第1種別用圧縮処理部と、
上記種別判定部によって所定の第2種別のデータであると判定された被圧縮データに可逆圧縮処理を施す第2種別用圧縮処理部とを備え、
上記第1種別用圧縮処理部が、
被圧縮データを構成する各数値を所定値だけオフセットさせるオフセット部と、
上記オフセット部によって数値がオフセットされた被圧縮データの各数値を、上記単位ビット数よりも小さい所定の分割ビット数のところで上位ビット部分と下位ビット部分とに分けることによって、その被圧縮データを、各数値における上位ビット部分の連続からなる上位データと各数値の下位ビット部分の連続からなる下位データとに分割する分割部と、
上記分割部によって分割された上位データに対して可逆圧縮処理を施す上位データ圧縮部と、
上記分割部によって分割された下位データに対して可逆圧縮処理を施す下位データ圧縮部とを備えたものであり、
上記第2種別用圧縮処理部が、
上記第2種別のデータ中、1つもしくは複数の所定の圧縮対象数値を除く数値についてはそのまま出力するとともに、圧縮対象数値については、該圧縮対象数値と、該圧縮対象数値と同一の圧縮対象数値の連続数を表わす数値とに符号化して出力する符号化処理を含む可逆圧縮処理を施すものであることを特徴とする。
The data compression apparatus of the present invention that achieves the above object provides:
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,
A difference generating unit that generates new compressed 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 compressed data;
A type determination unit that determines the type of the compressed data based on the new compressed data generated by the difference generation unit;
A first type compression processing unit that performs a lossless compression process on the data to be compressed that has been determined to be predetermined first type data by the type determination unit;
A second type compression processing unit that performs a lossless compression process on the data to be compressed that has been determined by the type determination unit to be data of a predetermined second type,
The first type compression processor is
An offset unit for offsetting each numerical value constituting the compressed data by a predetermined value;
By dividing each numerical value of the compressed data whose numerical value is offset by the offset part into an upper bit part and a lower bit part at a predetermined divided bit number smaller than the unit bit number, the compressed data is A dividing unit that divides the upper data consisting of a continuation of the upper bit part in each numerical value and the lower data consisting of a continuation of the lower bit part of each numerical value;
An upper data compression unit that performs reversible compression processing on the upper data divided by the dividing unit;
A lower data compression unit that performs a lossless compression process on the lower data divided by the dividing unit,
The second type compression processor is
In the second type of data, 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 values and the same compression target numerical values as the compression target numerical values are output. And a reversible compression process including an encoding process of encoding and outputting a numerical value representing the continuous number of.

ここで、上記の『被圧縮データを構成する数値の連続について隣接する数値どうしの差分を求めることにより』における『隣接する』とは、データストリーム上で隣接してもよいが、必ずしもそれに限定されるものではない。例えば、2次元画像データが1次元ストリーム状のデータとして扱われている場合であれば、2次元的な画像上で見て隣接してもよい。以下においても同様である。   Here, “adjacent” in the above “by calculating the difference between adjacent numerical values for a series of numerical values constituting the compressed data” may be adjacent on the data stream, but is not necessarily limited thereto. It is not something. For example, if two-dimensional image data is handled as one-dimensional stream data, the two-dimensional images may be adjacent to each other when viewed on the two-dimensional image. The same applies to the following.

この本発明のデータ圧縮装置は、
上記種別判定部が、上記差分生成部で生成された新たな被圧縮データ中に出現する数値のヒストグラムを求め、そのヒストグラムに基づいて被圧縮データの種別を判定するものであることが好ましい。
This data compression apparatus of the present invention is
Preferably, the type determination unit obtains a histogram of numerical values appearing in the new compressed data generated by the difference generation unit, and determines the type of the compressed data based on the histogram.

また、本発明のデータ圧縮装置は、
上記被圧縮データが、連続階調画像およびラインワーク画像のうちの一方を表すデータであって、上記種別判定部は、連続階調画像を表す第1種別のデータであるかラインワーク画像を表す第2種別のデータであるかを判定するものであることも好ましい。
The data compression apparatus of the present invention
The compressed data is data representing one of a continuous tone image and a linework image, and the type determination unit represents the first type of data representing a continuous tone image or a linework image. It is also preferable to determine whether the data is of the second type.

また、本発明のデータ圧縮装置は、
上記上位データ圧縮部が、上位データ中、1つもしくは複数の所定の圧縮対象数値を除く数値についてはそのまま出力するとともに、圧縮対象数値については、その圧縮対象数値と、圧縮対象数値と同一の圧縮対象数値の連続数を表わす数値とに符号化して出力する第1の符号化部を備えたものであることが好ましい。
The data compression apparatus of the present invention
The upper data compression unit outputs the numerical values of the upper data excluding one or a plurality of predetermined compression target numerical values as they are, and for the compression target numerical values, the compression target numerical value and the same compression as the compression target numerical value It is preferable to include a first encoding unit that encodes and outputs a numerical value representing the number of consecutive target numerical values.

また、本発明のデータ圧縮装置は、
上記上位データ圧縮部が、
上位データ中、1つもしくは複数の所定の圧縮対象数値を除く数値についてはそのまま出力するとともに、圧縮対象数値については、その圧縮対象数値と、圧縮対象数値と同一の圧縮対象数値の連続数を表わす数値とに符号化して出力する第1の符号化部と、
符号と数値を対応づけるテーブルを用いて、第1の符号化部で符号化された後のデータにエントロピー符号化を施す第2の符号化部を備えたものであることが、より好ましい。
The data compression apparatus of the present invention
The upper data compression unit is
In the upper data, the numerical value excluding one or a plurality of predetermined compression target values is output as it is, and the compression target numerical value represents 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 encoding unit that encodes and outputs a numerical value;
It is more preferable to include a second encoding unit that performs entropy encoding on the data that has been encoded by the first encoding unit using a table that associates codes with numerical values.

ここで、本発明のデータ圧縮装置において、上記の上位データ圧縮部は、
上位データ中、1つもしくは複数の所定の圧縮対象数値を除く数値についてはそのまま出力するとともに、圧縮対象数値については、その圧縮対象数値と、圧縮対象数値と同一の圧縮対象数値の連続数を表わす数値とに符号化して出力する第1の符号化部と、
ハフマンテーブルを用いて、第1の符号化部で符号化された後のデータにハフマン符号化を施す第2の符号化部を備えたものであってもよい。
Here, in the data compression apparatus of the present invention, the upper data compression unit is
In the upper data, the numerical value excluding one or a plurality of predetermined compression target values is output as it is, and the compression target numerical value represents 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 encoding unit that encodes and outputs a numerical value;
You may provide the 2nd encoding part which performs Huffman encoding to the data after encoding by the 1st encoding part using a Huffman table.

さらに、本発明のデータ圧縮装置は、
上記上位データ圧縮部が、
上位データ中、1つもしくは複数の所定の圧縮対象数値を除く数値についてはそのまま出力するとともに、圧縮対象数値については、その圧縮対象数値と、圧縮対象数値と同一の圧縮対象数値の連続数を表わす数値とに符号化して出力する第1の符号化部と、
第1のデータ圧縮部で符号化された後のデータ中に出現する数値のヒストグラムを求めるヒストグラム算出部と、
ヒストグラム算出部で求められたヒストグラムに基づき、符号と数値を対応づけるテーブルに、出現頻度の高い数値ほど符号長の短かい符号を割り当てる符号割当部と、
符号割当部で符号が割り当てられたテーブルを用いて、第1の符号化部で符号化された後のデータにエントロピー符号化を施す第2の符号化部を備えたものであることが、より好ましい。
Furthermore, the data compression apparatus of the present invention is
The upper data compression unit is
In the upper data, the numerical value excluding one or a plurality of predetermined compression target values is output as it is, and the compression target numerical value represents 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 encoding unit that encodes and outputs a numerical value;
A histogram calculation unit for obtaining a histogram of numerical values appearing in the data after being encoded by the first data compression unit;
Based on the histogram obtained by the histogram calculation unit, a code allocating unit that assigns a code having a shorter code length to a table that associates a code and a numerical value with a higher appearance frequency,
It is more preferable to include a second encoding unit that performs entropy encoding on the data encoded by the first encoding unit using the table to which the code is allocated by the code allocation unit. preferable.

また、本発明のデータ圧縮装置は、
上記下位データ圧縮部が、符号と数値を対応づけるテーブルを用いて下位データにエントロピー符号化を施すものであることが好ましい。
The data compression apparatus of the present invention
The lower data compression unit preferably performs entropy coding on the lower data using a table that associates codes and numerical values.

ここで、本発明のデータ圧縮装置において、上記の下位データ圧縮部は、ハフマンテーブルを用いて下位データにハフマン符号化を施すものであってもよい。   Here, in the data compression device of the present invention, the lower data compression unit may perform Huffman coding on the lower data using a Huffman table.

また、本発明のデータ圧縮装置は、
上記下位データ圧縮部が、圧縮省略の指示を受けて下位データを無圧縮で出力するものであることも好適である。
The data compression apparatus of the present invention
It is also preferable that the low-order data compression unit outputs a low-order data without compression in response to an instruction to omit compression.

上記目的を達成する本発明のデータ圧縮プログラムは、
プログラムを実行する情報処理装置内に組み込まれて該情報処理装置に、所定の単位ビット数で表わされる数値の連続からなる被圧縮データに対するデータ圧縮処理を実行させるデータ圧縮プログラムにおいて、
上記情報処理装置上に、
被圧縮データを構成する数値の連続について隣接する数値どうしの差分を求めることによりその差分を表わす数値の連続からなる新たな被圧縮データを生成する差分生成部と、
上記差分生成部で生成された新たな被圧縮データに基づいて、その被圧縮データの種別を判定する種別判定部と、
上記種別判定部によって所定の第1種別のデータであると判定された被圧縮データに可逆圧縮処理を施す第1種別用圧縮処理部と、
上記種別判定部によって所定の第2種別のデータであると判定された被圧縮データに可逆圧縮処理を施す第2種別用圧縮処理部とを構築し、
上記第1種別用圧縮処理部が、
被圧縮データを構成する各数値を所定値だけオフセットさせるオフセット部と、
上記オフセット部によって数値がオフセットされた被圧縮データの各数値を、上記単位ビット数よりも小さい所定の分割ビット数のところで上位ビット部分と下位ビット部分とに分けることによって、その被圧縮データを、各数値における上位ビット部分の連続からなる上位データと各数値の下位ビット部分の連続からなる下位データとに分割する分割部と、
上記分割部によって分割された上位データに対して可逆圧縮処理を施す上位データ圧縮部と、
上記分割部によって分割された下位データに対して可逆圧縮処理を施す下位データ圧縮部とを備えたものであり、
上記第2種別用圧縮処理部が、
上記第2種別のデータ中、1つもしくは複数の所定の圧縮対象数値を除く数値についてはそのまま出力するとともに、圧縮対象数値については、該圧縮対象数値と、該圧縮対象数値と同一の圧縮対象数値の連続数を表わす数値とに符号化して出力する符号化処理を含む可逆圧縮処理を施すものであることを特徴とする。
A data compression program of the present invention that achieves the above object is as follows.
In a data compression program that is incorporated in an information processing apparatus that executes a program and causes the information processing apparatus to execute data compression processing on data to be compressed consisting of a series of numerical values represented by a predetermined number of unit bits.
On the information processing apparatus,
A difference generating unit that generates new compressed 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 compressed data;
A type determination unit that determines the type of the compressed data based on the new compressed data generated by the difference generation unit;
A first type compression processing unit that performs a lossless compression process on the data to be compressed that has been determined to be predetermined first type data by the type determination unit;
A second type compression processing unit that performs a lossless compression process on the data to be compressed that has been determined to be predetermined second type data by the type determination unit;
The first type compression processor is
An offset unit for offsetting each numerical value constituting the compressed data by a predetermined value;
By dividing each numerical value of the compressed data whose numerical value is offset by the offset part into an upper bit part and a lower bit part at a predetermined divided bit number smaller than the unit bit number, the compressed data is A dividing unit that divides the upper data consisting of a continuation of the upper bit part in each numerical value and the lower data consisting of a continuation of the lower bit part of each numerical value;
An upper data compression unit that performs reversible compression processing on the upper data divided by the dividing unit;
A lower data compression unit that performs a lossless compression process on the lower data divided by the dividing unit,
The second type compression processor is
In the second type of data, 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 values and the same compression target numerical values as the compression target numerical values are output. And a reversible compression process including an encoding process of encoding and outputting a numerical value representing the continuous number of.

なお、本発明にいうデータ圧縮プログラムについては、ここではその基本形態のみを示すのにとどめるが、これは単に重複を避けるためであり、本発明にいうデータ圧縮プログラムには、上記の基本形態のみではなく、前述したデータ圧縮装置の各形態に対応する各種の形態が含まれる。   The data compression program referred to in the present invention is only shown in its basic form here, but this is only for avoiding duplication, and the data compression program referred to in the present invention includes only the above basic form. Instead, various forms corresponding to each form of the data compression apparatus described above are included.

また、本発明のデータ圧縮プログラムがコンピュータ上に構成する差分生成部などといった要素は、1つの要素が1つのプログラム部品によって構築されるものであってもよく、1つの要素が複数のプログラム部品によって構築されるものであってもよく、複数の要素が1つのプログラム部品によって構築されるものであってもよい。また、これらの要素は、そのような作用を自分自身で実行するものとして構築されてもよく、あるいは、コンピュータに組み込まれている他のプログラムやプログラム部品に指示を与えて実行するものとして構築されても良い。   In addition, an element such as a difference generation unit configured on the computer by the data compression program of the present invention may be one element constructed by one program part, and one element by a plurality of program parts. It may be constructed, or a plurality of elements may be constructed by one program part. In addition, these elements may be constructed so as to execute such actions by themselves, or constructed by giving instructions to other programs and program components incorporated in the computer. May be.

上記本発明のデータ圧縮装置ないしデータ圧縮プログラムによれば、第1種別用圧縮処理部と第2種別用圧縮処理部とによってデータ種別に応じた可逆圧縮処理が実行される。   According to the data compression apparatus or data compression program of the present invention, the lossless compression process corresponding to the data type is executed by the first type compression processing unit and the second type compression processing unit.

第1種別用圧縮処理部では、差分生成部によって生成された新たな被圧縮データがオフセット部によって数値がオフセットされ、上位データと下位データとに分割され、それぞれ上位データ圧縮部と下位データ圧縮部とで可逆圧縮処理が施される。一般に、CTデータから得られる被圧縮データの場合には、後で詳述するように、上位データと下位データとではデータ中の数値の分布傾向が顕著に異なっているので、各データに適した可逆圧縮処理が存在し、第1種別用圧縮処理部によって全体として大きな圧縮率が達成される。また、各データに施される可逆圧縮処理としては、アルゴリズムが単純な処理が適用可能であるため、第1種別用圧縮処理部による圧縮処理は処理時間が短い。このように、第1種別用圧縮処理部による圧縮処理は、主に、CTデータの圧縮に適している。   In the first type compression processing unit, the new compressed data generated by the difference generation unit is numerically offset by the offset unit and divided into upper data and lower data, and the upper data compression unit and the lower data compression unit, respectively. The lossless compression process is performed. In general, in the case of compressed data obtained from CT data, as will be described in detail later, the distribution tendency of numerical values in the data is significantly different between the upper data and the lower data, which is suitable for each data. There is a reversible compression process, and a large compression ratio is achieved as a whole by the first type compression processing unit. In addition, as a lossless compression process performed on each data, a process with a simple algorithm can be applied. Therefore, the compression process by the first type compression processing unit has a short processing time. Thus, the compression processing by the first type compression processing unit is mainly suitable for compression of CT data.

一方、第2種別用圧縮処理部では、差分生成部によって生成された新たな被圧縮データに対し、圧縮対象数値のみをその圧縮対象数値と連続数とを表わす数値とに符号化する処理が施される。一般に、LWデータから差分生成部によって生成される被圧縮データでは、データ中の数値がいくつかの特定数値に集中しており、そのような特定数値のみをその特定数値と連続数とを表わす数値とに符号化することで大きな圧縮率が達成される。つまり、第2種別用圧縮処理部による圧縮処理は、主に、LWデータの圧縮に適している。   On the other hand, the second type compression processing unit performs processing for encoding only the compression target numerical value into the compression target numerical value and the numerical value representing the continuous number for the new compressed data generated by the difference generation unit. Is done. In general, in the compressed data generated from the LW data by the difference generation unit, the numerical values in the data are concentrated on some specific numerical values, and only such specific numerical values are numerical values representing the specific numerical value and the continuous number. A large compression rate can be achieved by encoding the data. That is, the compression processing by the second type compression processing unit is mainly suitable for compression of LW data.

このように、本発明のデータ圧縮装置ないしデータ圧縮プログラムによれば、CTデータとLWデータの双方が大きな圧縮率で可逆圧縮されることとなる。   Thus, according to the data compression apparatus or data compression program of the present invention, both CT data and LW data are reversibly compressed at a large compression rate.

ここで、データ種別の判定に当たっては、上記種別判定部が、上記差分生成部で生成された新たな被圧縮データ中に出現する数値のヒストグラムを求め、そのヒストグラムに基づいて被圧縮データの種別を判定することで、例えばCTデータとLWデータを適切に判定することができる。   Here, in determining the data type, the type determination unit obtains a histogram of numerical values appearing in the new compressed data generated by the difference generation unit, and determines the type of the compressed data based on the histogram. By determining, for example, CT data and LW data can be appropriately determined.

また、上記の上位データ圧縮部が第1の符号化部を備えると、圧縮対象数値のみが、その圧縮対象数値と連続数とを表わす数値とに符号化されるため、原データよりも冗長度が増すという事態が回避され、圧縮率が向上する。   Further, when the upper data compression unit includes the first encoding unit, 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, the redundancy is higher than that of the original data. Is avoided, and the compression rate is improved.

また、上記の上位データ圧縮部が第2の符号化部を備えると、エントロピー符号化(典型的にはハフマン符号化)による、圧縮率の更なる向上が見込まれる。   Further, when the upper data compression unit includes the second encoding unit, further improvement of the compression rate is expected by entropy encoding (typically Huffman encoding).

さらに、上記の上位データ圧縮部が、ヒストグラム算出部と符号割当部とを備え、第2の符号化部が、符号割当部で符号が割り当てられたテーブルを用いてエントロピー符号化(例えばハフマン符号化)を施すものであると、符号の割り当てが固定されたテーブルを用いたエントロピー符号化と比べ、圧縮率をさらに大きく向上させることができる。   Further, the higher-order data compression unit includes a histogram calculation unit and a code allocation unit, and the second encoding unit uses entropy coding (for example, Huffman coding) using a table to which codes are allocated by the code allocation unit. ), The compression ratio can be further improved as compared with entropy coding using a table in which code assignment is fixed.

また、上記の下位データ圧縮部が、エントロピー符号化を施すものであると、エントロピー符号化(典型的にはハフマン符号化)による、圧縮率の更なる向上が見込まれる。   Further, if the lower data compression unit performs entropy coding, further improvement of the compression rate by entropy coding (typically Huffman coding) is expected.

さらに、上記の下位データ圧縮部が、圧縮省略の指示を受けて下位データを無圧縮で出力するものであると、そのような指示によってより高速な圧縮処理を選択することができる。   Furthermore, when the lower data compression unit receives an instruction to omit compression and outputs the lower data without compression, it is possible to select a higher-speed compression process according to such an instruction.

以下において説明する実施形態は、図1に示す全体システムの中のホストコントローラに組み込まれる画像圧縮装置であり、さらに具体的には、図2に示すホストコントローラ内のCTのビットマップデータ12AおよびLWのビットマップデータ13Aについてデータ圧縮を行なう処理に関するものである。したがって、ここでは、図1,図2を参照して説明したCTデータおよびLWデータについてのデータ圧縮処理が以下に説明する本発明の実施形態としてのデータ圧縮処理に置き換わり、インターフェース機器内でのデータ伸長(解凍)処理もその本発明の実施形態としてのデータ圧縮処理に対応したデータ伸長(解凍)処理に置き換わるものと理解し、図1に示す全体システムおよび図2に示す処理の流れについて重複した図示および重複説明は省略する。   The embodiment described below is an image compression apparatus incorporated in a host controller in the overall system shown in FIG. 1, and more specifically, CT bitmap data 12A and LW in the host controller shown in FIG. The present invention relates to the data compression processing for the bitmap data 13A. Therefore, here, the data compression processing for the CT data and LW data described with reference to FIGS. 1 and 2 is replaced with the data compression processing according to the embodiment of the present invention described below, and the data in the interface device is replaced. It is understood that the decompression (decompression) process replaces the data decompression (decompression) process corresponding to the data compression process as the embodiment of the present invention, and the entire system shown in FIG. 1 and the process flow shown in FIG. 2 are duplicated. The illustration and repeated explanation are omitted.

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

この図3に示す画像圧縮装置500は、差分符号化部510、ヒストグラム解析部515、オフセット部520、プレーン分割部530、Lプレーン圧縮部540、Hプレーン圧縮部550、およびLW圧縮部560を備えている。各部510〜560の詳細は後述するが、この画像圧縮装置500内での画像データの流れは以下のとおりである。   The image compression apparatus 500 shown in FIG. 3 includes a differential encoding unit 510, a histogram analysis unit 515, an offset unit 520, a plane division unit 530, an L plane compression unit 540, an H plane compression unit 550, and an LW compression unit 560. ing. Although details of each of the units 510 to 560 will be described later, the flow of image data in the image compression apparatus 500 is as follows.

入力画像ファイルD0(本実施形態では、図2に示すように、ビットマップに展開されたCTデータ12Aが格納されたファイル)は、図4に示すデータ圧縮装置500の、差分符号化部510に入力されて、差分符号化処理、すなわち、入力されてきたデータを構成する数値の連続について隣接する数値どうしの差分を求めることによりその差分を表わす8ビットの数値の連続からなる画像データを生成する処理が行なわれる。この差分符号化部510は、本発明にいう差分生成部の一例に相当する。   The input image file D0 (in this embodiment, a file storing CT data 12A expanded into a bitmap as shown in FIG. 2) is stored in the differential encoding unit 510 of the data compression apparatus 500 shown in FIG. When input, differential encoding processing, that is, by obtaining a difference between adjacent numerical values for a series of numerical values constituting the input data, image data composed of a series of 8-bit numerical values representing the difference is generated. Processing is performed. The difference encoding unit 510 corresponds to an example of a difference generation unit referred to in the present invention.

差分符号化部510で生成された、差分を表わす数値の連続からなる画像データは、ヒストグラム解析部515に入力されてデータ値のヒストグラムが解析され、その画像データの種別が、CTデータとLWデータとのいずれかに判定される。このヒストグラム解析部515は、本発明にいう種別判定部の一例に相当する。   The image data composed of a series of numerical values representing the difference generated by the difference encoding unit 510 is input to the histogram analysis unit 515 to analyze the histogram of the data values, and the type of the image data is CT data and LW data. It is determined as one of the above. The histogram analysis unit 515 corresponds to an example of a type determination unit according to the present invention.

この図3に示す要素のうち、オフセット部520、プレーン分割部530、Lプレーン圧縮部540、およびHプレーン圧縮部550によって、本発明にいう第1種別用圧縮処理部の一例が構成されており、ヒストグラム解析部515によってCTデータと判定された画像データはオフセット部520に入力されて所定値だけオフセットされる。その後、プレーン分割部530で、画像データ中の8ビットの各数値が下位4ビットと上位4ビットとに分けられることにより、画像データは、下位4ビットの数値の連続からなる下位サブプレーンD1Lと上位4ビットの数値の連続からなる上位サブプレーンD1Hに分割される。このオフセット部520は、本発明にいうオフセット部の一例に相当し、プレーン分割部530は、本発明にいう分割部の一例に相当する。また、下位サブプレーンD1Lおよび上位サブプレーンD1Hは、それぞれ、本発明にいう下位データおよび上位データの各一例に相当する。   Among the elements shown in FIG. 3, the offset unit 520, the plane division unit 530, the L plane compression unit 540, and the H plane compression unit 550 constitute an example of the first type compression processing unit according to the present invention. The image data determined as CT data by the histogram analysis unit 515 is input to the offset unit 520 and offset by a predetermined value. Thereafter, the plane division unit 530 divides each numerical value of 8 bits in the image data into lower 4 bits and upper 4 bits, so that the image data is converted into a lower subplane D1L composed of a sequence of lower 4 bits. It is divided into an upper subplane D1H consisting of a sequence of upper 4 bits. The offset unit 520 corresponds to an example of an offset unit according to the present invention, and the plane division unit 530 corresponds to an example of a division unit according to the present invention. Further, the lower subplane D1L and the upper subplane D1H correspond to examples of the lower data and the upper data according to the present invention, respectively.

プレーン分割部530で分割された下位サブプレーンD1Lおよび上位サブプレーンD1Hは、それぞれ、Lプレーン圧縮部540およびHプレーン圧縮部550に入力されて可逆圧縮が施される。これらLプレーン圧縮部540およびHプレーン圧縮部550は、それぞれ、本発明にいう下位データ圧縮部および上位データ圧縮部の各一例に相当する。   The lower subplane D1L and the upper subplane D1H divided by the plane division unit 530 are input to the L plane compression unit 540 and the H plane compression unit 550, respectively, and subjected to lossless compression. The L plane compression unit 540 and the H plane compression unit 550 correspond to examples of the lower data compression unit and the upper data compression unit according to the present invention, respectively.

Lプレーン圧縮部540のハフマン符号化部541では、数値と符号とを対応づける固定的なハフマンテーブルに従って、そのハフマン符号化部541に入力されてきた下位サブプレーンD1Lを構成する数値をそのハフマンテーブルに従う符号に置き換える符号化処理が行なわれる。このハフマン符号化は、エントロピー符号化の一種である。なお、Lプレーン圧縮部540にはモード切換部542が組み込まれており、このモード切換部542は、ユーザから、高速モードと通常モードとの切り換えを指示されて、上記のハフマン符号化部541によるハフマン符号化を経る通常モードと、ハフマン符号化を省略して下位サブプレーンD1Lをそのまま出力する高速モードとを切り換える。このようなLプレーン圧縮部540からは、下位サブプレーンD1Lが圧縮された下位圧縮データD2Lが出力されるが、高速モードの場合には下位圧縮データD2Lは下位サブプレーンD1Lそのものである。   In the Huffman coding unit 541 of the L plane compression unit 540, in accordance with a fixed Huffman table that associates a numerical value with a code, the numerical value constituting the lower subplane D1L input to the Huffman coding unit 541 is displayed in the Huffman table. An encoding process for replacing with a code according to the above is performed. This Huffman coding is a kind of entropy coding. Note that a mode switching unit 542 is incorporated in the L plane compression unit 540, and the mode switching unit 542 is instructed by the user to switch between the high speed mode and the normal mode, and is performed by the Huffman coding unit 541. Switching between a normal mode that undergoes Huffman coding and a high-speed mode that omits Huffman coding and outputs the lower subplane D1L as it is. The L-plane compression unit 540 outputs lower-order compressed data D2L obtained by compressing the lower-order subplane D1L. In the high-speed mode, the lower-order compressed data D2L is the lower-order subplane D1L itself.

一方、Hプレーン圧縮部550には、ランレングス符号化部551と、データスキャニング部552と、ハフマン符号化部553が備えられており、上位サブプレーンD1Hはランレングス符号化部551に入力される。   On the other hand, the H plane compression unit 550 includes a run length encoding unit 551, a data scanning unit 552, and a Huffman encoding unit 553, and the upper subplane D1H is input to the run length encoding unit 551. .

ランレングス符号化部551では、先ず、入力されてきた上位サブプレーンD1Hのデータの中から1つもしくは複数の圧縮対象数値の存在及び同一の圧縮対象数値の連続数が検出される。次いで、ランレングス符号化部551では、その検出結果を受けて、上位サブプレーンD1Hのデータ中、圧縮対象数値を除く数値についてはそのまま出力すると共に、圧縮対象数値については、その圧縮対象数値と、その圧縮対象数値と同一の圧縮対象数値の連続数を表わす数値とに符号化して出力するという符号化処理が行なわれる。このランレングス符号化部551では、その符号化処理にあたっては、同一の圧縮対象数値の連続数に応じ、その連続数を異なるビット数で表現する符号化が行なわれる。ここでは、具体的には、同一の圧縮対象数値の連続数が所定数以下のときはその連続数を1単位ビット数で表現し、その連続数が所定数を越えるときは2単位ビット数で表現する符号化が行なわれる。本実施形態では、このランレングス符号化部551が、本発明にいう第1の符号化部の一例に相当する。   In the run-length encoding unit 551, first, the presence of one or a plurality of compression target numerical values and the continuous number of the same compression target numerical values are detected from the input data of the upper subplane D1H. Next, the run-length encoding unit 551 receives the detection result, and outputs the numerical values excluding the numerical values to be compressed in the data of the upper subplane D1H as they are, and the numerical values to be compressed with the numerical values to be compressed, An encoding process is performed in which the compression target numerical value is encoded and output as a numerical value representing the number of consecutive compression target numerical values. In the run-length encoding unit 551, 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 run-length encoding unit 551 corresponds to an example of the first encoding unit referred to in the present invention.

また、ランレングス符号化部551での符号化後のデータは、次に、データスキャニング部552とハフマン符号化部553との双方に入力される。データスキャニング部552では、ランレングス符号化部551で符号化された後のデータの全てをスキャニングして、そのデータ中に出現する全ての数値の出現頻度(ヒストグラム)が求められる。ここで、この出現頻度を求める処理は、本実施形態では、図3に示す上位サブプレーンD1Hの1つずつを単位として実行され、各上位サブプレーンD1Hの、ランレングス符号化部551で符号化された後のデータ中の数値の出現頻度が求められる。さらに、データスキャニング部552では、求められたデータヒストグラム(数値の出現頻度)に基づき、ハフマンテーブルに、出現頻度の高い数値ほど符号長の短かい符号を割り当てる。このデータスキャニング部552は、本発明にいうヒストグラム算出部および符号割当部の各一例を兼ね備えたものに相当する。   The data encoded by the run-length encoding unit 551 is then input to both the data scanning unit 552 and the Huffman encoding unit 553. The data scanning unit 552 scans all of the data encoded by the run length encoding unit 551, and obtains the appearance frequency (histogram) of all the numerical values appearing in the data. Here, in the present embodiment, the processing for obtaining the appearance frequency is performed in units of one of the upper subplanes D1H illustrated in FIG. 3, and is encoded by the run length encoding unit 551 of each upper subplane D1H. The frequency of appearance of the numerical value in the data after being processed is obtained. Furthermore, the data scanning unit 552 assigns a code having a shorter code length to a Huffman table based on the obtained data histogram (numerical frequency appearance frequency). The data scanning unit 552 corresponds to a combination of examples of the histogram calculation unit and the code allocation unit according to the present invention.

データスキャニング部552で数値に符号が割り当てられてなるハフマンテーブルは、ハフマン符号化部553に渡され、ハフマン符号化部553では、その渡されたハフマンテーブルに従って、そのハフマン符号化部553に入力されてきたデータを構成する数値を、そのハフマンテーブルに従う符号、すなわち、出現頻度の高い数値ほど短かいビット長で表わされる符号に置き換える符号化処理が行なわれる。このハフマン符号化部553は、本発明にいう第2の符号化部の一例に相当する。   The Huffman table in which a code is assigned to a numerical value by the data scanning unit 552 is passed to the Huffman coding unit 553, and the Huffman coding unit 553 inputs the Huffman coding unit 553 according to the passed Huffman table. An encoding process is performed in which numerical values constituting the received data are replaced with codes according to the Huffman table, that is, codes represented by shorter bit lengths as numerical values having a higher appearance frequency. The Huffman encoder 553 corresponds to an example of the second encoder according to the present invention.

ハフマン符号化部553でハフマン符号化された後のデータは、データスキャニング部552で割り当てられた数値と符号との割当テーブルを含む圧縮情報が添付され、上位サブプレーンD1Hが圧縮された上位圧縮データD2HとしてHプレーン圧縮部550から出力される。   The data after the Huffman coding by the Huffman coding unit 553 is attached with compression information including an assignment table of numerical values and codes assigned by the data scanning unit 552, and the upper compressed data in which the upper subplane D1H is compressed. It is output from the H plane compression unit 550 as D2H.

このようにLプレーン圧縮部540およびHプレーン圧縮部550のそれぞれから出力される下位圧縮データD2Lと上位圧縮データD2Hとの組は、CTの画像データが可逆圧縮された可逆圧縮データを構成する。   Thus, the set of the lower-order compressed data D2L and the higher-order compressed data D2H output from each of the L-plane compression unit 540 and the H-plane compression unit 550 constitutes reversible compression data obtained by reversibly compressing CT image data.

上記ヒストグラム解析部515によってLWデータと判定された画像データは、LW圧縮部560に入力されて可逆圧縮が施される。このLW圧縮部560は、本発明にいう代2種別用圧縮処理部の一例に相当し、このLW圧縮部560には、ランレングス符号化部561とハフマン符号化部562が備えられている。LWデータと判定された画像データはランレングス符号化部561に入力され、上述したHプレーン圧縮部550のランレングス符号化部551と同様の符号化処理が施される。そして、符号化後のデータはハフマン符号化部562に入力され、予め用意されている所定のハフマンテーブルに従う符号化処理が施される。LW圧縮部560では、これらの符号化により圧縮データD3が生成されて出力される。この圧縮データD3は、LWの画像データが可逆圧縮された可逆圧縮データである。   The image data determined as LW data by the histogram analysis unit 515 is input to the LW compression unit 560 and subjected to lossless compression. The LW compression unit 560 corresponds to an example of a proxy type 2 compression processing unit according to the present invention, and the LW compression unit 560 includes a run length encoding unit 561 and a Huffman encoding unit 562. The image data determined to be LW data is input to the run-length encoding unit 561, and is subjected to the same encoding process as the run-length encoding unit 551 of the H plane compression unit 550 described above. Then, the encoded data is input to the Huffman encoder 562 and subjected to an encoding process according to a predetermined Huffman table prepared in advance. The LW compression unit 560 generates and outputs compressed data D3 by these encodings. The compressed data D3 is reversible compressed data obtained by reversibly compressing LW image data.

この図3に示す画像圧縮装置500によってCTデータおよびLWデータが可逆圧縮されて得られる各可逆圧縮データは、図1に示すSCSI等の汎用インターフェース150を経由してインターフェース機器200に転送される。インターフェース機器200では、その受け取った可逆圧縮データにデータ伸長処理が施されるが、このデータ伸長処理にあたっては、図3で説明した各種の符号化処理に対応する復号化処理が施されて元の入力画像ファイル中の画像データと同一の画像データが復元される。   Reversible compression data obtained by reversibly compressing CT data and LW data by the image compression apparatus 500 shown in FIG. 3 is transferred to the interface device 200 via the general-purpose interface 150 such as SCSI shown in FIG. In the interface device 200, the received lossless compressed data is subjected to data decompression processing. In this data decompression processing, decoding processing corresponding to the various encoding processing described in FIG. The same image data as the image data in the input image file is restored.

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

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

この図4に示す、コンピュータシステムで構成されたホストコントローラ100には、CPU111、RAM112、通信インターフェース113、ハードディスクコントローラ114、FDドライブ115、CDROMドライブ116、マウスコントローラ117、キーボードコントローラ118、ディスプレイコントローラ119、および通信用ボード120が備えられており、これらはバス110で相互に接続されている。   4 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を経由して画像データを取り込むこともできる。   Further, 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.

図5は、本発明のデータ圧縮プログラムの一実施形態に相当する画像圧縮処理プログラムの模式構成図である。   FIG. 5 is a schematic configuration diagram of an image compression processing program corresponding to an embodiment of the data compression program of the present invention.

ここでは、この画像圧縮プログラム600は、CDROM140に記憶されている。   Here, the image compression program 600 is stored in the CD ROM 140.

この画像圧縮プログラム600は、差分符号化部610、ヒストグラム解析部615、オフセット部620、プレーン分割部630、Lプレーン圧縮部640、Hプレーン圧縮部650、およびLW圧縮部660から構成されている。このCDROM140には、ここに示す画像圧縮プログラム600のほか、図1に示すホストコントローラ100における一連の処理を実行するための各種プログラムが記憶されているが、それらについては従来と同様であるため図示および説明は省略する。   The image compression program 600 includes a differential encoding unit 610, a histogram analysis unit 615, an offset unit 620, a plane division unit 630, an L plane compression unit 640, an H plane compression unit 650, and an LW compression unit 660. In addition to the image compression program 600 shown here, the CDROM 140 stores various programs for executing a series of processes in the host controller 100 shown in FIG. The description is omitted.

この図5に示すCDROM140が、図4に示すホストコントローラ100に装填されCDROMドライブ116でアクセスされてそのCDROM140に記憶されているプログラムがこのホストコントローラ100にアップロードされ、ハードディスク104に記憶される。このハードディスク104に記憶されたプログラムがそのハードディスク104から読み出されてRAM112に展開されCPU111で実行されると、このホストコントローラ100は、図3に示す画像圧縮装置500としての処理を含む、ホストコントローラとしての各種処理を実行する装置として動作する。   The CD ROM 140 shown in FIG. 5 is loaded into the host controller 100 shown in FIG. 4 and accessed by the CD ROM 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. 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 a process as the image compression apparatus 500 shown in FIG. It operates as an apparatus that executes various processes.

ここで、図5に示す画像圧縮プログラム600は、ホストコントローラ100にインストールされてCPU111で実行されることにより、そのホストコントローラ100内に図3に示す画像圧縮装置500を実現するものであり、差分符号化部610、ヒストグラム解析部615、オフセット部620、プレーン分割部630、Lプレーン圧縮部640、Hプレーン圧縮部650、およびLW圧縮部660は、CPU111で実行されることにより、そのホストコントローラ100を、図3に示す画像圧縮装置500を構成する、それぞれ、差分符号化部510、ヒストグラム解析部515、オフセット部520、プレーン分割部530、Lプレーン圧縮部540、Hプレーン圧縮部550、およびLW圧縮部560として動作させるプログラム部品である。つまり、これらのプログラム部品により、画像圧縮装置500の構成要素がホストコントローラ100上に実質的に構築されることとなる。   Here, the image compression program 600 shown in FIG. 5 is installed in the host controller 100 and executed by the CPU 111, thereby realizing the image compression apparatus 500 shown in FIG. The encoding unit 610, the histogram analysis unit 615, the offset unit 620, the plane division unit 630, the L plane compression unit 640, the H plane compression unit 650, and the LW compression unit 660 are executed by the CPU 111 so that the host controller 100 Are included in the image compression apparatus 500 shown in FIG. 3, and the differential encoding unit 510, histogram analysis unit 515, offset unit 520, plane division unit 530, L plane compression unit 540, H plane compression unit 550, and LW, respectively. Professional operating as the compression unit 560 A lamb parts. That is, the components of the image compression apparatus 500 are substantially constructed on the host controller 100 by these program parts.

図5の画像圧縮プログラム600を構成する各部610〜660の、CPU111で実行されたときの作用は、それぞれ、図3の画像圧縮装置500を構成する各部510〜560の作用そのものである。したがって、図3の画像圧縮装置500の各部510〜560に関する、これまでの説明、および、以下に説明する詳細説明をもって、図5の画像圧縮プログラム600を構成する各部610〜660の説明を兼ねるものとする。   The operations of the units 610 to 660 constituting the image compression program 600 of FIG. 5 when executed by the CPU 111 are the operations themselves of the units 510 to 560 constituting the image compression apparatus 500 of FIG. Accordingly, the description up to now and the detailed description of each of the units 510 to 560 of the image compression apparatus 500 of FIG. 3 also serve as the description of the units 610 to 660 constituting the image compression program 600 of FIG. And

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

図6に示すように、図3に示すデータ圧縮装置500に入力される画像データは、所定の主走査方向に画素がM個並んでいる。その主走査方向とは直角な副走査方向に教えていったときのN番目のラインについて、主走査方向に並ぶ各画素の画素値は、その並び順に、
Dn,1,Dn,2,…,Dn,m−2,Dn,m−1,Dn,m
と表現される。
As shown in FIG. 6, the image data input to the data compression apparatus 500 shown in FIG. 3 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)番目のラインについて、主走査方向に並ぶ各画素の画素値は、その並びの順に、
Dn+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.

ここで、図3に示すデータ圧縮装置500を構成する差分符号化部510には、上記のような画像データが入力され、副走査方向に隣接する画素どうしの差分が求められる。すなわち、N番目のラインと(N+1)番目のラインとの差分であって、主走査方向に並ぶj番目の画素の差分をSn,jとすると、この差分Sn,jは、
Sn,j=Dn+1,j−Dn,j (j=1〜m)
と表現される。
Here, the image data as described above is input to the differential encoding unit 510 included in the data compression apparatus 500 illustrated in FIG. 3, 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 difference between the jth pixels arranged in the main scanning direction is Sn, j, the difference Sn, j is
Sn, j = Dn + 1, j−Dn, j (j = 1 to m)
It is expressed.

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

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

ここでは、図6に示す副走査方向に並ぶある縦一列の画素値が、図7の「画像データ」
の欄に示すように、
「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. 6 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ビット)」の欄に表わされている
「(12) EF 01 FD 65 … L0 00 FF …」
が出力される。
Hereinafter, by repeating the same operation, “(12) EF 01 FD 65... L0 00 FF...” Shown in the “difference encoding (lower 8 bits)” field of FIG.
Is output.

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

図3の差分符号化部510では、以上説明したような差分符号化が画像データに施される。この差分符号化によって得られるデータは、図3のヒストグラム解析部515に入力され、その画像データのヒストグラムが解析される。   In the differential encoding unit 510 of FIG. 3, the differential encoding as described above is performed on the image data. Data obtained by this differential encoding is input to the histogram analysis unit 515 in FIG. 3, and the histogram of the image data is analyzed.

図8は、ヒストグラム解析部で得られるヒストグラムの典型例を示す図であり、ヒストグラムの横軸はデータ値、縦軸は出現頻度(出現数)を表している。   FIG. 8 is a diagram illustrating a typical example of a histogram obtained by the histogram analysis unit, where the horizontal axis of the histogram represents the data value and the vertical axis represents the appearance frequency (number of appearances).

LWデータの場合、差分符号化部での符号化が行なわれた後においても、図8のパート(A)に示すように、いくつかの特定の数値の頻度が高くなっている。一方、CTデータの場合は、パート(B)に示すように、値0付近と値256(最大値)付近にピークがあるが、それら両端以外ではどの数値にも低い頻度で満遍なく分布している。   In the case of LW data, the frequency of some specific numerical values is high as shown in part (A) of FIG. 8 even after encoding by the differential encoding unit. On the other hand, in the case of CT data, as shown in Part (B), there are peaks in the vicinity of value 0 and value 256 (maximum value). .

図3のヒストグラム解析部515では、LWデータとCTデータとの上記の差異を利用して、例えば値0〜9および値247〜256の頻度を合わせたものが画像全体の画素数の70%以上を占める場合をCTデータ、70%未満の場合をLWデータとして判定する。   In the histogram analysis unit 515 in FIG. 3, using the above difference between the LW data and the CT data, for example, the sum of the frequencies of the values 0 to 9 and the values 247 to 256 is 70% or more of the total number of pixels of the image. Is determined as CT data, and less than 70% is determined as LW data.

このように図3のヒストグラム解析部515によって種別が判定された画像データのうちCTの画像データは、図3のオフセット部520に入力され、そのデータの各数値について所定のオフセット値が加算される。   3 is input to the offset unit 520 in FIG. 3, and a predetermined offset value is added to each numerical value of the data. .

ここで、CTの画像データに対する差分符号化およびオフセットの効果について、具体的なCTの画像データを例に用いて説明する。   Here, the effects of differential encoding and offset on CT image data will be described using specific CT image data as an example.

図9は、CTの画像データの例を示す図である。   FIG. 9 is a diagram illustrating an example of CT image data.

この図9のパート(A)には、CTの画像データが表しているCT画像の一例としてモノクロの風景画像が示されており、本実施形態では、このようなCT画像の各画素における色の濃度が8ビットの数値で表現された画像データが用いられる。図9のパート(B)には、パート(A)に示す風景画像を表す画像データにおけるデータ値のヒストグラムが示されており、このヒストグラムの横軸はデータ値、縦軸はデータ数(画素数)を表している。CT画像では一般に、ヒストグラムの幅が広く、ヒストグラム中でデータ数の山谷は生じてもヒストグラムの途中にデータ数が「0」の領域が生じることは極めてまれである。   In part (A) of FIG. 9, a monochrome landscape image is shown as an example of a CT image represented by CT image data. In this embodiment, the color of each pixel of such a CT image is shown. Image data represented by numerical values having a density of 8 bits is used. Part (B) in FIG. 9 shows a histogram of data values in the image data representing the landscape image shown in part (A), where the horizontal axis of the histogram is the data value, and the vertical axis is the number of data (number of pixels). ). In general, in a CT image, the width of a histogram is wide, and even if there are peaks and valleys in the number of data in the histogram, it is extremely rare that an area with the number of data “0” occurs in the middle of the histogram.

図10は、CTの画像データに対する差分符号化およびオフセットの効果を示す図である。   FIG. 10 is a diagram illustrating the effect of differential encoding and offset on CT image data.

この図10のパート(A)には、図9に示したCTの画像データに対して差分符号化が施されて得られるデータのヒストグラムが示されており、このヒストグラムの横軸はデータ値、縦軸は出現頻度を表している。CTの画像データに対して、図6および図7で説明した差分符号化が施されると、データのヒストグラムは、一般に、この図10のパート(A)に示すような、最小データ値と最大データ値の双方に鋭いピークを有するヒストグラムとなる。そして、このようなデータに対してオフセットが施されると、データのヒストグラムは、図10のパート(B)に示すような、オフセット値のところに鋭いピークを持つヒストグラムとなる。本実施形態ではオフセット値として「8」が用いられており、オフセットの結果、値が「16」以上となるデータの頻度はほとんど「0」となっている。   In part (A) of FIG. 10, a histogram of data obtained by performing differential encoding on the CT image data shown in FIG. 9 is shown. The vertical axis represents the appearance frequency. When the differential encoding described with reference to FIGS. 6 and 7 is performed on CT image data, the data histogram generally has a minimum data value and a maximum data as shown in part (A) of FIG. A histogram with sharp peaks on both data values. When such data is offset, the data histogram becomes a histogram having a sharp peak at the offset value as shown in part (B) of FIG. In the present embodiment, “8” is used as the offset value, and the frequency of data whose value is “16” or more is almost “0” as a result of the offset.

このように差分符号化およびオフセットによってヒストグラムが変形されたデータは、図3のプレーン分割部530によって下位サブプレーンと上位サブプレーンとに分割される。   The data in which the histogram is deformed by differential encoding and offset in this way is divided into a lower subplane and an upper subplane by the plane dividing unit 530 in FIG.

図11は、プレーン分割部530によるデータ分割の効果を説明する図である。   FIG. 11 is a diagram for explaining the effect of data division by the plane division unit 530.

この図11には、図10のパート(B)に示すヒストグラムがデータ値「15」とデータ値「16」との間で切り離されたヒストグラムが示されており、図3のプレーン分割部530によるデータ分割は、まさにこのようなヒストグラムの分割に相当する効果を生じる。すなわち、本実施形態では、データを構成している8ビットの各数値が上位4ビットと下位4ビットとに分割されることで、下位4ビットが表す数値の連続からなる下位サブプレーンと上位4ビットが表す数値の連続からなる上位サブプレーンとが得られる。そして、下位サブプレーンを構成する4ビットの数値が値「0」から値「15」までの各数値をそのまま表現していて、上位サブプレーンを構成する4ビットの数値の場合は、値「16」から値「256」までの、16間隔16種類の数値を表現していると解釈すると、下位サブプレーンのヒストグラムは、この図11の左側に示されたヒストグラムとほぼ同じものとなり、上位サブプレーンのヒストグラムは、図10の右側に示されたヒストグラムとほぼ同じものとなる。ただし、上位サブプレーンのヒストグラムについては、図11の右側に示されたヒストグラムのデータ値「16」のところに、図11の左側に示されたヒストグラムの面積に等しい高さのピークが付加されたものとなる。   FIG. 11 shows a histogram obtained by separating the histogram shown in Part (B) of FIG. 10 between the data value “15” and the data value “16”. The plane dividing unit 530 of FIG. Data division produces an effect equivalent to such a histogram division. In other words, in this embodiment, each 8-bit numerical value constituting the data is divided into upper 4 bits and lower 4 bits, so that the lower subplane and the upper 4 An upper subplane consisting of a series of numerical values represented by bits is obtained. Then, the 4-bit numerical value constituting the lower subplane directly represents the numerical values from the value “0” to the value “15”, and in the case of the 4-bit numerical value constituting the upper subplane, the value “16” is used. ”To“ 256 ”, the histogram of the lower subplane is substantially the same as the histogram shown on the left side of FIG. Is substantially the same as the histogram shown on the right side of FIG. However, for the histogram of the upper subplane, a peak having a height equal to the area of the histogram shown on the left side of FIG. 11 is added to the data value “16” of the histogram shown on the right side of FIG. It will be a thing.

このような上位サブプレーンは、図3に示すHプレーン圧縮部550を構成するランレングス符号化部551に入力される。   Such higher order subplanes are input to the run length encoding unit 551 constituting the H plane compression unit 550 shown in FIG.

本実施形態では、処理の都合上、ランレングス符号化部551で、上位サブプレーンを構成する連続した4ビットの数値が2つで1つの8ビットの数値として取り扱われ、16進数表示で値「00」から値「FF」までの数値の連続に対して以下の符号化処理が適用される。   In this embodiment, for convenience of processing, the run-length encoding unit 551 treats two consecutive 4-bit numerical values constituting the upper subplane as one 8-bit numerical value, and displays the value “ The following encoding process is applied to a series of numerical values from “00” to the value “FF”.

この符号化処理では、複数の8ビットの数値のうちの特定の数値についてのみ符号化処理が行なわれる。このため、このランレングス符号化部551では、受け取ったデータの中から、符号化処理を行なう数値(ここでは、この数値を「圧縮対象数値」と称する)と、その圧縮対象数値の連続数が検出される。   In this encoding process, the encoding process is performed only for a specific numerical value among a plurality of 8-bit numerical values. For this reason, in the run length encoding unit 551, a numerical value to be encoded from the received data (here, this numerical value is referred to as a “compression target numerical value”) and a continuous number of the compression target numerical value are obtained. Detected.

本実施形態では、一例として、「01」、「FF」および「00」の3つの数値を圧縮対象数値としている。   In this embodiment, as an example, three numerical values “01”, “FF”, and “00” are set as compression target numerical values.

図12は、図3に示すランレングス符号化部551での符号化の説明図である。   FIG. 12 is an explanatory diagram of encoding in the run-length encoding unit 551 shown in FIG.

図12の上のラインは、上位サブプレーンを構成するデータ、下のラインは、ランレングス符号化部551での符号化処理を行なった後のデータである。   The upper line in FIG. 12 is data constituting the upper subplane, and the lower line is data after the encoding process in the run-length encoding unit 551 is performed.

ここでは、図12の上のラインに示すように、量子化処理部551からは、
「06 02 02 02 01 01 01 01 04 05 00 … 」
なるデータが入力されたものとする。このとき、図3のランレングス符号化部551では、先頭の「06」は圧縮対象数値ではなく、次に続く「02 02 02」も圧縮対象数値ではなく、次に、圧縮対象数値である「01」が4つ連続していること、次に、圧縮対象数値ではない「04」、「05」を間に置いて、圧縮対象数値である「00」が32767個連続していることが検出される。
Here, as shown in the upper line of FIG. 12, from the quantization processing unit 551,
"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 run-length encoding unit 551 in FIG. 3, the leading “06” is not a compression target numerical value, and the next “02 02 02” is not a compression target numerical value. It is detected that four “01” s are consecutive, and next, 32,767 “00” s that are compression target values are inserted with “04” and “05” that are not compression target values in between. Is done.

図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」であり、さらにそれに続く「画像圧縮装置…」は、1つの「X」が1ビットを表わしており、この「画像圧縮装置…」で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 “image compression apparatus ...” following the “YY” is one bit of “X”. This “image compression apparatus...” Expresses 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 next 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.

図3のプレーン分割部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 upper subplane data (upper line) input from the plane dividing unit 530 in FIG. 3 is not a compression target numerical value, it is output as it is. 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”.

図14は、図3のランレングス符号化部551における、連続数に応じた符号化処理の例を示す図である。
・「00」が127個連続するときは、2バイトを用いて「00 7F」に符号化され、
・「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 551 in FIG.
When “00” is 127 consecutive, it is encoded into “00 7F” 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.

図3に示すランレングス符号化部551では、上記のような符号化処理が行なわれる。   In the run length encoding unit 551 shown in FIG. 3, the above encoding process is performed.

本実施形態によるランレングス符号化部551によれば、最大圧縮率は、3/32895=1/10,965にまで向上する。また、このランレングス符号化部551が符号化処理の対象としている上位サブプレーンのデータは、図11のヒストグラムで説明したように、4ビットの数値のほとんどが、データ値「16」を表現した数値「0」であり、その4ビットの数値から作られる8ビットの数値も、多くが、16進数表示で数値「00」となる。このためランレングス符号化部551における符号化処理によって大幅なデータ圧縮が期待される。   According to the run-length encoding unit 551 according to the present embodiment, the maximum compression rate is improved to 3/32895 = 1 / 10,965. In addition, as described in the histogram of FIG. 11, most of the 4-bit numerical values of the data of the upper subplane that is the target of the encoding process by the run length encoding unit 551 express the data value “16”. The numerical value is “0”, and many 8-bit numerical values created from the 4-bit numerical value are also “00” in hexadecimal notation. For this reason, significant data compression is expected by the encoding process in the run-length encoding unit 551.

図3のランレングス符号化部551で上記の符号化処理の行なわれた後のデータは、次に図3のHプレーン圧縮部550を構成するデータスキャニング部552とハフマン符号化部553に入力される。   The data after the above-described encoding processing is performed by the run-length encoding unit 551 in FIG. 3 is then input to the data scanning unit 552 and the Huffman encoding unit 553 that constitute the H-plane compression unit 550 in FIG. The

このデータスキャニング部552では、先ず、ランレングス符号化部551から出力されたデータの全体がスキャニングされてデータ値の出現頻度が求められる。   In the data scanning unit 552, first, the entire data output from the run-length encoding unit 551 is scanned to determine the appearance frequency of the data value.

図15は、データスキャニング部552によるスキャニング結果の例を示す図である。   FIG. 15 is a diagram illustrating an example of a scanning result by the data scanning unit 552.

ここで、符号列「00 01 100 101 11000 11001 …」は、データスキャニング部552が符号割り当てのベースとして用いるハフマンテーブル上に予め並べられている符号列であり、一般的なハフマンテーブルとしてはこの符号列以外の他の符号列も採用され得る。   Here, the code sequence “00 01 100 101 11000 11001...” Is a code sequence preliminarily arranged on the Huffman table used as a base for code allocation by the data scanning unit 552. As a general Huffman table, this code sequence is used. Other code strings other than the strings may be employed.

ここでは、「A1」の出現頻度が最も強く、以下順に、「A2」、「A3」、「A4」、…の順であるとする。尚、これら「A1」、「A2」等は数値を直接表わしている訳ではなく、数値を表わす符号である。すなわち、「A1」は例えば数値「00」、「A2」は数値「FF」等である。また、ここでは、簡単のため、図3のランレングス符号化部551から送られてくるデータは全てのデータ値が「A1」〜「A16」の16個の数値のうちのいずれかの数値であるものとする。そして、このような16個の数値それぞれに対して、データスキャニング部552では、出現頻度に応じた符号が割り当てられてハフマンテーブルが作成される。即ち、出現頻度の最も高い「A1」には、2ビットで表わされた符号「00」が割り当てられ、次の「A2」には、やはり2ビットで表わされた符号「01」が割り当てられ、次の「A3」、さらに次の「A4」には、3ビットで表わされる、それぞれ、符号「100」、符号「101」が割り当てられ、次の「A5」〜「A8」には、5ビットで表わされる各符号が割り当てられ、以下同様に、出現頻度が低い数値ほど多くのビット数で表わされた符号が割り当てられる。   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. Further, here, for the sake of simplicity, the data sent from the run-length encoding unit 551 in FIG. 3 is any one of 16 numerical values “A1” to “A16”. It shall be. Then, the data scanning unit 552 assigns a code corresponding to the appearance frequency to each of these 16 numerical values to create a Huffman table. That is, “A1” having the highest appearance frequency is assigned the code “00” represented by 2 bits, and the next “A2” is assigned the code “01” also represented by 2 bits. The next “A3” and the next “A4” are each assigned a code “100” and a code “101” represented by 3 bits, and the next “A5” to “A8” Each code represented by 5 bits is assigned. Similarly, a code represented by a larger number of bits is assigned to a numerical value with a lower appearance frequency.

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

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

図3のHプレーン圧縮部550を構成するハフマン符号化部553では、このようなハフマンテーブルに従ってデータの数値が符号化され、その結果、多くの数値が短かいビット数の符号に置き換えられることとなってデータ圧縮が実現される。   In the Huffman encoding unit 553 constituting the H plane compression unit 550 of FIG. 3, the numerical value of the data is encoded according to such a Huffman table, and as a result, many numerical values are replaced with a code having a short bit number. Thus, data compression is realized.

このように、図3のHプレーン圧縮部550に入力される上位サブプレーンD1Hについては、ランレングス符号化部551による符号化とハフマン符号化部553による符号化が施されることにより高い圧縮率で圧縮されて上位圧縮データD2Hとなる。   As described above, the high-order subplane D1H input to the H plane compression unit 550 in FIG. 3 is encoded by the run length encoding unit 551 and the encoding by the Huffman encoding unit 553, thereby achieving a high compression rate. Is compressed into higher-order compressed data D2H.

図3のLプレーン圧縮部540のハフマン符号化部541では、Hプレーン圧縮部550のランレングス符号化部551と同様に、4ビットの数値の2つ分が1つの8ビットの数値とみなされて処理される。また、このハフマン符号化部541による符号化処理では、固定的なハフマンテーブルが用いられる点を除いて、Hプレーン圧縮部550のハフマン符号化部553による符号化処理と同様な処理が実行される。この結果、下位サブプレーンD1Lは下位圧縮データD2Lとなる。   In the Huffman coding unit 541 of the L-plane compression unit 540 in FIG. 3, two 4-bit numerical values are regarded as one 8-bit numerical value, similarly to the run-length coding unit 551 of the H-plane compression unit 550. Processed. In the encoding process by the Huffman encoding unit 541, the same process as the encoding process by the Huffman encoding unit 553 of the H plane compression unit 550 is executed except that a fixed Huffman table is used. . As a result, the lower subplane D1L becomes the lower compressed data D2L.

以上説明した各種の処理によって、CT画像のデータについて大幅な圧縮が実現される。   By the various processes described above, the CT image data is greatly compressed.

一方、図3のヒストグラム解析部515によってLWデータと判定された画像データについては、上述したように、LW圧縮部560に入力されて可逆圧縮が施される。このLW圧縮部560のランレングス符号化部561における処理は、図12〜図14で説明したランレングス符号化部551における処理と全く同様の処理であるので重複説明は省略するが、このLW圧縮部560のランレングス符号化部561が処理対象とする画像データは、図8のパート(A)に示すようなデータ分布を有するデータであるため、このランレングス符号化部561による処理によって大幅な圧縮が実現される。LW圧縮部560のランレングス符号化部561で符号化されたデータは、ハフマン符号化部562に入力されてハフマン符号化が施される。このハフマン符号化部562による符号化処理では、LWデータ用の符号が用意されたハフマンテーブルが符号割り当てのベースとして用いられる点を除いて、Hプレーン圧縮部550のデータスキャニング部552およびハフマン符号化部553による符号化処理と同様な処理が実行される。このLW圧縮部560のハフマン符号化部562にベースとして用意されているハフマンテーブルには、図15に示した符号列とは異なる符号列が並んでおり、この符号列の符号に、出現頻度に応じた数値が割り当てられることで、ハフマン符号化に用いられるハフマンテーブルが完成する。そして、このようなハフマンテーブルが符号化処理に用いられる。以上説明したLW圧縮部560の各処理によって、LW画像のデータについても大幅な圧縮が実現される。   On the other hand, as described above, the image data determined as the LW data by the histogram analysis unit 515 in FIG. 3 is input to the LW compression unit 560 and subjected to lossless compression. The processing in the run length encoding unit 561 of the LW compression unit 560 is exactly the same as the processing in the run length encoding unit 551 described with reference to FIGS. The image data to be processed by the run-length encoding unit 561 of the unit 560 is data having a data distribution as shown in part (A) of FIG. Compression is realized. The data encoded by the run length encoding unit 561 of the LW compression unit 560 is input to the Huffman encoding unit 562 and subjected to Huffman encoding. In the encoding process by the Huffman encoding unit 562, the data scanning unit 552 and the Huffman encoding of the H plane compression unit 550 are used except that a Huffman table in which a code for LW data is prepared is used as a base for code allocation. Processing similar to the encoding processing by the unit 553 is executed. In the Huffman table prepared as a base in the Huffman encoding unit 562 of the LW compression unit 560, a code sequence different from the code sequence shown in FIG. 15 is arranged. By assigning the corresponding numerical value, the Huffman table used for Huffman coding is completed. Such a Huffman table is used for the encoding process. By each process of the LW compression unit 560 described above, significant compression is realized also for LW image data.

以上説明したように、図3に示す画像圧縮装置500は、CT画像およびLW画像それぞれの画像データを可逆圧縮によって大幅に圧縮することができる。   As described above, the image compression apparatus 500 shown in FIG. 3 can significantly compress the image data of each of the CT image and the LW image by lossless compression.

尚、図3のLW圧縮部560のハフマン符号化部562では、符号割り当てのベースとなるハフマンテーブルに、出現頻度に応じた数値が割り当てられる旨説明したが、本発明では、ハフマンテーブル中の各符号にあらかじめ固定的に各数値が割り当てられていてもよい。画像データ中の画素値の出現頻度が画像ごとに大きくは異ならない場合などには、固定的に数値を割り当てておくと一層の高速処理が可能となる。   In the HWman encoding unit 562 of the LW compression unit 560 in FIG. 3, it has been described that a numerical value corresponding to the appearance frequency is assigned to the Huffman table serving as a base for code assignment. Each numerical value may be fixedly assigned to the code in advance. When the frequency of appearance of pixel values in image data does not differ greatly from one image to another, it is possible to perform higher speed processing by assigning a fixed numerical value.

また、上記説明では、本発明にいう差分生成部の一例として、副走査方向の差分を求めるものが示されているが、本発明にいう差分生成部は、主走査方向の差分を求めるものであってもよい。また、上記説明では、本発明にいう差分生成部の一例として、いわば1次元的な差分演算を用いて差分を求めるものが示されているが、本発明にいう差分生成部は、画像の縦横双方の差分を複合した、いわば2次元的な差分演算を用いて差分を求めるものであってもよい。   Further, in the above description, as an example of the difference generation unit referred to in the present invention, the one that calculates the difference in the sub-scanning direction is shown, but the difference generation unit referred to in the present invention calculates the difference in the main scanning direction. There may be. Further, in the above description, as an example of the difference generation unit according to the present invention, the one for obtaining the difference by using a one-dimensional difference calculation is shown, but the difference generation unit according to the present invention is a vertical and horizontal image. The difference may be obtained using a so-called two-dimensional difference calculation in which both differences are combined.

データ圧縮技術が適用されたプリントシステムの一例を示す図である。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. 本発明のデータ圧縮装置の一実施形態に相当する画像圧縮装置を示すブロック構成図である。It is a block block diagram which shows the image compression apparatus corresponded to 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 image compression processing program equivalent to one Embodiment of the data compression program of this invention. 図3のデータ圧縮装置に入力される入力画像ファイル中の画像データのデータ構造および差分符号化の概念を示す図である。It is a figure which shows the data structure of the image data in the input image file input into the data compression apparatus of FIG. 3, and the concept of differential encoding. 図3のデータ圧縮装置を構成する差分符号化部における差分符号化処理を例示して示す図である。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 a figure which shows the typical example of the histogram obtained by a histogram analysis part. CTの画像データの例を示す図である。It is a figure which shows the example of the image data of CT. CTの画像データに対する差分符号化およびオフセットの効果を示す図である。It is a figure which shows the effect of the differential encoding and offset with respect to the image data of CT. プレーン分割部によるデータ分割の効果を説明する図である。It is a figure explaining the effect of the data division by a plane division part. 図3に示すランレングス符号化部での符号化の説明図である。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. 図3のランレングス符号化部における、連続数に応じた符号化処理の例を示す図である。It is a figure which shows the example of the encoding process according to the continuous number in the run length encoding part of FIG. データスキャニング部によるスキャニング結果の例を示す図である。It is a figure which shows the example of the scanning result by a data scanning part. ハフマンテーブルの一例を示す図である。It is a figure which shows an example of a Huffman table.

符号の説明Explanation of symbols

11 画像のデータ
12A,12B,13A,13B ビットマップデータ
14 非可逆の圧縮データ
15 可逆の圧縮データ
100 ホストコントローラ
140 CDROM
150 汎用インターフェースケーブル
200 インターフェース機器
250 専用インターフェースケーブル
300 プリンタ
500 画像圧縮装置
510 差分符号化部
515 ヒストグラム解析部
520 オフセット部
530 プレーン分割部
540 Lプレーン圧縮部
541 ハフマン符号化部
542 モード切換部
550 Hプレーン圧縮部
551 ランレングス符号化部
552 データスキャニング部
553 ハフマン符号化部
560 LW圧縮部
561 ランレングス符号化部
562 ハフマン符号化部
600 画像圧縮プログラム
610 差分符号化部
615 ヒストグラム解析部
620 オフセット部
630 プレーン分割部
640 Lプレーン圧縮部
650 Hプレーン圧縮部
660 LW圧縮部
11 Image data 12A, 12B, 13A, 13B Bitmap data 14 Lossy compression data 15 Lossless compression data 100 Host controller 140 CDROM
DESCRIPTION OF SYMBOLS 150 General-purpose interface cable 200 Interface apparatus 250 Dedicated interface cable 300 Printer 500 Image compression apparatus 510 Differential encoding part 515 Histogram analysis part 520 Offset part 530 Plane division part 540 L plane compression part 541 Huffman encoding part 542 Mode switching part 550 H plane Compression unit 551 Run length encoding unit 552 Data scanning unit 553 Huffman encoding unit 560 LW compression unit 561 Run length encoding unit 562 Huffman encoding unit 600 Image compression program 610 Differential encoding unit 615 Histogram analysis unit 620 Offset unit 630 Plane Division unit 640 L plane compression unit 650 H plane compression unit 660 LW compression unit

Claims (13)

所定の単位ビット数で表わされる数値の連続からなる被圧縮データにデータ圧縮処理を施すデータ圧縮装置において、
被圧縮データを構成する数値の連続について隣接する数値どうしの差分を求めることにより該差分を表わす数値の連続からなる新たな被圧縮データを生成する差分生成部と、
前記差分生成部で生成された新たな被圧縮データに基づいて、該被圧縮データの種別を判定する種別判定部と、
前記種別判定部によって所定の第1種別のデータであると判定された被圧縮データに可逆圧縮処理を施す第1種別用圧縮処理部と、
前記種別判定部によって所定の第2種別のデータであると判定された被圧縮データに可逆圧縮処理を施す第2種別用圧縮処理部とを備え、
前記第1種別用圧縮処理部が、
被圧縮データを構成する各数値を所定値だけオフセットさせるオフセット部と、
前記オフセット部によって数値がオフセットされた被圧縮データの各数値を、前記単位ビット数よりも小さい所定の分割ビット数のところで上位ビット部分と下位ビット部分とに分けることによって、該被圧縮データを、各数値における上位ビット部分の連続からなる上位データと各数値の下位ビット部分の連続からなる下位データとに分割する分割部と、
前記分割部によって分割された上位データに対して可逆圧縮処理を施す上位データ圧縮部と、
前記分割部によって分割された下位データに対して可逆圧縮処理を施す下位データ圧縮部とを備えたものであり、
前記第2種別用圧縮処理部が、
前記第2種別のデータ中、1つもしくは複数の所定の圧縮対象数値を除く数値についてはそのまま出力するとともに、圧縮対象数値については、該圧縮対象数値と、該圧縮対象数値と同一の圧縮対象数値の連続数を表わす数値とに符号化して出力する符号化処理を含む可逆圧縮処理を施すものであることを特徴とするデータ圧縮装置。
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,
A difference generating unit that generates new compressed 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 compressed data;
A type determination unit that determines the type of the compressed data based on the new compressed data generated by the difference generation unit;
A first type compression processing unit that performs a lossless compression process on the data to be compressed that has been determined by the type determination unit to be data of a predetermined first type;
A second type compression processing unit that performs a lossless compression process on the data to be compressed that has been determined to be predetermined second type data by the type determination unit;
The first type compression processing unit
An offset unit for offsetting each numerical value constituting the compressed data by a predetermined value;
By dividing each numerical value of the compressed data whose numerical value is offset by the offset unit into an upper bit part and a lower bit part at a predetermined number of divided bits smaller than the unit bit number, the compressed data is A dividing unit that divides the upper data consisting of a continuation of the upper bit part in each numerical value and the lower data consisting of a continuation of the lower bit part of each numerical value;
An upper data compression unit that performs a lossless compression process on the upper data divided by the dividing unit;
A lower data compression unit that performs a lossless compression process on the lower data divided by the dividing unit;
The second type compression processing unit
In the second type of data, 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 values and the same compression target numerical values as the compression target numerical values are output. A data compression apparatus for performing a lossless compression process including an encoding process for encoding and outputting a numerical value representing a continuous number of data.
前記種別判定部が、前記差分生成部で生成された新たな被圧縮データ中に出現する数値のヒストグラムを求め、そのヒストグラムに基づいて被圧縮データの種別を判定するものであることを特徴とする請求項1記載のデータ圧縮装置。   The type determination unit obtains a histogram of numerical values appearing in the new compressed data generated by the difference generation unit, and determines the type of the compressed data based on the histogram. The data compression apparatus according to claim 1. 被圧縮データは、連続階調画像およびラインワーク画像のうちの一方を表すデータであって、前記種別判定部は、連続階調画像を表す第1種別のデータであるかラインワーク画像を表す第2種別のデータであるかを判定するものであることを特徴とする請求項1記載のデータ圧縮装置。   The compressed data is data representing one of a continuous tone image and a linework image, and the type determining unit is a first type data representing a continuous tone image or a first linework image representing a linework image. The data compression apparatus according to claim 1, wherein the data compression apparatus determines whether the data is of two types. 前記上位データ圧縮部が、上位データ中、1つもしくは複数の所定の圧縮対象数値を除く数値についてはそのまま出力するとともに、圧縮対象数値については、該圧縮対象数値と、該圧縮対象数値と同一の圧縮対象数値の連続数を表わす数値とに符号化して出力する第1の符号化部を備えたものであることを特徴とする請求項1記載のデータ圧縮装置。   The upper data compression unit outputs the numerical value excluding one or a plurality of predetermined compression target numerical values in the upper data as it is, and the compression target numerical value is the same as the compression target numerical value and the compression target numerical value. The data compression apparatus according to claim 1, further comprising a first encoding unit that encodes and outputs a numerical value representing a continuous number of numerical values to be compressed. 前記上位データ圧縮部が、
上位データ中、1つもしくは複数の所定の圧縮対象数値を除く数値についてはそのまま出力するとともに、圧縮対象数値については、該圧縮対象数値と、該圧縮対象数値と同一の圧縮対象数値の連続数を表わす数値とに符号化して出力する第1の符号化部と、
符号と数値を対応づけるテーブルを用いて、前記第1の符号化部で符号化された後のデータにエントロピー符号化を施す第2の符号化部を備えたものであることを特徴とする請求項1記載のデータ圧縮装置。
The upper data compression unit is
In the upper data, the numerical value excluding one or a plurality of predetermined compression target numerical values is output as it is, and for the compression target numerical value, 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 set. A first encoding unit that encodes and outputs a numerical value to be represented;
A second encoding unit that performs entropy encoding on data after being encoded by the first encoding unit using a table that associates codes and numerical values is provided. Item 2. The data compression device according to Item 1.
前記上位データ圧縮部が、
上位データ中、1つもしくは複数の所定の圧縮対象数値を除く数値についてはそのまま出力するとともに、圧縮対象数値については、該圧縮対象数値と、該圧縮対象数値と同一の圧縮対象数値の連続数を表わす数値とに符号化して出力する第1の符号化部と、
ハフマンテーブルを用いて、前記第1の符号化部で符号化された後のデータにハフマン符号化を施す第2の符号化部を備えたものであることを特徴とする請求項1記載のデータ圧縮装置。
The upper data compression unit is
In the upper data, the numerical value excluding one or a plurality of predetermined compression target numerical values is output as it is, and for the compression target numerical value, 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 set. A first encoding unit that encodes and outputs a numerical value to be represented;
The data according to claim 1, further comprising a second encoding unit that performs Huffman encoding on the data after being encoded by the first encoding unit using a Huffman table. Compression device.
前記上位データ圧縮部が、
上位データ中、1つもしくは複数の所定の圧縮対象数値を除く数値についてはそのまま出力するとともに、圧縮対象数値については、該圧縮対象数値と、該圧縮対象数値と同一の圧縮対象数値の連続数を表わす数値とに符号化して出力する第1の符号化部と、
前記第1のデータ圧縮部で符号化された後のデータ中に出現する数値のヒストグラムを求めるヒストグラム算出部と、
前記ヒストグラム算出部で求められたヒストグラムに基づき、符号と数値を対応づけるテーブルに、出現頻度の高い数値ほど符号長の短かい符号を割り当てる符号割当部と、
前記符号割当部で符号が割り当てられたテーブルを用いて、前記第1の符号化部で符号化された後のデータにエントロピー符号化を施す第2の符号化部を備えたものであることを特徴とする請求項1記載のデータ圧縮装置。
The upper data compression unit is
In the upper data, the numerical value excluding one or a plurality of predetermined compression target numerical values is output as it is, and for the compression target numerical value, 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 set. A first encoding unit that encodes and outputs a numerical value to be represented;
A histogram calculation unit for obtaining a histogram of numerical values appearing in the data after being encoded by the first data compression unit;
Based on the histogram obtained by the histogram calculation unit, a code allocating unit that allocates a code having a shorter code length to a table that associates codes and numerical values with a higher appearance frequency,
Using a table in which codes are allocated by the code allocation unit, and a second encoding unit that performs entropy encoding on the data encoded by the first encoding unit. The data compression apparatus according to claim 1, characterized in that:
前記下位データ圧縮部が、符号と数値を対応づけるテーブルを用いて下位データにエントロピー符号化を施すものであることを特徴とする請求項1記載のデータ圧縮装置。   2. The data compression apparatus according to claim 1, wherein the lower-order data compression unit performs entropy coding on the lower-order data using a table associating codes with numerical values. 前記下位データ圧縮部が、ハフマンテーブルを用いて下位データにハフマン符号化を施すものであることを特徴とする請求項1記載のデータ圧縮装置。   The data compression apparatus according to claim 1, wherein the lower data compression unit performs Huffman coding on the lower data using a Huffman table. 前記下位データ圧縮部が、圧縮省略の指示を受けて下位データを無圧縮で出力するものであることを特徴とする請求項1記載のデータ圧縮装置。   2. The data compression apparatus according to claim 1, wherein the lower data compression unit outputs the lower data without compression in response to an instruction to omit compression. 前記第2種別用圧縮処理部が、前記符号化処理で符号化された後のデータに、符号と数値を対応づけるテーブルを用いてエントロピー符号化を施すものであることを特徴とする請求項1記載のデータ圧縮装置。   2. The compression processing unit for the second type performs entropy encoding on the data encoded by the encoding processing using a table that associates codes with numerical values. The data compression apparatus described. 前記第2種別用圧縮処理部が、前記符号化処理で符号化された後のデータに、ハフマンテーブルを用いてハフマン符号化を施すものであることを特徴とする請求項1記載のデータ圧縮装置。   2. The data compression apparatus according to claim 1, wherein the second type compression processing unit performs Huffman coding on the data encoded by the encoding processing using a Huffman table. . プログラムを実行する情報処理装置内に組み込まれて該情報処理装置に、所定の単位ビット数で表わされる数値の連続からなる被圧縮データに対するデータ圧縮処理を実行させるデータ圧縮プログラムにおいて、
前記情報処理装置上に、
被圧縮データを構成する数値の連続について隣接する数値どうしの差分を求めることにより該差分を表わす数値の連続からなる新たな被圧縮データを生成する差分生成部と、
前記差分生成部で生成された新たな被圧縮データに基づいて、該被圧縮データの種別を判定する種別判定部と、
前記種別判定部によって所定の第1種別のデータであると判定された被圧縮データに可逆圧縮処理を施す第1種別用圧縮処理部と、
前記種別判定部によって所定の第2種別のデータであると判定された被圧縮データに可逆圧縮処理を施す第2種別用圧縮処理部とを構築し、
前記第1種別用圧縮処理部が、
被圧縮データを構成する各数値を所定値だけオフセットさせるオフセット部と、
前記オフセット部によって数値がオフセットされた被圧縮データの各数値を、前記単位ビット数よりも小さい所定の分割ビット数のところで上位ビット部分と下位ビット部分とに分けることによって、該被圧縮データを、各数値における上位ビット部分の連続からなる上位データと各数値の下位ビット部分の連続からなる下位データとに分割する分割部と、
前記分割部によって分割された上位データに対して可逆圧縮処理を施す上位データ圧縮部と、
前記分割部によって分割された下位データに対して可逆圧縮処理を施す下位データ圧縮部とを備えたものであり、
前記第2種別用圧縮処理部が、
前記第2種別のデータ中、1つもしくは複数の所定の圧縮対象数値を除く数値についてはそのまま出力するとともに、圧縮対象数値については、該圧縮対象数値と、該圧縮対象数値と同一の圧縮対象数値の連続数を表わす数値とに符号化して出力する符号化処理を含む可逆圧縮処理を施すものであることを特徴とするデータ圧縮プログラム。
In a data compression program that is incorporated in an information processing apparatus that executes a program and causes the information processing apparatus to execute data compression processing on data to be compressed consisting of a series of numerical values represented by a predetermined number of unit bits.
On the information processing apparatus,
A difference generating unit that generates new compressed 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 compressed data;
A type determination unit that determines the type of the compressed data based on the new compressed data generated by the difference generation unit;
A first type compression processing unit that performs a lossless compression process on the data to be compressed that has been determined by the type determination unit to be data of a predetermined first type;
A second type compression processing unit that performs a lossless compression process on the data to be compressed that has been determined by the type determination unit to be predetermined second type data;
The first type compression processing unit
An offset unit for offsetting each numerical value constituting the compressed data by a predetermined value;
By dividing each numerical value of the compressed data whose numerical value is offset by the offset unit into an upper bit part and a lower bit part at a predetermined number of divided bits smaller than the unit bit number, the compressed data is A dividing unit that divides the upper data consisting of a continuation of the upper bit part in each numerical value and the lower data consisting of a continuation of the lower bit part of each numerical value;
An upper data compression unit that performs a lossless compression process on the upper data divided by the dividing unit;
A lower data compression unit that performs a lossless compression process on the lower data divided by the dividing unit;
The second type compression processing unit
In the second type of data, 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 values and the same compression target numerical values as the compression target numerical values are output. A data compression program for performing a lossless compression process including an encoding process for encoding and outputting a numerical value representing a continuous number of the data.
JP2005098256A 2005-03-30 2005-03-30 Data compression apparatus and data compression program Active JP4377352B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005098256A JP4377352B2 (en) 2005-03-30 2005-03-30 Data compression apparatus and data compression program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005098256A JP4377352B2 (en) 2005-03-30 2005-03-30 Data compression apparatus and data compression program

Publications (2)

Publication Number Publication Date
JP2006279734A JP2006279734A (en) 2006-10-12
JP4377352B2 true JP4377352B2 (en) 2009-12-02

Family

ID=37213965

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005098256A Active JP4377352B2 (en) 2005-03-30 2005-03-30 Data compression apparatus and data compression program

Country Status (1)

Country Link
JP (1) JP4377352B2 (en)

Also Published As

Publication number Publication date
JP2006279734A (en) 2006-10-12

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
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
JP4633576B2 (en) Data compression apparatus and data compression program
JP2008311792A (en) Device for encoding image and control method therefor
JP4173505B2 (en) Data compression apparatus and data compression program
JP4173498B2 (en) Data compression apparatus and data compression program
JP4377351B2 (en) Data compression apparatus and data compression program
US20080025620A1 (en) Data compression apparatus and data compressing program storage medium
JP4131969B2 (en) Data compression apparatus and data compression program
JP4131970B2 (en) Data compression apparatus and data compression program
JP4377352B2 (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
JP4699307B2 (en) Data compression apparatus and data compression program
JP4579793B2 (en) Data compression apparatus and data compression program
JP2005277932A (en) Device and program for compressing data
JP4435586B2 (en) Data compression apparatus and data compression program
JP4741317B2 (en) Data compression apparatus and data compression program
JP2005252531A (en) Device and program for compressing data
JP2005260408A (en) Data compression apparatus and data compression program
JP4633577B2 (en) Data compression apparatus and data compression program
JP2006060490A (en) Image compressor and image compression program

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20061215

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070706

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090903

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20090908

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: 20090910

R150 Certificate of patent or registration of utility model

Ref document number: 4377352

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: 20120918

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20130918

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

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250