JP2594766B2 - Data compression method and data compression method - Google Patents
Data compression method and data compression methodInfo
- Publication number
- JP2594766B2 JP2594766B2 JP22513394A JP22513394A JP2594766B2 JP 2594766 B2 JP2594766 B2 JP 2594766B2 JP 22513394 A JP22513394 A JP 22513394A JP 22513394 A JP22513394 A JP 22513394A JP 2594766 B2 JP2594766 B2 JP 2594766B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- raster
- code
- exclusive
- byte
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims description 20
- 238000013144 data compression Methods 0.000 title claims description 19
- 238000004364 calculation method Methods 0.000 claims description 14
- 238000010586 diagram Methods 0.000 description 10
- 238000007906 compression Methods 0.000 description 8
- 230000006835 compression Effects 0.000 description 8
- 230000005540 biological transmission Effects 0.000 description 2
- 238000007796 conventional method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002441 reversible effect Effects 0.000 description 1
Landscapes
- Image Processing (AREA)
- Compression Of Band Width Or Redundancy In Fax (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Description
【0001】[0001]
【産業上の利用分野】本発明はデータ圧縮方法に関し、
特に可逆性符号化データ圧縮方法に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data compression method,
In particular, it relates to a reversible coded data compression method.
【0002】[0002]
【従来の技術】従来、この種のデータ圧縮方法は、画像
データなどのデータ量の多い送信において、送信するデ
ータ量が膨大となるのを防ぐために用いられている。図
4は、従来技術の一実施例を示すブロック図、図5は、
従来のデータ圧縮方法の一実施例の説明図である。2. Description of the Related Art Conventionally, this kind of data compression method has been used in transmission of a large amount of data such as image data in order to prevent the amount of data to be transmitted from becoming enormous. FIG. 4 is a block diagram showing one embodiment of the prior art, and FIG.
FIG. 4 is an explanatory diagram of one embodiment of a conventional data compression method.
【0003】図4を参照すると、従来のデータ圧縮方法
は、原画像データを入力する現ラスターデータ入力手段
401と、データコードを符号化し、圧縮画像データを
出力するランレングス符号化手段402から構成され
る。Referring to FIG. 4, a conventional data compression method comprises a current raster data input means 401 for inputting original image data, and a run-length encoding means 402 for encoding a data code and outputting compressed image data. Is done.
【0004】現ラスターデータ入力手段401に与えら
れた符号化対象の現ラスターデータは、ランレングス符
号化手段402に供給される。現ラスターデータはラン
レングス符号化手段402でランレングス圧縮される。
出力符号として第1バイトは、データ種別を示すフラグ
(0:相違データ指定、1:同一データ指定)と、レン
グス(0000000〜1111111:同一データお
よび相違データのバイトの連続数−1)とで構成されて
いる。第2のバイト以降は同一あるいは相違データのコ
ードを示す。以上のようにして、圧縮画像データを出力
する。[0004] The current raster data to be coded given to the current raster data input means 401 is supplied to a run length coding means 402. The current raster data is run-length compressed by the run-length encoding unit 402.
The first byte as an output code is composed of a flag indicating a data type (0: different data designation, 1: same data designation), and a length (00000000 to 1111111: consecutive number of bytes of the same data and different data-1). Have been. The second and subsequent bytes indicate codes of the same or different data. As described above, the compressed image data is output.
【0005】次に、具体例を用いて説明する。Next, a specific example will be described.
【0006】たとえば、図5のように現ラスターデータ
入力手段401に与えられた現ラスターデータ411
は、ランレングス符号化手段402に供給される。そし
て、現ラスターデータ411はランレングス符合化手段
402でランレングス圧縮される。本具体例では、現ラ
スターデータ411の部分(a)の符合化コード412
は、第1バイトが同一データの種別を示すフラグ“1”
とレングス“0000100”(5−1)を表し、第2
バイトが同一であるデータコードを表す。現ラスターデ
ータ411の部分(b)の符合化コード413は、第1
バイトが相違データの種別を示すフラグ“0”とレング
ス“0000010”(3−1)を表し、第2バイト以
降が相違したデータコードを表す。現ラスターデータ4
11の部分(c)の符合化コード414は、130点連
続データなので、2つに分けて符合化を行う。第1バイ
トが同一データの種別を示すフラグ“1”とレングス
“1111111”(128−1)を表し、第2バイト
が同一であるデータコードを表す。加えて、第3バイト
が同一データの種別を示すフラグ“1”とレングス“0
000001”(2−1)を表し、第4バイトが同一で
あるデータコードを表す。従って、本具体例における全
符号化コード415は、部分(a)符合化コード412
と部分(b)符合化コード413と部分(c)符合化コ
ード414を合わせた形で表される。For example, as shown in FIG. 5, the current raster data 411 provided to the current raster data input means 401
Is supplied to the run-length encoding means 402. Then, the current raster data 411 is run-length compressed by the run-length encoding unit 402. In this specific example, the encoding code 412 of the part (a) of the current raster data 411 is used.
Is a flag "1" in which the first byte indicates the type of the same data.
And the length “0000100” (5-1), and the second
Represents a data code with the same byte. The encoding code 413 of the part (b) of the current raster data 411 is the first
The byte indicates the flag “0” indicating the type of the difference data and the length “0000010” (3-1), and the second and subsequent bytes indicate the different data code. Current raster data 4
Since the encoding code 414 of the portion (c) of 11 is 130-point continuous data, encoding is performed by dividing the data into two. The first byte indicates the flag “1” indicating the type of the same data and the length “1111111” (128-1), and the second byte indicates the same data code. In addition, the third byte has a flag “1” indicating the type of the same data and a length “0”.
0001 "(2-1), and the fourth byte represents the same data code. Therefore, the entire encoded code 415 in this specific example is a partial (a) encoded code 412.
And the part (b) encoding code 413 and the part (c) encoding code 414 are combined.
【0007】また、特開平1−47173号公報に詳述
されているように、さらに高度な従来技術として、排他
的論理和手段を用いて画像圧縮を行う技術がある。図6
は、この排他的論理和手段を用いた画像圧縮方式のブロ
ック図である。[0007] As described in detail in Japanese Patent Application Laid-Open No. 1-47173, as a more advanced conventional technique, there is a technique of performing image compression using exclusive OR means. FIG.
FIG. 2 is a block diagram of an image compression method using the exclusive OR means.
【0008】排他的論理和演算部73(EOR演算部)
は、現ラインメモリ71と前ラインメモリ72の各対応
するアドレスからバイト単位で読み出した現ラインと1
つ前の前ラインの2値画像データ間に、排他的論理和演
算を施して結果をバイト単位で出力する。符号化部74
は、演算部73から出力されるバイトデータを解析し、
符号化アルゴリズムを実行する。符号化アルゴリズム
は、入力されたバイトデータについて、各ビットが全て
0、全て1、その他の3つのモードの何れかであるか判
別し、さらに、同一モードをもつバイトデータのモード
と同一モードを持つバイトデータの連続数とを用いてバ
イトデータ形式で符号化する。Exclusive OR operation unit 73 (EOR operation unit)
Are the current line read out from the corresponding addresses of the current line memory 71 and the previous line memory 72 in byte units and 1
An exclusive OR operation is performed between the binary image data of the immediately preceding line and the result is output in byte units. Encoding section 74
Analyzes the byte data output from the arithmetic unit 73,
Execute the encoding algorithm. The encoding algorithm determines whether each bit of the input byte data is all 0, all 1, or any of the other three modes, and further has the same mode as the mode of the byte data having the same mode. Encode in the byte data format using the continuous number of byte data.
【0009】[0009]
【発明が解決しようとする課題】この従来のデータ圧縮
方法では、行方向に連続する同一コード部分の圧縮を行
っているため、行方向に連続する長さの長い画像データ
などに対しては、かなりの圧縮率が得られるが、行方向
に連続する長さの短い文字データなどに対しては、あま
り高い圧縮率が得られないという課題がある。また、同
様に排他的論理和手段を用いたデータ圧縮方法では、前
後が全く同じか全く違う場合は有効であるが、行方向に
連続する長さが短く、前後の行間の関連性の少ないデー
タなどに対しては、あまり高い圧縮率が得られないとい
う課題がある。In this conventional data compression method, the same code portion that is continuous in the row direction is compressed. Therefore, long image data that is continuous in the row direction is compressed. Although a considerable compression rate can be obtained, there is a problem that a very high compression rate cannot be obtained for character data having a short length that is continuous in the line direction. Similarly, a data compression method using exclusive OR means is effective when the front and rear are completely the same or completely different. For example, there is a problem that a very high compression ratio cannot be obtained.
【0010】[0010]
【課題を解決するための手段】第1の発明は、入力され
た原画像データを符号化し圧縮画像データを出力する場
合のデータ圧縮方式において、前記原画像データを入力
する現ラスターデータ入力手段と、該現ラスターデータ
の1ライン前のラスターデータを入力する前ラスターデ
ータ入力手段と、前記現ラスターデータ入力手段により
与えられる現ラスターデータと前記前ラスターデータ入
力手段により与えられた前ラスターデータのバイト単位
での一致コード点数を計算する第1の計算手段と、該現
ラスターデータ内のバイト単位での最多同一コード点数
を計算する第2の計算手段と、前記第1の計算手段と前
記第2の計算手段にて計算された前記一致コード点数と
前記同一コード点数とを比較し該一致コード点数が多い
場合は前記前ラスターデータをまた該同一コード点数が
多い場合は全てが前記現ラスターデータ内の前記最多同
一コードであるラスターデータをラスター初期データに
選択するとともに前記一致コード点数が多い場合は第1
バイトが第1の値であり前記同一コード点数が多い場合
は前記第1バイトが第2の値であり第2バイトが前記最
多同一コードであるラスター初期データ符号化コードを
生成する比較選択手段と、前記ラスター初期データと前
記現ラスターデータの排他的論理和をとる排他的論理和
演算手段と、該排他的論理和値におけるNULLデータ
のバイトを“0”でまた前記NULLデータ以外のバイ
トを“1”によりビット単位で示すラスター情報作成手
段と、前記ラスター情報作成手段で得られた前記ラスタ
ー情報を8ビットをひとつのグループとしてコード化し
ランレングス符号化することによりラスター情報符号化
コードを生成するラスター情報符号化手段と、前記排他
的論理和値における前記NULLデータ以外のコードを
ランレングス符号化することにより排他的論理和値符号
化コードを生成する排他的論理和値符号化手段とを備
え、前記ラスター初期データ符号化コードと前記ラスタ
ー情報符号化コードおよび前記排他的論理和値符号化コ
ードを全符号化コードとすることを特徴とする。According to a first aspect of the present invention, in a data compression method for encoding input original image data and outputting compressed image data, a current raster data input means for inputting the original image data includes: Raster data input means for inputting raster data one line before the current raster data; current raster data provided by the current raster data input means; and bytes of previous raster data provided by the previous raster data input means. First calculating means for calculating the number of matching code points in units, second calculating means for calculating the maximum number of identical code points in byte units in the current raster data, the first calculating means and the second calculating means The matching code points calculated by the calculating means are compared with the same code points, and if the matching code points are large, When the addition the matching code number with all cases of identity first cord number is large is selected raster data which is the largest same code in said current raster data to the raster initial data is large Deta first
When the byte is the first value and the number of the same code points is large, the first byte is the second value and the second byte is the raster initial data encoded code which is the most same code. Exclusive OR operation means for performing an exclusive OR operation of the raster initial data and the current raster data, and setting a byte of NULL data in the exclusive OR value to “0” and a byte other than the NULL data to “0”. Raster information generating means indicated in bits by 1 ", and raster information encoded code is generated by encoding the raster information obtained by the raster information generating means into 8 groups as one group and performing run length encoding. Raster information encoding means, and a run length code for a code other than the NULL data in the exclusive OR value Exclusive OR value encoding means for generating an exclusive OR value encoded code by performing the above operation, wherein the raster initial data encoded code, the raster information encoded code, and the exclusive OR value encoded code are provided. Are all coded codes.
【0011】また、第2の発明は、入力された原画像デ
ータを符号化し圧縮画像データを出力する場合のデータ
圧縮方法において、前記原画像データを現ラスターデー
タとして入力し、次に、該現ラスターデータの1ライン
前のラスターデータを前ラスターデータとして入力した
後、前記現ラスターデータと前記前ラスターデータのバ
イト単位での一致コード点数と該現ラスターデータ内の
バイト単位での最多同一コード点数を計算し、前記一致
コード点数と前記同一コード点数とを比較し該一致コー
ド点数が多い場合は前記前ラスターデータをまた該同一
コード点数が多い場合は全てが前記現ラスターデータ内
の前記最多同一コードであるラスターデータをラスター
初期データに選択するとともに前記一致コード点数が多
い場合は第1バイトが第1の値であり前記同一コード点
数が多い場合は前記第1バイトが第2の値でありかつ第
2バイトが前記最多同一コードであるラスター初期デー
タ符号化コードを生成し、次に、前記ラスター初期デー
タと前記現ラスターデータの排他的論理和をとり該排他
的論理和値におけるNULLデータのバイトを“0”で
また前記NULLデータ以外のバイトを“1”によりビ
ット単位でラスター情報として表し前記ラスター情報を
8ビットをひとつのグループとしてコード化しランレン
グス符号化することによりラスター情報符号化コードを
生成し、前記排他的論理和値における前記NULLデー
タ以外のコードをランレングス符号化することにより排
他的論理和値符号化コードを生成し、前記ラスター初期
データ符号化コードと前記ラスター情報符号化コードお
よび前記排他的論理和値符号化コードを全符号化コード
とすることを特徴とする。According to a second aspect of the present invention, in a data compression method for encoding input original image data and outputting compressed image data, the original image data is input as current raster data, and then the current raster data is input. After inputting the raster data one line before the raster data as the previous raster data, the number of matching code points of the current raster data and the previous raster data in byte units and the maximum number of identical code points in byte units of the current raster data Is calculated, and the number of matching code points is compared with the number of the same code points. When the number of matching code points is large, the previous raster data is used. The raster data which is the code is selected as the raster initial data. Is a first value and if the number of identical codes is large, generates a raster initial data encoded code in which the first byte is a second value and a second byte is the most identical code, The exclusive-OR of the raster initial data and the current raster data is calculated, and the byte of NULL data in the exclusive-OR value is set to “0”, and the byte other than the NULL data is set to “1” as bit-by-bit raster information. And generating the raster information encoded code by encoding the raster information as a group of 8 bits and performing run length encoding, and performing run length encoding on the exclusive OR value other than the NULL data. Generating an exclusive OR value encoding code by using the raster initial data encoding code and the raster Characterized by a broadcast encoded code and the exclusive-OR value encoded code and all encoded code.
【0012】[0012]
【実施例】次に、本発明について図面を参照して説明す
る。Next, the present invention will be described with reference to the drawings.
【0013】図1は、本発明の一実施例を示すブロック
図で、図2〜図3は本発明の動作説明図である。FIG. 1 is a block diagram showing one embodiment of the present invention, and FIGS. 2 and 3 are explanatory diagrams of the operation of the present invention.
【0014】図1を参照すると、本発明の実施例は、原
画像データを入力する現ラスターデータ入力手段1と、
前ラスターデータ入力手段2と、ラスター初期データ設
定手段3と、ラスター初期データと現ラスターデータの
排他的論理和をとり、対応する同一コードをNULLデ
ータに変換する排他的論理和演算手段4と、ラスターデ
ータの変更位置をビット単位で示すラスター情報作成手
段5と、データコードをランレングス符合化し、圧縮画
像データを出力するランレングス符合化手段6から構成
される。Referring to FIG. 1, an embodiment of the present invention comprises a current raster data input means 1 for inputting original image data,
A previous raster data input means 2, a raster initial data setting means 3, an exclusive OR operation means 4 for taking an exclusive OR of the raster initial data and the current raster data, and converting the corresponding same code into NULL data; The system comprises a raster information creating unit 5 that indicates a change position of raster data in bit units, and a run-length encoding unit 6 that converts data codes into run-length codes and outputs compressed image data.
【0015】ラスター初期データ設定手段3は、前ラス
ターデータと現ラスターデータの一致コード点数を計算
する第1の計算手段31と、現ラスターデータ内の最多
同一コード点数を計算する第2の計算手段32と、第1
の計算手段31と第2の計算手段32とを比較し、前者
が多い場合は前ラスターデータを、後者が多い場合は全
てが現ラスターデータ内の最多同一コードであるような
ラスターデータをラスター初期データに選択する比較選
択手段33とを備える。The raster initial data setting means 3 calculates the number of coincidence code points between the previous raster data and the current raster data, and the second calculation means calculates the maximum number of identical code points in the current raster data. 32 and the first
Is compared with the second calculating means 32. If the former is large, the previous raster data is used, and if the latter is large, raster data such that all are the same code in the current raster data is used as the initial raster data. Comparison and selection means 33 for selecting data.
【0016】ランレングス符合化手段6は、ラスター情
報を8ビットをひとつのグループとしてコード化し、ラ
ンレングス符合化するラスター情報符合化手段61と、
排他的論理和演算手段で得られた結果を用いて、ランレ
ングス符合化する排他的論理和値符合化手段62とを備
える。The run-length encoding means 6 encodes the raster information into 8 bits as one group, and encodes the run-length into raster information encoding means 61;
An exclusive OR value encoding unit 62 that performs run-length encoding using the result obtained by the exclusive OR operation unit.
【0017】次に、図1および図2を参照して、本実施
例の動作について説明する。Next, the operation of this embodiment will be described with reference to FIGS.
【0018】現ラスターデータ入力手段1に与えられた
符合化対象の現ラスターデータと、前ラスターデータ入
力手段2に与えられた前ラスターデータは、ラスター初
期データ設定手段3に供給される。 ステップ(a):第1の計算手段31は、前ラスターデ
ータと現ラスターデータの対応する位置での一致コード
の点数を計算する。 ステップ(b):第2の計算手段32は、現ラスターデ
ータ内の最高頻度の同一コードの点数を計算する。 ステップ(c):比較選択手段33は、第1の計算手段
31と第2の計算手段32とで得られた点数を比較し、
前者の点数が多い場合は前ラスターデータをラスター初
期データに選択し、後者の点数が多い場合は、ラスター
データ内のコードが全て現ラスターデータ内における最
も頻度の高いコードであるようなラスターデータをラス
ター初期データに選択し、出力する。The current raster data to be coded given to the current raster data input means 1 and the previous raster data given to the previous raster data input means 2 are supplied to a raster initial data setting means 3. Step (a): The first calculating means 31 calculates the score of the matching code at the corresponding position between the previous raster data and the current raster data. Step (b): The second calculating means 32 calculates the score of the same code having the highest frequency in the current raster data. Step (c): The comparison / selection unit 33 compares the scores obtained by the first calculation unit 31 and the second calculation unit 32,
If the former score is high, select the previous raster data as the initial raster data.If the latter score is high, select raster data such that all the codes in the raster data are the most frequent codes in the current raster data. Select as raster initial data and output.
【0019】これにより、前後のラスタデータ間の関連
性の強いデータの場合は、第1の計算手段で得られたラ
スタデータが選択され、行方行に関連性の強いデータの
場合は、第2の計算手段で得られたラスター初期データ
が選択される。In this way, the raster data obtained by the first calculation means is selected in the case of data having a strong relation between the preceding and succeeding raster data, and the second data is obtained in the case of the data having a strong relation in the next row. The raster initial data obtained by the calculation means is selected.
【0020】出力符号は、(第1バイト)あるいは(第
1バイト+第2バイト)で構成される。第1バイトは、
ラスター初期データ指定(00:前ラスターデータをラ
スター初期データとする。01:全てが現ラスターデー
タ内の最も頻度の高いコードであるラスターデータをラ
スター初期データとする。)を示す。第1バイトが“0
1”のときのみ第2バイトが存在し、現ラスターデータ
内の最も頻度の高いコードを示す。 ステップ(d):排他的論理和演算手段4は、ラスター
初期データと現ラスターデータの排他的論理和をとり、
対応する位置が同一コードである部分をNULLコード
に変換して、排他的論理和値を作成する。The output code is composed of (first byte) or (first byte + second byte). The first byte is
Raster initial data designation (00: previous raster data is used as raster initial data. 01: all raster data that is the most frequent code in the current raster data is used as raster initial data). The first byte is “0”
Only when the value is 1 ", the second byte exists and indicates the most frequent code in the current raster data. Step (d): The exclusive OR operation means 4 performs an exclusive OR operation on the raster initial data and the current raster data. Take the sum
A portion where the corresponding position is the same code is converted into a NULL code to generate an exclusive OR value.
【0021】ステップ(e):ラスター情報作成手段5
は、排他的論理和値の変更位置を示す情報として、NU
LLコードは“0”、それ以外は“1”とビット単位で
表わし、ラスター情報を作成する。ラスター情報と排他
的論理和値はランレングス符合化手段6に供給される。 ステップ(f):ラスター情報は、ラスター情報符合化
手段61で8ビットをひとつのグループとしてコード化
し、ランレングス圧縮される。出力符号として第1バイ
トは、データ種別を示すフラグ(0:相違データ指定、
1:同一データ指定)と、レングス(0000000〜
1111111:同一データおよび相違データのバイト
の連続数−1)とがそれぞれビット単位で構成されてお
り、8ビットをひとつのグループとしてコード化したも
のを示す。第2バイト以降はラスター情報を8ビットを
ひとつのグループとしてコード化したものを示す。 ステップ(g):排他的論理和値のNULLデータ以外
のデータコードをまとめた排他的論理和データは、排他
的論理和値符合化手段62でランレングス圧縮される。
出力符号は、第1バイトは、ラスター情報符合化手段6
1と同様である。第2バイト以降は排他的論理和値デー
タを示す。以上のようにして圧縮画像データを出力す
る。Step (e): raster information creating means 5
Is NU as information indicating the change position of the exclusive OR value.
The LL code is represented by “0”, and the other LL code is represented by “1” in bit units to create raster information. The raster information and the exclusive OR value are supplied to the run length encoding means 6. Step (f): The raster information is encoded by the raster information encoding means 61 into 8 bits as one group, and run-length compressed. The first byte as an output code is a flag (0: different data designation,
1: Specify the same data) and Length (00000000)
1111111: the number of consecutive bytes of the same data and the different data-1) is configured in units of bits, and indicates that 8 bits are coded as one group. The second and subsequent bytes indicate that the raster information is coded as a group of 8 bits. Step (g): Exclusive OR data obtained by combining data codes other than NULL data of the exclusive OR value is run-length compressed by the exclusive OR value encoding means 62.
The first byte of the output code is the raster information encoding means 6.
Same as 1. The second and subsequent bytes indicate exclusive OR value data. The compressed image data is output as described above.
【0022】次に、具体例を用いて説明する。Next, a specific example will be described.
【0023】たとえば、図3のように現ラスターデータ
入力手段1および前ラスターデータ入力手段2にて与え
られた前ラスターデータ311と現ラスターデータ31
2は、ラスター初期データ設定手段3に供給される。ま
ず、第1の計算手段31により前ラスターデータ311
と現ラスターデータ312の対応する位置での一致コー
ド点数を計算し、第2の計算手段32により現ラスター
データ312内の最高頻度の同一コード点数を計算し、
各々の点数を比較選択手段33で比較し、ラスター初期
データ313を設定する。本具体例では、第1の計算手
段31の結果(11点)が第2の計算手段32の結果
(2点)より多いので、前ラスターデータ311がその
ままラスター初期データ313となる。ラスター初期デ
ータ符合化コード314は、第1バイトのラスター初期
データ指定が“00H”で示される。第2のバイトの初
期データコードはない。For example, as shown in FIG. 3, the previous raster data 311 and the current raster data 31 given by the current raster data input means 1 and the previous raster data input means 2 are provided.
2 is supplied to the raster initial data setting means 3. First, the first raster data 311 is calculated by the first calculating means 31.
And the corresponding code point at the corresponding position of the current raster data 312 and the second calculating means 32 calculates the highest frequency identical code point in the current raster data 312,
Each score is compared by the comparison and selection means 33, and raster initial data 313 is set. In this specific example, since the result (11 points) of the first calculation means 31 is larger than the result (2 points) of the second calculation means 32, the previous raster data 311 becomes the raster initial data 313 as it is. In the raster initial data encoding code 314, the raster initial data designation of the first byte is indicated by “00H”. There is no initial data code for the second byte.
【0024】次に、排他的論理和演算手段4で、ラスタ
ー初期データ313と現ラスターデタ312の排他的論
理和をとり、排他的論理和値315を得る。そしてラス
ター情報作成手段5で、排他的論理和値315において
NULLコードは“0”、それ以外のコードは“1”と
なるようなラスター情報316をビット単位で作成す
る。ラスター情報316と排他的論理和値315は、ラ
ンレングス符合化手段6に供給される。まず、ラスター
情報316がラスター情報符合化手段61で8ビットを
ひとつのグループとしてコード化され、ランレングス圧
縮される。本具体例では、ラスター情報316は“92
H,41H”でコード化される。ラスター情報符合化コ
ード317の、第1バイトは相違データの種別を示すフ
ラグ“0”とレングス“0000001”(2−1)を
ビット単位で表し、8ビットをひとつのグループとして
コード化したものを示す。第2バイト以降はラスター情
報316が8ビットをひとつのグループとしてコード化
されたものを示す。次に、排他的論理和値315が排他
的論理和値符合化手段62でNULLコード以外で並べ
られた排他的論理和データ318に変換され、ランレン
グス圧縮される。本具体例では、排他的論理和値符合化
コード319の第1バイトは同一データの種別を示すフ
ラグ“1”とレングス“0000100”(5−1)を
ビット単位で表し、8ビットをひとつのグループとして
コード化したものを示す。第2バイトは同一であるデー
タコードを表す。従って、本具体例における全符号化コ
ード320は、ラスター初期データ符合化コード314
とラスター情報符合化コード317と排他的論理和値符
合化コード319を合わせた形で表される。Next, the exclusive OR operation means 4 takes the exclusive OR of the raster initial data 313 and the current raster data 312 to obtain an exclusive OR value 315. Then, the raster information creating means 5 creates raster information 316 in a bit unit such that the NULL code is "0" and the other codes are "1" in the exclusive OR value 315. The raster information 316 and the exclusive OR value 315 are supplied to the run length encoding means 6. First, the raster information 316 is coded by the raster information encoding unit 61 into 8 bits as one group, and is run-length compressed. In this specific example, the raster information 316 is “92
H, 41H. The first byte of the raster information encoding code 317 represents a flag “0” indicating the type of the difference data and a length “0000001” (2-1) in bit units, and is 8 bits. Is encoded as one group. The second and subsequent bytes indicate that the raster information 316 is encoded as 8 bits as one group.Next, an exclusive OR value 315 is an exclusive OR value. The value encoding means 62 converts the data into exclusive OR data 318 arranged in a format other than the NULL code and performs run length compression.In this specific example, the first byte of the exclusive OR value encoded code 319 is the same data. The flag “1” indicating the type of “1” and the length “0000100” (5-1) are expressed in bits, and 8 bits are coded as one group. Shown. The second byte represents the data code are identical. Hence, all the encoded code 320 in this specific example, the raster initial data coded code 314
, And a raster information encoding code 317 and an exclusive OR value encoding code 319.
【0025】上述した実施例から分るように、本発明に
より、前後のラスターデータ間の関連性の強いデータの
場合は、第1の計算手段で得られたラスター初期データ
を選択することにより、圧縮率が高くなる。また、前後
のラスターデータ間の関連性の少ないデータの場合、行
方向に連続する長さが短くても同じ行で関連性があれ
ば、第2の計算手段で得られらラスター初期データを選
択することにより圧縮率が高くなる。As can be seen from the above-described embodiment, according to the present invention, in the case of data having a strong relationship between the preceding and following raster data, the raster initial data obtained by the first calculating means is selected. The compression ratio increases. Further, in the case of data having little relation between the preceding and succeeding raster data, if there is a relation in the same row even if the length continuous in the row direction is short, the raster initial data obtained by the second calculation means is selected. By doing so, the compression ratio increases.
【0026】[0026]
【発明の効果】以上説明したように、本発明によるデー
タ圧縮方法は、現ラスターデータおよび前ラスターデー
タの一致コード点数と現ラスターデータ内の最高頻度同
一コード点数を比較し、前者が多ければ前ラスターデー
タを、後者が多ければ全てが現ラスターデータ内の最高
頻度同一コードであるようなラスターデータをラスター
データに設定した後、ラスター初期データと現ラスター
データの排他的論理和をとり、対応する同一コードをN
ULLデータ変換し、ラスターデータの変更位置の情報
をビット単位で示し、更にデータコードをランレングス
符合化するように構成したため、送信データの種類に左
右されない効率的なデータ圧縮を可能にするという効果
がある。As described above, the data compression method according to the present invention compares the number of coincident code points of the current raster data and the previous raster data with the number of identical code points of the highest frequency in the current raster data. After setting the raster data as raster data such that the latter is the same code with the highest frequency in the current raster data if there are many, the exclusive OR of the initial raster data and the current raster data is taken and the corresponding Same code N
Since the data is converted into the UL data, the information on the change position of the raster data is indicated in units of bits, and the data code is run-length coded, the effect of enabling efficient data compression independent of the type of transmission data is achieved. There is.
【図1】本発明の一実施例を示すブロック図である。FIG. 1 is a block diagram showing one embodiment of the present invention.
【図2】本発明の一実施例を示す動作フロー図である。FIG. 2 is an operation flowchart showing one embodiment of the present invention.
【図3】本発明の動作説明図である。FIG. 3 is an operation explanatory diagram of the present invention.
【図4】従来のデータ圧縮方法の一実施例を示すブロッ
ク図である。FIG. 4 is a block diagram showing one embodiment of a conventional data compression method.
【図5】従来のデータ圧縮方法の動作説明図である。FIG. 5 is a diagram illustrating the operation of a conventional data compression method.
【図6】従来のデータ圧縮方法の他の実施例を示すブロ
ック図である。FIG. 6 is a block diagram showing another embodiment of the conventional data compression method.
1 現ラスターデータ入力手段 2 前ラスターデータ入力手段 3 ラスター初期データ設定手段 4 排他的論理和演算手段 5 ラスター情報作成手段 6 ランレングス符合化手段 31 第1の計算手段 32 第2の計算手段 33 比較選択手段 61 ラスター情報符合化手段 62 排他的論理和値符合化手段 71 現ラインメモリ 72 前ラインメモリ 73 EOR演算部 74 符号化部 311 前ラスターデータ 312 現ラスターデータ 313 ラスター初期データ 314 ラスター初期データ符合化コード 315 排他的論理和値 316 ラスター情報 317 ラスター情報符合化コード 318 排他的論理和データ 319 排他的論理和値符合化コード 320 全符号化コード 401 現ラスターデータ入力手段 402 ランレングス符合化手段 411 現ラスターデータ 412 部分(a)符合化コード 413 部分(b)符号化コード 414 部分(c)符合化コード 415 全符号化コード DESCRIPTION OF SYMBOLS 1 Current raster data input means 2 Previous raster data input means 3 Raster initial data setting means 4 Exclusive OR operation means 5 Raster information creation means 6 Run length encoding means 31 First calculation means 32 Second calculation means 33 Comparison Selection means 61 Raster information encoding means 62 Exclusive OR value encoding means 71 Current line memory 72 Previous line memory 73 EOR operation unit 74 Encoding unit 311 Previous raster data 312 Current raster data 313 Raster initial data 314 Raster initial data coincidence Encoding code 315 Exclusive OR value 316 Raster information 317 Raster information encoding code 318 Exclusive OR data 319 Exclusive OR value encoding code 320 All encoding code 401 Current raster data input means 402 Run length encoding means 411Current raster data 412 Part (a) encoded code 413 Part (b) encoded code 414 Part (c) encoded code 415 Full encoded code
Claims (2)
画像データを出力する場合のデータ圧縮方式において、
前記原画像データを入力する現ラスターデータ入力手段
と、該現ラスターデータの1ライン前のラスターデータ
を入力する前ラスターデータ入力手段と、前記現ラスタ
ーデータ入力手段により与えられる現ラスターデータと
前記前ラスターデータ入力手段により与えられた前ラス
ターデータのバイト単位での一致コード点数を計算する
第1の計算手段と、該現ラスターデータ内のバイト単位
での最多同一コード点数を計算する第2の計算手段と、
前記第1の計算手段と前記第2の計算手段にて計算され
た前記一致コード点数と前記同一コード点数とを比較し
該一致コード点数が多い場合は前記前ラスターデータを
また該同一コード点数が多い場合は全てが前記現ラスタ
ーデータ内の前記最多同一コードであるラスターデータ
をラスター初期データに選択するとともに前記一致コー
ド点数が多い場合は第1バイトが第1の値であり前記同
一コード点数が多い場合は前記第1バイトが第2の値で
あり第2バイトが前記最多同一コードであるラスター初
期データ符号化コードを生成する比較選択手段と、前記
ラスター初期データと前記現ラスターデータの排他的論
理和をとる排他的論理和演算手段と、該排他的論理和値
におけるNULLデータのバイトを“0”でまた前記N
ULLデータ以外のバイトを“1”によりビット単位で
示すラスター情報作成手段と、前記ラスター情報作成手
段で得られた前記ラスター情報を8ビットをひとつのグ
ループとしてコード化しランレングス符号化することに
よりラスター情報符号化コードを生成するラスター情報
符号化手段と、前記排他的論理和値における前記NUL
Lデータ以外のコードをランレングス符号化することに
より排他的論理和値符号化コードを生成する排他的論理
和値符号化手段とを備え、前記ラスター初期データ符号
化コードと前記ラスター情報符号化コードおよび前記排
他的論理和値符号化コードを全符号化コードとすること
を特徴とするデータ圧縮方式。1. A data compression method for encoding input original image data and outputting compressed image data,
Current raster data input means for inputting the original image data, previous raster data input means for inputting raster data one line before the current raster data, and current raster data provided by the current raster data input means; First calculation means for calculating the number of coincidence code points in byte units of the previous raster data provided by the raster data input means, and second calculation for calculating the maximum number of identical code points in byte units in the current raster data Means,
The coincidence code points calculated by the first calculation means and the second calculation means are compared with the same code points. If the coincidence code points are large, the previous raster data and the same code points are compared. If there are many, the raster data that is the most same code in the current raster data is selected as the raster initial data, and if the number of matching code points is large, the first byte is the first value and the same code point is If the number is large, the first byte is a second value and the second byte is a raster initial data coded code in which the second byte is the most same code, and exclusive and exclusive of the raster initial data and the current raster data are generated. Exclusive OR operation means for performing an OR operation, and setting the byte of NULL data in the exclusive OR value to "0"
Raster information creating means for indicating bytes other than UL data in bits by "1"; and raster information obtained by encoding the raster information obtained by the raster information creating means into 8 groups as one group and run-length encoding. Raster information encoding means for generating an information encoding code; and the NUL in the exclusive OR value
Exclusive OR value encoding means for generating an exclusive OR value encoded code by run length encoding a code other than the L data, wherein the raster initial data encoded code and the raster information encoded code are provided. And a data compression method wherein the exclusive-OR value coding code is a full coding code.
画像データを出力する場合のデータ圧縮方法において、
前記原画像データを現ラスターデータとして入力し、次
に、該現ラスターデータの1ライン前のラスターデータ
を前ラスターデータとして入力した後、前記現ラスター
データと前記前ラスターデータのバイト単位での一致コ
ード点数と該現ラスターデータ内のバイト単位での最多
同一コード点数を計算し、前記一致コード点数と前記同
一コード点数とを比較し該一致コード点数が多い場合は
前記前ラスターデータをまた該同一コード点数が多い場
合は全てが前記現ラスターデータ内の前記最多同一コー
ドであるラスターデータをラスター初期データに選択す
るとともに前記一致コード点数が多い場合は第1バイト
が第1の値であり前記同一コード点数が多い場合は前記
第1バイトが第2の値でありかつ第2バイトが前記最多
同一コードであるラスター初期データ符号化コードを生
成し、次に、前記ラスター初期データと前記現ラスター
データの排他的論理和をとり該排他的論理和値における
NULLデータのバイトを“0”でまた前記NULLデ
ータ以外のバイトを“1”によりビット単位でラスター
情報として表し前記ラスター情報を8ビットをひとつの
グループとしてコード化しランレングス符号化すること
によりラスター情報符号化コードを生成し、前記排他的
論理和値における前記NULLデータ以外のコードをラ
ンレングス符号化することにより排他的論理和値符号化
コードを生成し、前記ラスター初期データ符号化コード
と前記ラスター情報符号化コードおよび前記排他的論理
和値符号化コードを全符号化コードとすることを特徴と
するデータ圧縮方法。2. A data compression method for encoding input original image data and outputting compressed image data,
After inputting the original image data as the current raster data, and then inputting the raster data one line before the current raster data as the previous raster data, matching the current raster data with the previous raster data in byte units The number of code points and the maximum number of identical code points in byte units in the current raster data are calculated, and the number of coincident code points is compared with the number of identical code points. If the number of code points is large, the raster data which is the most identical code in the current raster data is selected as the raster initial data, and if the number of matching code points is large, the first byte is the first value and the same When the number of code points is large, the first byte is the second value and the second byte is the most same code. A star initial data encoding code is generated, and then an exclusive OR of the raster initial data and the current raster data is taken, a byte of NULL data in the exclusive OR value is set to “0”, and a byte other than the NULL data is set. Are represented as raster information in bit units by “1”, the raster information is coded as a group of 8 bits, and run-length encoded to generate a raster information encoded code. An exclusive-OR code is generated by run-length coding a code other than the NULL data, and the raster initial data code, the raster information code, and the exclusive-OR code are generated. Is a fully coded code.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP22513394A JP2594766B2 (en) | 1994-09-20 | 1994-09-20 | Data compression method and data compression method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP22513394A JP2594766B2 (en) | 1994-09-20 | 1994-09-20 | Data compression method and data compression method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH0888776A JPH0888776A (en) | 1996-04-02 |
| JP2594766B2 true JP2594766B2 (en) | 1997-03-26 |
Family
ID=16824483
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP22513394A Expired - Fee Related JP2594766B2 (en) | 1994-09-20 | 1994-09-20 | Data compression method and data compression method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2594766B2 (en) |
-
1994
- 1994-09-20 JP JP22513394A patent/JP2594766B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPH0888776A (en) | 1996-04-02 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5883975A (en) | Compression and decompression methods on two-dimensional image data | |
| JP3302246B2 (en) | Encoding device | |
| JPH0366227A (en) | Method and system for compression coding and decoding method | |
| JPH0969951A (en) | Encoding method and decoding method | |
| JPH07193720A (en) | Picture encoding/decoding device | |
| US6188337B1 (en) | Low disparity coding method for digital data | |
| EP0349677B1 (en) | Image coding system | |
| JP2594766B2 (en) | Data compression method and data compression method | |
| US6691275B1 (en) | Encoder with vector-calculated disparity logic | |
| JP2003264703A (en) | Data encoding device, data encoding method, and program therefor | |
| JPH04270564A (en) | Serial picture data compression system having color information | |
| JP2863370B2 (en) | File compression encryption processor | |
| JP2940948B2 (en) | Data compression method | |
| JP3676078B2 (en) | Run-length encoding method and compression apparatus | |
| JP3350385B2 (en) | Code generation method and coding method | |
| JPH0723238A (en) | Image data compression and decompression device | |
| JP2794951B2 (en) | Decoding method of MR code | |
| US6433708B1 (en) | Method of encoding binary data | |
| JP2956636B2 (en) | Wave processing device | |
| JPS6276931A (en) | Data compressor | |
| JP3138342B2 (en) | Variable length code decoding device | |
| JPH04315270A (en) | Encoder | |
| JPH09331535A (en) | Information processing apparatus and method | |
| JP2998532B2 (en) | Address generation circuit for two-dimensional encoding table | |
| JP3351732B2 (en) | Arithmetic encoding apparatus and method, arithmetic decoding apparatus and method, and recording medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 19961105 |
|
| S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20071219 Year of fee payment: 11 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20081219 Year of fee payment: 12 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20081219 Year of fee payment: 12 |
|
| S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20081219 Year of fee payment: 12 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20091219 Year of fee payment: 13 |
|
| LAPS | Cancellation because of no payment of annual fees |