JP2001078042A - Picture expansion processing device and picture compression processing device - Google Patents

Picture expansion processing device and picture compression processing device

Info

Publication number
JP2001078042A
JP2001078042A JP24980499A JP24980499A JP2001078042A JP 2001078042 A JP2001078042 A JP 2001078042A JP 24980499 A JP24980499 A JP 24980499A JP 24980499 A JP24980499 A JP 24980499A JP 2001078042 A JP2001078042 A JP 2001078042A
Authority
JP
Japan
Prior art keywords
data
line buffer
run
stored
length
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.)
Pending
Application number
JP24980499A
Other languages
Japanese (ja)
Inventor
Yoshinori Wada
義則 和田
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 Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Xerox Co Ltd filed Critical Fuji Xerox Co Ltd
Priority to JP24980499A priority Critical patent/JP2001078042A/en
Publication of JP2001078042A publication Critical patent/JP2001078042A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To obtain a picture expansion processing device which correctly expands two-dimensionally encoded compressed data and a picture compression processing device which correctly performs two-dimensional encoding processing. SOLUTION: In a two-dimensional encoding/decoding processing constitution where one-line data are stored in a line buffer 4 as reference data and data are encoded or decoded by comparison with stored data, reference data are stored in the line buffer in a run length data form if the side of run length data constituting reference data doesn't exceed that of the line buffer 4, but they are stored in a bit map data form if the size of run length data is larger than that of the line buffer. Since the selective constitution for data stored in the line buffer is adopted, accurate reference data are stored, and accurate two-dimensional encoding processing and decoding processing are possible.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は画像伸長処理装置お
よび画像圧縮処理装置に関する。さらに詳細には、例え
ばMR圧縮などを用いて2次元符号化圧縮されたデータ
をビットマップデータにリアルタイムで伸長してプリン
タ等に出力する際に用いられる画像伸長処理装置、およ
び2次元符号化圧縮を実行する画像圧縮処理装置に関す
る。
The present invention relates to an image decompression processing device and an image compression processing device. More specifically, for example, an image decompression processing device used when decompressing data that has been two-dimensionally coded and compressed using MR compression or the like into bitmap data in real time and outputting it to a printer or the like, and two-dimensional coded compression And an image compression processing apparatus that executes the processing.

【0002】[0002]

【従来の技術】近年、プリンタの高画質化はとどまるこ
とを知らず、これに伴って印刷に用いられる画像データ
量もますます増大する傾向にある。これらの膨大な画像
データの処理を限られた計算機資源で行うためには、高
速な画像データ圧縮技術と実時間内における画像データ
の伸張技術が必須であり、これを実現するための画像伸
長処理装置および画像圧縮処理装置の開発が進められて
いる。
2. Description of the Related Art In recent years, the quality of a printer has not been improved, and the amount of image data used for printing has been increasing. In order to process these enormous amounts of image data with limited computer resources, high-speed image data compression technology and image data expansion technology in real time are indispensable. Devices and image compression processing devices are being developed.

【0003】プリンタで扱われる画像データの中で、特
にビットマップデータに関しては隣接する画素間の相関
が高いことからモディファイドリード符号(以下MR符
号)、モディファイドモディファイドリード符号(以下
MMR符号)などの2次元符号化方式を用いて圧縮され
ることが多く、この場合のデータ処理装置は、例えばフ
ァクシミリ装置で使用されている圧縮伸張プロセッサ等
によって実現される。
[0003] Among image data handled by a printer, particularly, bitmap data has a high correlation between adjacent pixels. Therefore, a modified read code (hereinafter referred to as MR code) and a modified modified read code (hereinafter referred to as MMR code) are used. In many cases, data is compressed using a dimensional encoding method. In this case, the data processing device is realized by, for example, a compression / decompression processor used in a facsimile machine.

【0004】しかしながら、ファクシミリ装置は通常3
00ドット/インチ(以下dpiと略)程度の解像度し
か持たず、ファクシミリの圧縮伸張プロセッサの処理能
力では、高速、高画質のプリンタにおいて2次元符号化
圧縮データの伸張を実時間で行うには力不足となること
が考えられる。
[0004] However, facsimile machines are usually 3
With a resolution of only about 00 dots / inch (hereinafter abbreviated as dpi), the processing capacity of a facsimile compression / expansion processor is not sufficient for real-time expansion of 2D encoded compressed data in a high-speed, high-quality printer. It may be insufficient.

【0005】このため、この2次元符号化圧縮データの
圧縮伸張処理を高速化するための一例として特開平5−
41809が開示されている。これを以下に説明する。
2次元符号化圧縮データを圧縮または伸張する際、直接
ビットマップに展開する代わりに、1次元符号化圧縮の
形態であるランレングスデータの形式に伸長する。必要
であればその後でランレングスデータをビットマップデ
ータに伸長してもよい。2次元符号化圧縮データを伸長
する際には1行前のスキャンラインを参照スキャンライ
ンとして保持する必要があるが、伸長の際に必要となる
情報は画素の変化点の位置情報であり、ランレングスデ
ータのリスト形式(以下ランリストと呼ぶことにする)
の方が高速に画素の変化点を求めることが可能である。
また、参照スキャンラインがランリスト形式を用いて実
現してあれば、ビットマップデータ形式を用いた場合と
比較して2次元符号化圧縮データを伸長する際にシフト
回数を減少することができる。その結果、伸長装置の処
理の高速化と構成の簡略化を実現することができる。
[0005] For this reason, Japanese Patent Application Laid-Open No. H05-205550 discloses an example of speeding up the compression / expansion processing of the two-dimensionally coded compressed data.
41809 is disclosed. This will be described below.
When compressing or decompressing two-dimensional encoded data, the data is decompressed into run-length data, which is a form of one-dimensional encoded compression, instead of being directly expanded into a bitmap. If necessary, the run-length data may be expanded to bitmap data thereafter. When decompressing two-dimensional encoded data, it is necessary to hold the previous scan line as a reference scan line, but the information required for decompression is position information of a pixel change point, and Length data list format (hereafter called run list)
It is possible to obtain the change point of the pixel at higher speed.
Further, if the reference scan line is realized using the run list format, the number of shifts can be reduced when the two-dimensional encoded compressed data is expanded, as compared with the case where the bit map data format is used. As a result, the processing speed of the decompression device can be increased and the configuration can be simplified.

【0006】[0006]

【発明が解決しようとする課題】しかしながら、符号化
を行うビットマップデータが白黒入り乱れた複雑な画像
を表現する際には、1スキャンラインに大量のランが発
生することになる。一般的に実時間処理が求められる伸
長装置をハードウェア化した場合、参照スキャンライン
はレジスタに保持されることとなる。従って、参照スキ
ャンラインをランリストで実現しているとき、圧縮を行
うビットマップデータによってはこの有限規模のランリ
ストに1スキャンライン分のランがすべて入りきらない
恐れがある。このとき、画像伸長処理装置はこのビット
マップデータを正しく伸長することはできないという問
題がある。
However, when the bitmap data to be encoded expresses a complicated image in which black and white are mixed, a large number of runs occur in one scan line. Generally, when a decompression device that requires real-time processing is implemented by hardware, a reference scan line is held in a register. Therefore, when the reference scan line is realized by the run list, depending on the bitmap data to be compressed, there is a possibility that all runs for one scan line cannot be included in the finite-scale run list. At this time, there is a problem that the image decompression processing device cannot decompress this bitmap data correctly.

【0007】本発明は以上のような点を考慮してなされ
たものであり、1スキャンラインのデータがランリスト
形式ではラインバッファに格納できない場合に、ランリ
スト形式ではなくビットマップ形式によって格納するこ
とによって、一定サイズ以下の画像データに対して2次
元符号化圧縮されたデータを正しく伸長する画像伸長処
理装置を提供することを目的とする。
The present invention has been made in consideration of the above points. When data of one scan line cannot be stored in a line buffer in a run list format, the data is stored in a bit map format instead of a run list format. Accordingly, it is an object of the present invention to provide an image decompression processing device that correctly decompresses two-dimensionally encoded and compressed data for image data of a certain size or less.

【0008】さらに、1スキャンラインのデータがラン
リスト形式ではラインバッファに格納できない場合に、
ランリスト形式ではなくビットマップ形式によって格納
することによって、高精度の圧縮処理を実現する画像圧
縮処理装置を提供することを目的とする。
Further, when data of one scan line cannot be stored in the line buffer in the run list format,
It is an object of the present invention to provide an image compression processing device that realizes high-precision compression processing by storing data in a bitmap format instead of a runlist format.

【0009】[0009]

【課題を解決するための手段】本発明は、上記の目的を
達成するために成された画像伸長処理装置および画像圧
縮処理装置に関するものである。
SUMMARY OF THE INVENTION The present invention relates to an image decompression processing apparatus and an image compression processing apparatus made to achieve the above object.

【0010】本発明の画像伸長処理装置は、2次元符号
化によって圧縮された圧縮データをビットマップデータ
に伸長する画像伸長処理装置において、伸長を行なう2
次元符号化圧縮データを一時格納する記憶手段と、前記
記憶手段に格納された2次元符号化圧縮データからラン
レングスデータに変換する処理を実行する第1の変換手
段と、前記第1の変換手段において生成されたランレン
グスデータからビットマップデータに変換する実行する
第2の変換手段と、1スキャンライン分のデータを参照
スキャンラインデータとして保持するラインバッファ
と、前記第1の変換手段において生成されたランレング
スデータからなるランレングスデータ形式、または前記
第2の変換手段において生成されたビットマップデータ
形式のいずれかのデータ形式を選択して1スキャンライ
ン分のデータを前記ラインバッファに書き込む制御を行
なうラインバッファ制御手段とを有し、前記第1の変換
手段は、前記ラインバッファに格納された1スキャンラ
イン分のデータを参照して、2次元符号化圧縮データか
らランレングスデータへの変換処理を実行するととも
に、前記ラインバッファに格納された参照スキャンライ
ンデータがビットマップデータ形式である場合にビット
マップデータをランレングスデータに変換する処理を実
行する構成を有することを特徴とする。
An image decompression processing apparatus according to the present invention is adapted to decompress compressed data compressed by two-dimensional encoding into bitmap data.
Storage means for temporarily storing one-dimensionally encoded compressed data, first converting means for executing a process of converting two-dimensionally encoded compressed data stored in the storing means into run-length data, and the first converting means A conversion means for converting the run-length data generated in step 2 into bitmap data, a line buffer for holding data of one scan line as reference scan line data, and a line buffer generated in the first conversion means. Control for selecting one of the run-length data format consisting of the run-length data obtained and the bitmap data format generated by the second conversion means and writing the data for one scan line to the line buffer. And line buffer control means for performing the processing, wherein the first conversion means The conversion processing from the two-dimensional encoded compressed data to the run-length data is performed by referring to the data for one scan line stored in the buffer, and the reference scan line data stored in the line buffer is converted to bitmap data. It is characterized in that it has a configuration for executing a process of converting bitmap data into run-length data when the format is the format.

【0011】さらに、本発明の画像伸長処理装置におい
て、前記ラインバッファ制御手段は、前記第1の変換手
段において生成されたランレングスデータ形式の1スキ
ャンライン分のデータサイズとラインバッファのサイズ
との比較処理を実行し、前記比較処理の結果、前記第1
の変換手段において生成されたランレングスデータ形式
の1スキャンライン分のデータサイズが前記ラインバッ
ファのサイズを上回った場合、前記第2の変換手段にお
いて生成されたビットマップデータ形式のビットマップ
データを前記ラインバッファに書き込み、前記比較処理
の結果、前記第1の変換手段において生成されたランレ
ングスデータ形式の1スキャンライン分のデータサイズ
が前記ラインバッファのサイズを上回らない場合、前記
第1の変換手段において生成されたランレングスデータ
を前記ラインバッファに書き込む処理を実行する構成を
有することを特徴とする。
Further, in the image decompression processing device according to the present invention, the line buffer control means may determine a data size of one scan line in the run-length data format generated by the first conversion means and a line buffer size. Executing a comparison process, and as a result of the comparison process,
When the data size of one scan line in the run-length data format generated by the conversion unit exceeds the size of the line buffer, the bitmap data in the bitmap data format generated by the second conversion unit is If the data size of one scan line in the run-length data format generated by the first conversion means does not exceed the size of the line buffer as a result of the comparison processing, the first conversion means Wherein the process for writing the run-length data generated in step (1) to the line buffer is performed.

【0012】さらに、本発明の画像伸長処理装置におい
て、前記ラインバッファ制御手段は、1スキャンライン
あたりに発生するランの数を計測することによって、前
記第1の変換手段において生成されたランレングスデー
タ形式の1スキャンライン分のデータ量を計測して、前
記ラインバッファに格納するデータ形式を決定する構成
を有することを特徴とする。
Further, in the image decompression processing apparatus according to the present invention, the line buffer control means measures the number of runs generated per scan line, thereby obtaining the run-length data generated by the first conversion means. The data amount for one scan line in the format is measured, and the data format to be stored in the line buffer is determined.

【0013】さらに、本発明の画像伸長処理装置におい
て、前記ラインバッファ制御手段は、前記ラインバッフ
ァに格納するデータ形式が、ランレングスデータ形式で
あるかビットマップデータ形式であるかを示す識別フラ
グを前記ラインバッファへのデータ格納時に併せてセッ
トする構成を有することを特徴とする。
Further, in the image decompression processing device according to the present invention, the line buffer control means includes an identification flag indicating whether a data format stored in the line buffer is a run-length data format or a bitmap data format. It is characterized in that it is configured to be set at the time of storing data in the line buffer.

【0014】さらに、本発明の画像伸長処理装置におい
て、前記第1の変換手段は、前記ラインバッファに格納
されたデータがビットマップデータ形式であることを前
記識別フラグに基づいて検出した場合に、前記ラインバ
ッファに格納されたビットマップデータをランレングス
データに変換する処理を実行する構成を有することを特
徴とする。
Further, in the image decompression processing device according to the present invention, when the first conversion means detects that the data stored in the line buffer is in a bitmap data format based on the identification flag, It is characterized in that it has a configuration for executing a process of converting bitmap data stored in the line buffer into run-length data.

【0015】さらに、本発明の画像伸長処理装置におい
て、前記第2の変換手段は、該第2の変換手段において
生成したビットマップデータを一時的に保持するビット
マップデータ格納部を有することを特徴とする。
Further, in the image decompression processing device of the present invention, the second conversion means has a bitmap data storage for temporarily holding the bitmap data generated by the second conversion means. And

【0016】さらに、本発明の画像伸長処理装置におい
て、前記2次元符号化圧縮データはモディファイドリー
ド符号であることを特徴とする。
Further, in the image decompression processing apparatus according to the present invention, the two-dimensional encoded compressed data is a modified read code.

【0017】さらに、本発明の画像伸長処理装置におい
て、前記2次元符号化圧縮データはモディファイドモデ
ィファイドリード符号であることを特徴とする。
Further, in the image decompression processing apparatus according to the present invention, the two-dimensional encoded compressed data is a modified modified read code.

【0018】さらに、本発明の画像圧縮処理装置は、2
次元符号化によって画像データの圧縮を実行し2次元符
号化圧縮データを生成する画像圧縮処理装置において、
1スキャンライン分のデータを参照スキャンラインデー
タとして保持するラインバッファと、ランレングスデー
タからなるランレングスデータ形式、またはビットマッ
プデータ形式のいずれかのデータ形式を選択して1スキ
ャンライン分のデータを前記ラインバッファに書き込む
制御を行なうラインバッファ制御手段と、前記ラインバ
ッファに格納された1スキャンライン分のデータを参照
して、2次元符号化処理を実行するとともに、前記ライ
ンバッファに格納された参照スキャンラインデータがビ
ットマップデータ形式である場合にビットマップデータ
をランレングスデータに変換する処理を実行する構成を
有する符号化処理手段とを有することを特徴とする。
Further, the image compression processing device of the present invention
In an image compression processing apparatus that performs compression of image data by two-dimensional encoding to generate two-dimensional encoded compressed data,
A line buffer for holding one scan line of data as reference scan line data, and selecting one of a run length data format consisting of run length data or a bit map data format to store the data of one scan line. A line buffer control unit that controls writing to the line buffer; and executes two-dimensional encoding processing with reference to data for one scan line stored in the line buffer; Encoding means for converting bitmap data into run-length data when the scan line data is in bitmap data format.

【0019】さらに、本発明の画像圧縮処理装置におい
て、前記ラインバッファ制御手段は、前記ラインバッフ
ァに格納予定のランレングスデータ形式の1スキャンラ
イン分のデータサイズとラインバッファのサイズとの比
較処理を実行し、前記比較処理の結果、前記ラインバッ
ファに格納予定のランレングスデータ形式の1スキャン
ライン分のデータサイズが前記ラインバッファのサイズ
を上回った場合、前記ラインバッファに格納予定のラン
レングスデータをビットマップデータ形式に変換して生
成されるビットマップデータを前記ラインバッファに書
き込み、前記比較処理の結果、前記ラインバッファに格
納予定のランレングスデータ形式の1スキャンライン分
のデータサイズが前記ラインバッファのサイズを上回ら
ない場合、前記ラインバッファに格納予定のランレング
スデータを前記ラインバッファに書き込む処理を実行す
る構成を有することを特徴とする。
Further, in the image compression processing apparatus according to the present invention, the line buffer control means compares the data size of one scan line in the run-length data format to be stored in the line buffer with the size of the line buffer. If the data size of one scan line in the run-length data format to be stored in the line buffer exceeds the size of the line buffer as a result of the comparison processing, the run-length data to be stored in the line buffer is deleted. The bitmap data generated by conversion to the bitmap data format is written to the line buffer, and as a result of the comparison processing, the data size of one scan line in the run length data format to be stored in the line buffer is set to the line buffer. If it does not exceed the size of It characterized by having a configuration that executes a process of writing to the line buffer the run-length data stored scheduled Nbaffa.

【0020】さらに、本発明の画像圧縮処理装置におい
て、前記ラインバッファ制御手段は、1スキャンライン
あたりに発生するランの数を計測することによって、前
記ラインバッファに格納予定のランレングスデータ形式
の1スキャンライン分のデータ量を計測して、前記ライ
ンバッファに格納するデータ形式を決定する構成を有す
ることを特徴とする。
Further, in the image compression processing apparatus according to the present invention, the line buffer control means measures the number of runs generated per one scan line, thereby obtaining one of the run-length data formats to be stored in the line buffer. It is characterized in that a data amount for a scan line is measured and a data format to be stored in the line buffer is determined.

【0021】さらに、本発明の画像圧縮処理装置におい
て、前記ラインバッファ制御手段は、前記ラインバッフ
ァに格納するデータ形式が、ランレングスデータ形式で
あるかビットマップデータ形式であるかを示す識別フラ
グを前記ラインバッファへのデータ格納時に併せてセッ
トする構成を有することを特徴とする。
Further, in the image compression processing apparatus according to the present invention, the line buffer control means includes an identification flag indicating whether a data format stored in the line buffer is a run-length data format or a bitmap data format. It is characterized in that it is configured to be set at the time of storing data in the line buffer.

【0022】さらに、本発明の画像圧縮処理装置におい
て、前記符号化処理手段は、前記ラインバッファに格納
されたデータがビットマップデータ形式であることを前
記識別フラグに基づいて検出した場合に、前記ラインバ
ッファに格納されたビットマップデータをランレングス
データに変換する処理を実行する構成を有することを特
徴とする。
Further, in the image compression processing apparatus according to the present invention, when the encoding processing means detects that the data stored in the line buffer is in a bitmap data format based on the identification flag, It is characterized by having a configuration for executing a process of converting bitmap data stored in a line buffer into run-length data.

【0023】さらに、本発明の画像圧縮処理装置におい
て、前記2次元符号化圧縮データはモディファイドリー
ド符号であることを特徴とする。
Further, in the image compression processing apparatus according to the present invention, the two-dimensional encoded compressed data is a modified read code.

【0024】さらに、本発明の画像圧縮処理装置におい
て、前記2次元符号化圧縮データはモディファイドモデ
ィファイドリード符号であることを特徴とする。
Further, in the image compression processing apparatus according to the present invention, the two-dimensional encoded compressed data is a modified modified read code.

【0025】[0025]

【発明の実施の形態】以下、図面に基づき本発明に関す
る画像伸長処理装置および画像圧縮処理装置の実施の形
態について説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Embodiments of an image decompression processing device and an image compression processing device according to the present invention will be described below with reference to the drawings.

【0026】[0026]

【実施例】[実施例1(伸長処理装置)]図1は本発明
による画像伸長処理装置の実施例1の構成を示すブロッ
ク図である。図1において、画像伸長処理装置は、記憶
手段1と、第1の変換手段2と、第2の変換手段3と、
ラインバッファ4と、ラインバッファ制御手段5とから
構成されている。記憶手段1は、図示されていないネッ
トワークI/Fなどを経由して送られてくる2次元符号
化圧縮された圧縮データを一時保持するためのものであ
る。
FIG. 1 is a block diagram showing the configuration of a first embodiment of an image decompression processing apparatus according to the present invention. In FIG. 1, an image decompression processing device includes a storage unit 1, a first conversion unit 2, a second conversion unit 3,
It comprises a line buffer 4 and line buffer control means 5. The storage unit 1 is for temporarily storing compressed data that has been two-dimensionally coded and compressed and transmitted via a network I / F (not shown).

【0027】第1の変換手段2は、記憶手段1から圧縮
データを取り出し、後述するラインバッファ4の情報を
参照しながら、2次元符号化圧縮された圧縮データをラ
ンレングスデータ形式に変換するものである。
The first conversion means 2 takes out the compressed data from the storage means 1 and converts the two-dimensionally encoded compressed data into a run-length data format while referring to information in a line buffer 4 described later. It is.

【0028】第2の変換手段3は、ランレングス形式の
データを第1の変換手段2から取得し、ビットマップに
変換するものである。
The second conversion means 3 acquires run-length data from the first conversion means 2 and converts it into a bitmap.

【0029】ラインバッファ4は、第1の変換手段2に
おいて圧縮データをランレングスデータ形式に変換する
ために必要となる、参照スキャンラインの情報を保持す
る。
The line buffer 4 holds reference scan line information required for the first conversion means 2 to convert the compressed data into the run-length data format.

【0030】図2にラインバッファ4に保持される参照
スキャンラインの情報の形式を示す。ラインバッファ4
に保持される参照スキャンラインは、図2の(a)に示
すように、ひとつながりの白と黒のかたまりの長さ(こ
れをランレングスと呼ぶ)を複数個用いたランリスト形
式か、図2の(b)に示すように、白と黒のビットマッ
プとして表すビットマップデータ形式で格納される。図
2(a)のランリスト形式のラインバッファに示すW4
は白画素が4、B7は黒画素が7連続することを示す。
図2(b)に示すラインバッファにおいて、0は白画
素、1は黒画素を示す。
FIG. 2 shows a format of the information of the reference scan line held in the line buffer 4. Line buffer 4
The reference scan line held in the table is, as shown in FIG. 2A, a run list format using a plurality of continuous black and white block lengths (referred to as run lengths). As shown in FIG. 2B, the data is stored in a bitmap data format represented as a white and black bitmap. W4 shown in the run list format line buffer of FIG.
Indicates that there are 4 white pixels, and B7 indicates that there are 7 continuous black pixels.
In the line buffer shown in FIG. 2B, 0 indicates a white pixel and 1 indicates a black pixel.

【0031】ラインバッファ制御手段5は、ラインバッ
ファ4中にどのデータ形式、すなわち図2(a)に示す
ランリスト方式か、または図2(b)に示すビットマッ
プ方式のいずれの形式を用いてデータをラインバッファ
4に格納するかを制御する。格納するデータ形式の決定
は、第1の変換手段2にあるランレングス形式、すなわ
ちランリスト方式のデータサイズを算出し、これとライ
ンバッファ4のサイズを比較した結果に基づいて行なわ
れる。すなわち、ランレングス形式のデータサイズがラ
インバッファ4のサイズを超えなければ図2(a)に示
すランリスト方式でデータを格納し、ランレングス形式
のデータサイズがラインバッファ4のサイズを超える場
合は、ビットマップ方式を用いてビットマップデータを
ラインバッファ4に格納する。
The line buffer control means 5 uses which data format in the line buffer 4, that is, either the run list system shown in FIG. 2A or the bit map system shown in FIG. It controls whether data is stored in the line buffer 4. The data format to be stored is determined based on the result of calculating the data size of the run length format, that is, the run list format in the first conversion means 2 and comparing the calculated data size with the size of the line buffer 4. In other words, if the data size in the run-length format does not exceed the size of the line buffer 4, the data is stored in the run list format shown in FIG. 2A, and if the data size in the run-length format exceeds the size of the line buffer 4, The bitmap data is stored in the line buffer 4 using the bitmap method.

【0032】ここで、実施例1の画像伸長処理装置にお
けるデータ処理の流れを説明する前に、2次元符号化の
形式について説明する。ここでは、特にMH符号化方
式、MR符号化方式、MMR符号化方式の概要について
説明する。
Here, before describing the flow of data processing in the image decompression processing device of the first embodiment, the format of two-dimensional encoding will be described. Here, the outlines of the MH coding method, the MR coding method, and the MMR coding method will be particularly described.

【0033】1)MH符号化方式 MH符号化方式は2次元符号化ではなく1次元符号化で
あるが、後述するMR符号化方式やMMR符号化方式の
基礎となる符号化方式であるのでここに示す。MH符号
化方式では、すべてのスキャンラインのデータを1次元
符号化圧縮する。図3に示すように、1スキャンライン
の圧縮データは先頭に付加されるEOL(End Of
Line)符号とその後に続くデータ符号から構成さ
れる。そして、1ページの最終行の後は6つの連続する
EOL符号からなるRTC符号が付加される。
1) MH coding method Although the MH coding method is not two-dimensional coding but one-dimensional coding, it is a coding method which is the basis of the MR coding method and the MMR coding method described later. Shown in In the MH encoding method, data of all scan lines is one-dimensionally encoded and compressed. As shown in FIG. 3, the compressed data of one scan line is added at the beginning of EOL (End Of).
Line) code and a data code following the code. After the last line of one page, an RTC code composed of six consecutive EOL codes is added.

【0034】ここで、EOL符号は「00000000
0001」で表わされる12ビットの符号である。ま
た、1スキャンラインの符号ビット数が予め定められた
ビット長Tよりも短い場合には、最小符号ビット数の条
件を満たすためにデータ符号の後に可変長の「0」が付
加される。
Here, the EOL code is “00000000”.
0001 "is a 12-bit code. If the number of code bits in one scan line is shorter than a predetermined bit length T, a variable length “0” is added after the data code to satisfy the condition of the minimum code bit number.

【0035】図4にMH符号化におけるデータ符号を示
す。データ符号は白または黒のランレングスを示す可変
長符号であり、白ランと黒ランが交互に発生する。な
お、スキャンラインの先頭は白のランから開始し、先頭
ピクセルが黒の場合は白0ピクセルを示す符号が用いら
れる。データ符号には、ランレングスが63以下の場合
は一つのターミネイト符号が用いられる。ランレングス
が64以上の場合はランレングスを64で割った商を表
わすメークアップ符号と、ランレングスの64の剰余を
表わすターミネイト符号が用いられる。メークアップ符
号、ターミネイト符号それぞれの符号を図5〜7に示
す。
FIG. 4 shows data codes in MH coding. The data code is a variable length code indicating a white or black run length, and white runs and black runs alternately occur. It should be noted that the head of the scan line starts from a white run, and when the head pixel is black, a code indicating a white 0 pixel is used. When the run length is 63 or less, one terminating code is used as the data code. When the run length is 64 or more, a makeup code representing a quotient obtained by dividing the run length by 64 and a terminating code representing a remainder of 64 of the run length are used. FIGS. 5 to 7 show the makeup code and the terminating code.

【0036】2)MR符号化方式 MR符号化方式では、1本のスキャンラインを1次元符
号化圧縮した後に1または3本の連続したスキャンライ
ンを2次元符号化圧縮する。2次元符号化においては、
現在符号化しているスキャンラインの直前のスキャンラ
インを参照して、この参照スキャンラインと符号化スキ
ャンラインの変化画素(黒から白または白から黒へ変化
する画素)の位置関係を符号化する。符号化に当たって
は以下に示す変化画素を定義する。
2) MR encoding method In the MR encoding method, one or three continuous scan lines are two-dimensionally encoded and compressed after one scan line is one-dimensionally encoded and compressed. In two-dimensional encoding,
With reference to the scan line immediately before the scan line currently being encoded, the positional relationship between the reference scan line and the changed pixel (the pixel that changes from black to white or from white to black) on the encoded scan line is encoded. In coding, the following changed pixels are defined.

【0037】 a0: 符号化スキャンラインの起点変化画素 a1: 符号化スキャンライン上のa0より右の最初の
変化画素 a2: 符号化スキャンライン上のa1より右の最初の
変化画素 b1: 参照スキャンライン上の変化画素のうち、a0
より右でa0と反対色の画素 b2: 参照スキャンライン上でb1より右の最初の変
化画素
A0: starting change pixel of the coded scan line a1: first change pixel on the coded scan line to the right of a0 a2: first change pixel on the coded scan line to the right of a1 b1: reference scan line Of the above change pixels, a0
A pixel to the right of the opposite color to a0 b2: The first changed pixel to the right of b1 on the reference scan line

【0038】そして、これらの変化画素の位置関係によ
って、次の3つの符号化モードの中から一つを選択す
る。これを図8に示す。
Then, one of the following three encoding modes is selected according to the positional relationship between these changed pixels. This is shown in FIG.

【0039】(1)パスモード a1の左側にb2がある場合はパスモードとなる。この
場合、図9に示すように「0001」に符号化される。
符号化後は新しいa0をb2の真下に設定する。
(1) Pass mode When b2 is on the left side of a1, the pass mode is set. In this case, it is encoded into "0001" as shown in FIG.
After encoding, a new a0 is set immediately below b2.

【0040】(2)垂直モード a1とb1の距離が3画素以内の場合は垂直モードとな
る。 a1とb1の相対距離により、V0,VR1,V
R2,VR3,VL1,VL2,VL3の7つの符号の
いずれかに符号化される。なお、VRnはa2がa1の
n画素右にあることを意味し、VLnはa2がa1のn
画素左にあることを意味する。符号化後は新しいa0を
a1の位置に設定する。
(2) Vertical mode When the distance between a1 and b1 is within 3 pixels, the mode is the vertical mode. According to the relative distance between a1 and b1, V0, VR1, V
R2, VR3, VL1, VL2, and VL3 are encoded into one of seven codes. Note that VRn means that a2 is to the right of n pixels of a1, and VLn is that a2 is n pixels of a1.
It means that it is to the left of the pixel. After encoding, a new a0 is set at the position of a1.

【0041】(3)水平モード a1とb1の距離が3画素より大きい場合は水平モード
となる。水平モードの場合、「001」に続いてa0と
a1の距離と色、a1とa2の距離と色をMH符号で表
わす。符号化後は新しいa0をa2の位置に設定する。
(3) Horizontal mode When the distance between a1 and b1 is larger than 3 pixels, the horizontal mode is set. In the case of the horizontal mode, the distance and the color between a0 and a1 and the distance and the color between a1 and a2 are represented by MH codes after "001". After the encoding, a new a0 is set at the position of a2.

【0042】なお、MR符号化では、1次元符号化と2
次元符号化が混在するので、EOL符号の後にタグビッ
トを設け、後続するスキャンラインが1次元符号化で符
号化されているか、2次元符号化で符号化されているか
を識別できるようにしている。
In MR coding, one-dimensional coding and 2
Since the dimensional coding is mixed, a tag bit is provided after the EOL code so that it is possible to identify whether the subsequent scan line is coded by one-dimensional coding or two-dimensional coding. .

【0043】3)MMR符号化方式 MMR符号化では、すべてのスキャンラインを2次元符
号化圧縮する。最初のスキャンラインを符号化するに
は、参照スキャンラインとして仮想的な全白ラインを設
定する。1ページの最終ラインの後には、RTC符号と
してEOL符号を連続して二つ付加し、その後に1ペー
ジ分の符号データのビット数が8ビットバウンダリとな
るように「0」を付加する。
3) MMR encoding method In MMR encoding, all scan lines are two-dimensionally encoded and compressed. To encode the first scan line, a virtual all-white line is set as a reference scan line. After the last line of one page, two EOL codes are successively added as the RTC code, and then “0” is added so that the number of bits of the code data for one page becomes an 8-bit boundary.

【0044】次に、実施例1の画像伸長処理装置におけ
る各モジュールの詳細を説明する。
Next, details of each module in the image decompression processing device of the first embodiment will be described.

【0045】まず、はじめに図1に示す構成における第
1の変換手段2について説明する。図10に第1の変換
手段2の詳細構成を示す。図10に示すように、第1の
変換手段2は、ハフマン復号部21と、ハフマンテーブ
ル22と、エッジ切りだし部23と、2次元復号部24
と、ランレングスデータ格納部25から構成される。
First, the first conversion means 2 in the configuration shown in FIG. 1 will be described. FIG. 10 shows a detailed configuration of the first conversion means 2. As shown in FIG. 10, the first conversion unit 2 includes a Huffman decoding unit 21, a Huffman table 22, an edge cutting unit 23, and a two-dimensional decoding unit 24.
And a run length data storage unit 25.

【0046】ハフマン復号部21は、記憶手段1に格納
されているMR圧縮データを取り出し、取り出したMR
圧縮データに基づいて、これをMRコードに変換する。
ここで、MRコードとは、白と黒のランレングス、また
は、水平モード、垂直モード、パスモード(図8参照)
を示すための固定長符号によって構成される。
The Huffman decoding section 21 extracts the MR compressed data stored in the storage means 1 and outputs the extracted MR data.
This is converted to an MR code based on the compressed data.
Here, the MR code is a white and black run length, or a horizontal mode, a vertical mode, and a pass mode (see FIG. 8).
Is constituted by a fixed-length code for indicating

【0047】MR圧縮データからMRコードの変換にあ
たっては、ハフマンテーブル22を参照し、一致したコ
ードを切り出すことによって行なわれる。ここで、ハフ
マンテーブル22は、図5〜7、および図9に示したテ
ーブルが格納されており、ハフマン復号部21はテーブ
ルの逆引きを行なうことで一致する符号を切り出す。
When the MR code is converted from the MR compressed data, a matching code is cut out with reference to the Huffman table 22. Here, the Huffman table 22 stores the tables shown in FIGS. 5 to 7 and FIG. 9, and the Huffman decoding unit 21 extracts a matching code by performing reverse lookup of the table.

【0048】エッジ切りだし部23は、ラインバッファ
4に格納されているデータがビットマップ形式の場合に
のみ使用される。エッジ切りだし部23は、ラインバッ
ファ4を左端からスキャンし、画素の変化点を検出しラ
ンレングスを出力する。すなわち、ビットマップ形式か
らランレングスデータ形式の変換処理を行なうものであ
る。
The edge cutting section 23 is used only when the data stored in the line buffer 4 is in a bitmap format. The edge cutting unit 23 scans the line buffer 4 from the left end, detects a pixel change point, and outputs a run length. That is, conversion processing from a bitmap format to a run-length data format is performed.

【0049】2次元復号部24は、ハフマン復号部21
から出力されるMRコード、および、エッジ切りだし部
23もしくはラインバッファ4から取得するランレング
スデータをもとに、ハフマン復号部21から出力される
MRコードをランレングスデータに変換する。その結果
は、スキャンライン単位でランレングスデータ格納部2
5に格納される。以下に処理の流れを説明する。
The two-dimensional decoding unit 24 includes the Huffman decoding unit 21
Based on the MR code output from the Huffman decoding unit 21 and the run length data obtained from the edge cutout unit 23 or the line buffer 4, the MR code output from the Huffman decoding unit 21 is converted into run length data. The result is stored in the run-length data storage unit 2 in scan line units.
5 is stored. The processing flow will be described below.

【0050】2次元復号部24は、ラインバッファ4の
フラグ、すなわちラインバッファ4に格納されているデ
ータがランレングスデータかビットマップデータかを示
すフラグを読み出すことによってラインバッファ4に格
納された参照スキャンライン情報がランレングスデータ
かビットマップデータのいずれであるかを判断する。
The two-dimensional decoding unit 24 reads the flag of the line buffer 4, that is, the flag indicating whether the data stored in the line buffer 4 is run-length data or bitmap data, and reads the flag stored in the line buffer 4. It is determined whether the scan line information is run-length data or bitmap data.

【0051】そして、2次元復号部24は、ラインバッ
ファ4に格納された参照スキャンライン情報がビットマ
ップデータの場合はエッジ切りだし部23において実行
される参照スキャンラインのビットマップ形式からラン
レングスデータ形式の変換処理の結果として得られる参
照スキャンラインのランレングスデータをエッジ切りだ
し部23を介して受け取る。
When the reference scan line information stored in the line buffer 4 is bitmap data, the two-dimensional decoding unit 24 converts the run length data from the bitmap format of the reference scanline executed in the edge cutout unit 23. The run-length data of the reference scan line obtained as a result of the format conversion processing is received via the edge cutout unit 23.

【0052】ラインバッファ4に格納された参照スキャ
ンライン情報がランレングスデータの場合は2次元復号
部24は、ラインバッファ4に直接要求してランレング
スデータを取り出す。
When the reference scan line information stored in the line buffer 4 is run-length data, the two-dimensional decoding unit 24 directly requests the line buffer 4 to extract the run-length data.

【0053】次に、2次元復号部24は、ハフマン復号
部21によって切り出されたMRコードの復号を、読み
出された参照スキャンライン情報としての参照ランレン
グスデータを参照して実行し、ランレングスデータの出
力を行う。
Next, the two-dimensional decoding unit 24 executes decoding of the MR code cut out by the Huffman decoding unit 21 with reference to the read reference run length data as the read reference scan line information, and executes the run length. Output data.

【0054】以下、MRコード別にランレングスデータ
の出力処理について説明する。以下に示す式中、run
は出力するランレングス、p_run(n)は参照スキ
ャンラインのn番目のランレングスである。
The output processing of run-length data for each MR code will be described below. In the following formula, run
Is the output run length, and p_run (n) is the n-th run length of the reference scan line.

【0055】(1)パスモード、すなわち図8(a)に
示すようにな参照スキャンラインと符号化スキャンライ
ンとの対応がある場合のランレングスデータの出力処
理。
(1) Pass mode, that is, output processing of run-length data when there is a correspondence between a reference scan line and an encoded scan line as shown in FIG.

【0056】[0056]

【数1】 (Equation 1)

【0057】なお、式(1)は次に出力すべきランの色
と参照スキャンラインの先頭のランの色が同じである場
合、式(2)は違う場合である。
Expression (1) is a case where the color of the run to be output next is the same as the color of the first run of the reference scan line, and expression (2) is a case where the color is different.

【0058】2)垂直モード、すなわち図8(b)に示
すようにな参照スキャンラインと符号化スキャンライン
との対応がある場合のランレングスデータの出力処理。
2) Output processing of run-length data in the vertical mode, that is, when there is a correspondence between a reference scan line and an encoded scan line as shown in FIG.

【0059】[0059]

【数2】 (Equation 2)

【0060】なお、式(3)は次に出力すべきランの色
と参照スキャンラインの先頭のランの色が同じである場
合、式(4)は違う場合である。なお、distは[表
1]に示した数値を用いる。
Expression (3) is the case where the color of the run to be output next and the color of the first run of the reference scan line are the same, and Expression (4) is the case where the color is different. Note that the dist uses the numerical values shown in [Table 1].

【0061】[0061]

【表1】 [Table 1]

【0062】3)水平モード 水平モードの場合、図9に示すように「001」に続く
2つのMRコードはランレングスデータであるので、こ
れらを伸長して出力する。
3) Horizontal Mode In the horizontal mode, the two MR codes following "001" are run-length data as shown in FIG. 9, and are expanded and output.

【0063】最後に、2次元復号部24は、ラインバッ
ファ4もしくはエッジ切りだし部23のランリストをア
ップデートする。ここでもMRコード別にアップデート
処理を説明する。
Finally, the two-dimensional decoding unit 24 updates the run list of the line buffer 4 or the edge cutting unit 23. Here, the update process will be described for each MR code.

【0064】1)パスモード 出力したランの色と参照スキャンラインの先頭のランの
色が同じである場合、参照スキャンラインのランリスト
から先頭2つのランを削除する。ランの色が違う場合、
ランリストから先頭3つのランを削除する。
1) Pass Mode If the output run color is the same as the first run color of the reference scan line, the first two runs are deleted from the reference scan line run list. If the color of the run is different,
Delete the first three runs from the run list.

【0065】2)垂直モード(VL) 出力したランの色と参照スキャンラインの先頭のランの
色が同じである場合、参照スキャンラインの先頭のラン
長をdistの絶対値に変更する。ランの色が違う場
合、参照スキャンラインの先頭のランは削除、2番目の
ランのラン長をdistの絶対値に変更する。
2) Vertical Mode (VL) When the output run color is the same as the head run color of the reference scan line, the head run length of the reference scan line is changed to the absolute value of dist. If the colors of the runs are different, the first run of the reference scan line is deleted, and the run length of the second run is changed to the absolute value of dist.

【0066】3)垂直モード(V0) 出力したランの色と参照スキャンラインの先頭のランの
色が同じである場合、参照スキャンラインの先頭のラン
を削除する。ランの色が違う場合、先頭と2番目のラン
長をdistの絶対値に変更する。
3) Vertical mode (V0) When the output run color is the same as the head run color of the reference scan line, the head run of the reference scan line is deleted. If the colors of the runs are different, the first and second run lengths are changed to the absolute value of dist.

【0067】4)垂直モード(VR) 出力したランの色と参照スキャンラインの先頭のランの
色が同じである場合、参照スキャンラインの先頭のラン
を削除し、2番目のランのラン長をdistの絶対値分
減少させる。ランの色が違う場合、参照スキャンライン
の先頭と2番目のランは削除、3番目のランのラン長を
distの絶対値分減少させる。
4) Vertical Mode (VR) When the output run color is the same as the first run color of the reference scan line, the first run of the reference scan line is deleted, and the run length of the second run is changed. Decrease by the absolute value of dist. If the colors of the runs are different, the head of the reference scan line and the second run are deleted, and the run length of the third run is reduced by the absolute value of dist.

【0068】5)水平モード 参照スキャンラインのランリストから、出力したラン2
つの合計長分を削除、あるいは変更する。すなわち、出
力したランのラン長が7、3であり、参照スキャンライ
ンのランリストのラン長が先頭から3、4、5であれ
ば、ラン長3、4のランは削除、5のランは3に変更す
る。
5) Horizontal mode Run 2 output from the run list of the reference scan line
Delete or change one total length. That is, if the run length of the output run is 7, 3 and the run length of the run list of the reference scan line is 3, 4, 5 from the beginning, the run of run length 3, 4 is deleted, and the run of 5 is Change to 3.

【0069】ランレングスデータ格納部25は、ランレ
ングスデータを格納するとともに、ランレングスデータ
のサイズをラインバッファ制御手段5に通知する。ま
た、ラインバッファ制御手段5、第2の変換手段3のリ
クエストにしたがって、これらのモジュールにランレン
グスデータを出力する。
The run length data storage unit 25 stores the run length data and notifies the line buffer control means 5 of the size of the run length data. In addition, according to the requests from the line buffer control means 5 and the second conversion means 3, it outputs run-length data to these modules.

【0070】次に、ラインバッファ制御手段5について
説明する。図11にラインバッファ制御手段5の構成を
示す。ラインバッファ制御手段5は、データ形式判定部
51と、データ取得部52と、データ書き込み部53と
から構成される。
Next, the line buffer control means 5 will be described. FIG. 11 shows the configuration of the line buffer control means 5. The line buffer control unit 5 includes a data format determination unit 51, a data acquisition unit 52, and a data writing unit 53.

【0071】データ形式判定部51は、第1の変換手段
2(図1,10参照)からランレングスデータのサイズ
を取得し、それをラインバッファのサイズと比較するこ
とによって、ラインバッファ4に格納する際に使用する
データ形式を決定する。ここで、使用されるデータ形式
は、図2で示すようなランレングス形式またはビットマ
ップ形式とする。データ形式判定部51によって決定さ
れたデータ形式は、データ取得部52と、データ書き込
み部53と、第2の変換手段3に通知される。
The data format judging section 51 obtains the size of the run-length data from the first conversion means 2 (see FIGS. 1 and 10), compares it with the size of the line buffer, and stores it in the line buffer 4. Determine the data format to use when doing Here, the data format used is a run-length format or a bitmap format as shown in FIG. The data format determined by the data format determination unit 51 is notified to the data acquisition unit 52, the data writing unit 53, and the second conversion unit 3.

【0072】ラインバッファ制御手段5におけるランレ
ングスデータのデータサイズとラインバッファ4のサイ
ズを比較を行なうために必要となるランレングスデータ
のデータサイズdatasizeは、以下の式をもって
算出する。
The data size datasize of the run-length data required for comparing the data size of the run-length data in the line buffer control means 5 with the size of the line buffer 4 is calculated by the following equation.

【0073】[0073]

【数3】 (Equation 3)

【0074】ここで、runbitはランレングスを表
現するときに必要となるビット数であり、画像の横幅の
最大長がWのときは、1+log2(W)を下回らない
整数となる。なお、先頭の1ビットは白あるいは黒を示
すために必要となるビットである。すなわち、Wが25
6のときは、runbitは9ビットとなる。したがっ
て、ラインバッファ4のサイズとして画像の最大の横幅
Wと等しい256ビットを採用した場合、runcou
ntが28以下のときにランレングスデータサイズはラ
インバッファサイズを下回り、ラインバッファに収容可
能となる。
Here, runbit is the number of bits required to represent the run length. When the maximum width of the image is W, it is an integer not less than 1 + log2 (W). The first bit is a bit necessary to indicate white or black. That is, W is 25
In the case of 6, runbit has 9 bits. Therefore, when 256 bits equal to the maximum width W of the image are adopted as the size of the line buffer 4, runcu
When nt is 28 or less, the run length data size is smaller than the line buffer size, and can be accommodated in the line buffer.

【0075】ランレングスデータの方がラインバッファ
4よりも小さければ、ラインバッファの格納形式として
ランレングス形式が採用され、ラインバッファ制御手段
5はこのランレングスデータをラインバッファ4に格納
する。この格納時に、ラインバッファ制御手段5は、ラ
ンレングスデータで格納したことを示すフラグをライン
バッファにセットする。
If the run-length data is smaller than the line buffer 4, the run-length format is adopted as the storage format of the line buffer, and the line buffer control means 5 stores the run-length data in the line buffer 4. At the time of this storage, the line buffer control means 5 sets a flag indicating that the data is stored as run-length data in the line buffer.

【0076】ランレングスデータの方がラインバッファ
4よりも大きければ、このランレングスデータはライン
バッファに格納不可能であるため、ラインバッファの格
納形式としてビットマップ形式が採用される。
If the run-length data is larger than the line buffer 4, the run-length data cannot be stored in the line buffer. Therefore, a bitmap format is adopted as the storage format of the line buffer.

【0077】このとき、ラインバッファ4に格納するビ
ットマップデータは、第2の変換手段3の生成したビッ
トマップデータである。すなわち、第1の変換手段2が
生成したランレングスデータを第2の変換手段3が受領
し、第2の変換手段3が受領したランレングスデータか
らビットマップデータへの変換処理を行なった結果とし
て得られるビットマップデータをラインバッファ制御手
段5が取得してラインバッファ4に格納する。この格納
時に、ラインバッファ制御手段5はビットマップデータ
形式で格納したことを示すフラグをラインバッファ4に
セットする。
At this time, the bitmap data stored in the line buffer 4 is the bitmap data generated by the second conversion means 3. That is, as a result of receiving the run-length data generated by the first conversion means 2 by the second conversion means 3 and performing a conversion process from the received run-length data to bitmap data by the second conversion means 3 The obtained bitmap data is acquired by the line buffer control means 5 and stored in the line buffer 4. At the time of this storage, the line buffer control means 5 sets a flag indicating that the data is stored in the bitmap data format in the line buffer 4.

【0078】データ取得部52は、データ形式判定部5
1から通知されるデータ形式にしたがって、ラインバッ
ファ4に格納する1スキャンライン分のデータを選択し
て取得する。すなわち、上述のように格納するデータ形
式がランレングス形式の場合は、第1の変換手段2か
ら、より詳しくは第1の変換手段2のランレングスデー
タ格納部25からランレングスデータを取得し格納す
る。また、格納するデータ形式がビットマップ形式の場
合は、第2の変換手段3(図1参照)からビットマップ
データを取得する。
The data acquisition section 52 is provided with a data format determination section 5
According to the data format notified from 1, data of one scan line to be stored in the line buffer 4 is selected and acquired. That is, when the data format to be stored is the run-length format as described above, the run-length data is acquired from the first conversion unit 2, more specifically, from the run-length data storage unit 25 of the first conversion unit 2, and stored. I do. When the data format to be stored is the bitmap format, the bitmap data is acquired from the second conversion unit 3 (see FIG. 1).

【0079】データ書き込み部53は、データ取得部5
2によって取得されたデータを、ラインバッファに書き
込む。また、データ形式を示すフラグ情報をラインバッ
ファに書き込む。このフラグ情報は、前述のとおり、第
1の変換手段2、より詳しくは2次元復号部24によっ
て読み出される。
The data writing unit 53 includes the data acquisition unit 5
Write the data obtained in step 2 to the line buffer. Further, flag information indicating the data format is written to the line buffer. As described above, this flag information is read by the first conversion means 2, more specifically, the two-dimensional decoding unit 24.

【0080】以上、各モジュールの構成を説明した。次
に、実施例1における処理の流れについて図12のフロ
ーチャートを用いて説明する。
The configuration of each module has been described above. Next, the flow of processing in the first embodiment will be described with reference to the flowchart in FIG.

【0081】まず、S101において、図示されない圧
縮手段においてMR圧縮されたデータがネットワークI
/Fなどを経由して記憶手段1に格納される。なお、こ
こでは圧縮される対象となる画像は二値画像であり、画
像サイズの横幅の最大値をWとする。ここではWを25
6ピクセルとする。フォントデータの場合は、プリンタ
の出力解像度を600dpiとすると、30ポイントま
での文字に相当する。
First, in S101, the data compressed by MR in the compression means (not shown) is
The data is stored in the storage unit 1 via / F or the like. Here, the image to be compressed is a binary image, and the maximum value of the horizontal width of the image size is W. Here W is 25
Assume 6 pixels. In the case of font data, if the output resolution of the printer is 600 dpi, it corresponds to characters up to 30 points.

【0082】次に、S102において、第1の変換手段
2は記憶手段1に格納されたMR圧縮を用いた圧縮デー
タの読み出しを行う。そして、図5〜7、および図9の
ハフマンテーブルの逆引きにより、MR圧縮データを切
りだしMRコードに変換する。これをEOLを検出する
まで行なう。そして、ラインバッファ、もしくはエッジ
切りだし部から読み出される参照スキャンラインの情報
と、このMRコードによってランレングスデータに変換
する。
Next, in S102, the first conversion means 2 reads out the compressed data stored in the storage means 1 using the MR compression. Then, the MR compressed data is cut out by reverse lookup of the Huffman table shown in FIGS. This is performed until EOL is detected. Then, the information is converted into run-length data by the information of the reference scan line read from the line buffer or the edge cutout unit and this MR code.

【0083】1スキャンライン分のMR圧縮データがラ
ンレングスデータに変換されたら、S103において、
ラインバッファ制御手段5は、ランレングスデータのデ
ータサイズとラインバッファ4のサイズを比較に基づい
てラインバッファに対する参照ラインデータとしての格
納形式を判定する。このランレングスデータのデータサ
イズとラインバッファ4のサイズ比較を行なうために、
まず、ランレングスデータのデータサイズ:datas
izeを以下の式をもって算出する。
When the MR compressed data for one scan line is converted into run-length data, in S103,
The line buffer control unit 5 determines the storage format of the line buffer as reference line data based on a comparison between the data size of the run-length data and the size of the line buffer 4. In order to compare the data size of the run length data with the size of the line buffer 4,
First, the data size of the run length data: datas
The size is calculated by the following equation.

【0084】[0084]

【数4】 (Equation 4)

【0085】上記式中、runbitはランレングスを
表現するときに必要となるビット数であり、画像の横幅
の最大長がWのときは、1+log2(W)を下回らな
い整数となる(先頭の1ビットは白あるいは黒を示すた
めに必要)。すなわち、Wが256のときは、runb
itは9ビットとなる。したがって、ラインバッファ4
のサイズとして画像の最大の横幅Wと等しい256ビッ
トを採用した場合、runcountが28以下のとき
にランレングスデータサイズはラインバッファサイズを
下回り、ラインバッファに収容可能となる。
In the above equation, runbit is the number of bits required to represent the run length. When the maximum width of the image is W, it is an integer not less than 1 + log2 (W) (the first 1). Bits are needed to indicate white or black). That is, when W is 256, runb
It has 9 bits. Therefore, line buffer 4
When 256 bits equal to the maximum width W of the image are adopted as the size of the image, when the runcount is 28 or less, the run length data size is smaller than the line buffer size and can be accommodated in the line buffer.

【0086】ランレングスデータの方がラインバッファ
4よりも小さければ、ラインバッファの格納形式として
ランレングス形式が採用される。S104において、ラ
インバッファ制御手段5はこのランレングスデータをラ
インバッファ4に格納する。この格納時に、ラインバッ
ファ制御手段5は、ランレングスデータで格納したこと
を示すフラグをラインバッファにセットする。そして、
第1の変換手段2はランレングスデータを第2の変換手
段3に出力し、S105において、第2の変換手段3は
ランレングスデータからビットマップデータへの変換を
行なう。
If the run length data is smaller than the line buffer 4, the run length format is adopted as the storage format of the line buffer. In S104, the line buffer control means 5 stores the run length data in the line buffer 4. At the time of this storage, the line buffer control means 5 sets a flag indicating that the data is stored as run-length data in the line buffer. And
The first conversion means 2 outputs the run-length data to the second conversion means 3, and in S105, the second conversion means 3 converts the run-length data into bitmap data.

【0087】ランレングスデータの方がラインバッファ
4よりも大きければ、このランレングスデータはライン
バッファに格納不可能であるため、ラインバッファの格
納形式としてビットマップ形式が採用される。このと
き、第1の変換手段2はランレングスデータを第2の変
換手段3に出力し、S106において、第2の変換手段
3はランレングスデータからビットマップデータへの変
換を行なう。S107において、ラインバッファ制御手
段5は、第2の変換手段3によってビットマップデータ
となったスキャンラインの情報を取得し、ラインバッフ
ァ4に格納する。この格納時に、ラインバッファ制御手
段5は、ビットマップデータで格納したことを示すフラ
グをラインバッファにセットする。
If the run-length data is larger than the line buffer 4, the run-length data cannot be stored in the line buffer. Therefore, the bit buffer format is adopted as the storage format of the line buffer. At this time, the first conversion means 2 outputs the run-length data to the second conversion means 3, and in S106, the second conversion means 3 converts the run-length data into bitmap data. In step S <b> 107, the line buffer control unit 5 acquires the scan line information that has been converted into the bitmap data by the second conversion unit 3, and stores the information in the line buffer 4. At the time of this storage, the line buffer control means 5 sets a flag indicating that the data is stored in the bitmap data in the line buffer.

【0088】S108において、今復号したスキャンラ
インが最終行であるかチェックを行なう。最終行でなけ
ればS102に戻り、同様のシーケンスをくりかえす。
最終行であれば終了する。
In S108, it is checked whether the decoded scan line is the last line. If it is not the last line, the process returns to S102, and the same sequence is repeated.
If the last line, end.

【0089】以上説明した通り、ランレングスデータサ
イズの方がラインバッファのサイズより小さいときはラ
ンレングスデータ形式でラインバッファに格納し、ラン
レングスデータサイズの方がラインバッファのサイズよ
り大きいときはビットマップデータ形式で格納すること
により、ランレングスデータ形式ではラインバッファに
格納できないようなスキャンラインに対してもラインバ
ッファに格納することを可能とし、さらには2次元符号
化圧縮されたデータの伸長を可能とする。
As described above, when the run-length data size is smaller than the line buffer size, the data is stored in the line buffer in the run-length data format. When the run-length data size is larger than the line buffer size, the bit length is stored. By storing data in the map data format, scan lines that cannot be stored in the line buffer in the run-length data format can be stored in the line buffer. Make it possible.

【0090】[実施例2(伸長処理装置)]次に、本発
明の画像伸長処理装置の第2の実施例について説明す
る。実施例2の基本構成を表わすブロック図は図1と同
一であるので、説明を省略する。
Embodiment 2 (Expansion Processing Apparatus) Next, a second embodiment of the image expansion processing apparatus of the present invention will be described. The block diagram showing the basic configuration of the second embodiment is the same as that of FIG.

【0091】次に、実施例2における各モジュールの詳
細を説明する。実施例1と異なる点についてのみ説明す
る。ここでは、第2の変換手段3’について説明する。
Next, details of each module in the second embodiment will be described. Only different points from the first embodiment will be described. Here, the second conversion unit 3 'will be described.

【0092】図13に第2の変換手段3’の構成を示
す。第2の変換手段3’は、ランレングス伸長部31
と、ビットマップ格納部32から構成される。
FIG. 13 shows the structure of the second conversion means 3 '. The second conversion unit 3 ′ includes a run-length extending unit 31.
And a bitmap storage unit 32.

【0093】ランレングス伸長部31は、第1の変換手
段2(図1、10参照)から受け取ったランレングスデ
ータをビットマップ変換するものであり、機能は実施例
1の第2の変換手段3の機能と同一である。ビットマッ
プ格納部32は、図示されない出力部にビットマップデ
ータを出力する前に1スキャンライン分のビットマップ
データを格納する機能を持つ。
The run-length decompression unit 31 converts the run-length data received from the first conversion unit 2 (see FIGS. 1 and 10) into a bit map, and has a function of the second conversion unit 3 of the first embodiment. Function is the same as The bitmap storage unit 32 has a function of storing bitmap data for one scan line before outputting the bitmap data to an output unit (not shown).

【0094】次に、実施例2における処理の流れについ
て図14のフローチャートを用いて説明する。まず、S
201において、図示されない圧縮手段においてMR圧
縮されたデータがネットワークI/Fなどを経由して記
憶手段1(図1参照)に格納される。なお、ここでは圧
縮される対象となる画像は二値画像であり、画像サイズ
の横幅の最大値をWとする。ここではWを256ピクセ
ルとする。フォントデータの場合は、プリンタの出力解
像度を600dpiとすると、30ポイントまでの文字
に相当する。
Next, the flow of processing in the second embodiment will be described with reference to the flowchart of FIG. First, S
At 201, data compressed by MR in a compression unit (not shown) is stored in the storage unit 1 (see FIG. 1) via a network I / F or the like. Here, the image to be compressed is a binary image, and the maximum value of the horizontal width of the image size is W. Here, W is 256 pixels. In the case of font data, if the output resolution of the printer is 600 dpi, it corresponds to characters up to 30 points.

【0095】次に、S202において、第1の変換手段
2は記憶手段1に格納されたMR圧縮を用いた圧縮デー
タの読み出しを行ない、図5〜7、および図9のハフマ
ンテーブルの逆引きにより、MRコード1符号分の切り
出しを行なう。そして、ラインバッファ、もしくはエッ
ジ切りだし部から読み出される参照スキャンラインの情
報を参照することによって、このMRコード1符号に対
応するランレングスデータに変換する。このランレング
スデータはS203においてランレングス格納部25
(図10参照)に格納されるとともに、第2の変換手段
3’(図13参照)に出力される。
Next, in S202, the first conversion means 2 reads out the compressed data stored in the storage means 1 using the MR compression, and performs reverse lookup of the Huffman table shown in FIGS. 5 to 7 and FIG. , One MR code is extracted. Then, by referring to the information of the reference scan line read from the line buffer or the edge cutout unit, the data is converted into run-length data corresponding to the MR code 1 code. This run length data is stored in the run length storage unit 25 in S203.
(See FIG. 10) and output to the second conversion means 3 '(see FIG. 13).

【0096】第2の変換手段3’はランレングスデータ
を受け取ると、S204において、ランレングスデータ
からビットマップデータへの変換処理を実行する。そし
て、S205において、生成されたビットマップデータ
はビットマップ格納部32によって格納される。このS
202からS205までのステップは、EOLが検出さ
れるまで1スキャンライン分くりかえして行なわれる。
Upon receiving the run-length data, the second conversion means 3 'executes a process of converting the run-length data into bitmap data in S204. Then, in S205, the generated bitmap data is stored by the bitmap storage unit 32. This S
The steps from 202 to S205 are repeated for one scan line until EOL is detected.

【0097】1スキャンライン分のMR圧縮データがビ
ットマップデータに変換されたら、S207において、
ラインバッファ制御手段5は、ランレングスデータのデ
ータサイズとラインバッファ4のサイズを比較に基づい
てラインバッファに対する参照ラインデータとしての格
納形式を判定する。このランレングスデータのデータサ
イズとラインバッファ4のサイズ比較を行なうために、
まず、ランレングスデータのデータサイズ:datas
izeを以下の式をもって算出する。
When the MR compressed data for one scan line is converted into bitmap data, in S207,
The line buffer control unit 5 determines the storage format of the line buffer as reference line data based on a comparison between the data size of the run-length data and the size of the line buffer 4. In order to compare the data size of the run length data with the size of the line buffer 4,
First, the data size of the run length data: datas
The size is calculated by the following equation.

【0098】[0098]

【数5】 (Equation 5)

【0099】ここで、runbitはランレングスを表
現するときに必要となるビット数であり、画像の横幅の
最大長がWのときは、1+log2(W)を下回らない
整数となる(先頭の1ビットは白あるいは黒を示すため
に必要)。すなわち、Wが256のときは、runbi
tは9ビットとなる。したがって、ラインバッファ4の
サイズとして画像の最大の横幅Wと等しい256ビット
を採用した場合、runcountが28以下のときに
ランレングスデータサイズはラインバッファサイズを下
回り、ラインバッファに収容可能となる。
Here, runbit is the number of bits required to represent the run length, and when the maximum width of the image is W, it is an integer not less than 1 + log2 (W) (the first one bit). Is needed to indicate white or black). That is, when W is 256, runbi
t has 9 bits. Therefore, when 256 bits equal to the maximum horizontal width W of the image are adopted as the size of the line buffer 4, when the runcount is 28 or less, the run length data size becomes smaller than the line buffer size and can be accommodated in the line buffer.

【0100】ランレングスデータの方がラインバッファ
4よりも小さければ、ラインバッファの格納形式として
ランレングス形式が採用される。S208において、ラ
インバッファ制御手段5は1スキャンライン分のランレ
ングスデータをランレングス格納部25から取り出し、
ラインバッファ4に格納する。この格納時に、ラインバ
ッファ制御手段5は、ランレングスデータで格納したこ
とを示すフラグをラインバッファにセットする。
If the run length data is smaller than the line buffer 4, the run length format is adopted as the storage format of the line buffer. In S208, the line buffer control unit 5 retrieves the run length data for one scan line from the run length storage unit 25,
The data is stored in the line buffer 4. At the time of this storage, the line buffer control means 5 sets a flag indicating that the data is stored as run-length data in the line buffer.

【0101】ランレングスデータの方がラインバッファ
4よりも大きければ、このランレングスデータはライン
バッファに格納不可能であるため、ラインバッファの格
納形式としてビットマップ形式が採用される。S209
において、ラインバッファ制御手段5は1スキャンライ
ン分のビットマップデータをビットマップ格納部32か
ら取り出し、ラインバッファ4に格納する。この格納時
に、ラインバッファ制御手段5は、ビットマップデータ
で格納したことを示すフラグをラインバッファにセット
する。
If the run-length data is larger than the line buffer 4, the run-length data cannot be stored in the line buffer, and the bit buffer format is adopted as the storage format of the line buffer. S209
In step (2), the line buffer control means 5 takes out the bit map data for one scan line from the bit map storage unit 32 and stores it in the line buffer 4. At the time of this storage, the line buffer control means 5 sets a flag indicating that the data is stored in the bitmap data in the line buffer.

【0102】次に第2の変換手段3’は、図示されない
出力部に1スキャンライン分のビットマップデータを出
力する。そして、S210において、今復号したスキャ
ンラインが最終行であるかチェックを行なう。最終行で
なければS202に戻り、同様のシーケンスをくりかえ
す。最終行であれば終了する。
Next, the second conversion means 3 'outputs bit map data for one scan line to an output unit (not shown). Then, in S210, it is checked whether the currently decoded scan line is the last line. If it is not the last line, the process returns to S202, and the same sequence is repeated. If the last line, end.

【0103】以上説明した通り、MR圧縮データのビッ
トマップへの変換時に1スキャンライン分のランレング
スデータとビットマップデータを一時格納しておき、ラ
ンレングスデータサイズの方がラインバッファのサイズ
より小さいときはランレングスデータ形式、ランレング
スデータサイズの方がラインバッファのサイズより大き
いときはビットマップデータ形式を用いてラインバッフ
ァに格納することにより、ランレングスデータ形式では
ラインバッファに格納できないようなスキャンラインに
対してもラインバッファに格納することを可能とし、さ
らには2次元符号化圧縮されたデータの伸長を可能とす
る。
As described above, when the MR compressed data is converted into the bitmap, the run length data and the bitmap data for one scan line are temporarily stored, and the run length data size is smaller than the line buffer size. When the run-length data format is larger than the line buffer size, the scan is performed using the bitmap data format and stored in the line buffer, so that the run-length data format cannot be stored in the line buffer. The line can be stored in the line buffer, and the two-dimensionally encoded and compressed data can be expanded.

【0104】以上、実施例1と実施例2の説明では、2
次元符号化圧縮にMR符号化方式を使用した場合を用い
た。なお、圧縮手段における2次元符号化圧縮として、
例えばMMR符号化方式を用いることも可能である。M
MR符号化方式ではMR符号化処理における二次元圧縮
の部分のみが行われる。従って、その詳細の説明につい
ては省略する。
As described above, in the description of the first embodiment and the second embodiment,
The case where the MR coding method was used for the dimensional coding compression was used. In addition, as two-dimensional encoding compression in the compression means,
For example, it is also possible to use the MMR coding method. M
In the MR encoding method, only the two-dimensional compression part in the MR encoding process is performed. Therefore, a detailed description thereof will be omitted.

【0105】なお、上述した本発明の伸長処理構成は、
例えばパーソナルコンピュータ、プリンタ、あるいは通
信手段を持つプリンタとしてのネットワーク接続型プリ
ンタ、CAD、スキャナ、あるいはファクシミリ装置等
において構成することができ、例えば、ファクシミリ装
置に本発明の伸長処理構成を適用することにより、2次
元符号化圧縮データの伸張を実時間で行うことが可能と
なり、高速、高画質のプリント処理が実現される。
Note that the decompression processing configuration of the present invention described above
For example, a personal computer, a printer, or a network-connected printer as a printer having communication means, a CAD, a scanner, or a facsimile machine, etc. This makes it possible to decompress the two-dimensionally encoded data in real time, thereby realizing high-speed, high-quality print processing.

【0106】[実施例3(圧縮処理装置)]次に本発明
の第3実施例として、画像圧縮処理装置すなわち符号化
処理を実行する装置について説明する。
[Third Embodiment (Compression Processing Apparatus)] Next, as a third embodiment of the present invention, an image compression processing apparatus, that is, an apparatus for executing an encoding process will be described.

【0107】図15に本発明の画像圧縮処理装置の構成
を示す。画像圧縮処理装置は、記憶手段61と、符号化
処理手段62と、ラインバッファ63と、ラインバッフ
ァ制御手段64とから構成されている。
FIG. 15 shows the configuration of an image compression processing apparatus according to the present invention. The image compression processing device includes a storage unit 61, an encoding processing unit 62, a line buffer 63, and a line buffer control unit 64.

【0108】記憶手段61は、ハードディスク等の記憶
装置、あるいは図示されていないネットワークI/Fな
どを経由して送られてくるデータを一時保持するための
ものである。
The storage means 61 is for temporarily storing data transmitted via a storage device such as a hard disk or a network I / F (not shown).

【0109】符号化処理手段62は、記憶手段61から
データを取り出し、後述するラインバッファ63の情報
を参照しながら、データ圧縮処理としての2次元符号化
処理を実行するものである。
The encoding processing means 62 fetches data from the storage means 61 and executes two-dimensional encoding processing as data compression processing while referring to information in a line buffer 63 described later.

【0110】ラインバッファ63は、符号化処理手段6
2においてデータを2次元符号化処理するために必要と
なる参照スキャンラインの情報を保持する。
The line buffer 63 is provided for the encoding processing means 6.
2 holds information on reference scan lines required for two-dimensionally encoding data.

【0111】ラインバッファ63に格納保持される参照
スキャンラインの情報の形式は、先に説明した図2に示
す形式である。すなわち、ラインバッファ63に保持さ
れる参照スキャンラインは、図2の(a)に示すよう
に、ひとつながりの白と黒のかたまりの長さ(これをラ
ンレングスと呼ぶ)を複数個用いたランリスト形式か、
図2の(b)に示すように、白と黒のビットマップとし
て表すビットマップデータ形式で格納される。
The format of the reference scan line information stored and held in the line buffer 63 is the format shown in FIG. 2 described above. In other words, as shown in FIG. 2A, the reference scan line held in the line buffer 63 is a run using a plurality of continuous white and black lump lengths (this is called a run length). List or
As shown in FIG. 2B, the data is stored in a bitmap data format represented as a black and white bitmap.

【0112】ラインバッファ制御手段64は、ラインバ
ッファ63中にどのデータ形式、すなわち図2(a)に
示すランリスト方式か、または図2(b)に示すビット
マップ方式のいずれの形式を用いてデータを格納するか
を制御する。格納データ形式の決定は、符号化処理手段
62において生成されるランレングスデータのサイズと
ラインバッファのサイズとを比較することによって行な
われる。すなわち、ランレングス形式のデータサイズが
ラインバッファ63のサイズを超えなければ図2(a)
に示すランリスト方式でデータを格納し、ランレングス
形式のデータサイズがラインバッファ63のサイズを超
える場合は、ビットマップ方式を用いてビットマップデ
ータをラインバッファ63に格納する。
The line buffer control means 64 uses any data format in the line buffer 63, that is, either the run list system shown in FIG. 2A or the bit map system shown in FIG. 2B. Controls whether data is stored. The storage data format is determined by comparing the size of the run-length data generated by the encoding processing means 62 with the size of the line buffer. That is, if the data size of the run-length format does not exceed the size of the line buffer 63, FIG.
When the data size in the run length format exceeds the size of the line buffer 63, the bitmap data is stored in the line buffer 63 using the bitmap method.

【0113】なお、実施例3におけるデータの符号化処
理は、実施例1において説明したMH符号化方式、MR
符号化方式、MMR符号化方式を用いて実現することが
できる。
The data encoding process according to the third embodiment is based on the MH encoding method described in the first embodiment and the MR encoding method.
It can be realized by using an encoding method and an MMR encoding method.

【0114】次に、実施例3の画像圧縮処理装置におけ
る符号化処理手段62の詳細を説明する。
Next, details of the encoding processing means 62 in the image compression processing apparatus of the third embodiment will be described.

【0115】図16に符号化処理手段62の構成を示
す。図16に示すように、符号化処理手段62は、ハフ
マン符号化部71と、テーブル格納部72と、ランレン
グスデータ格納部73と、2次元符号化部74と、エッ
ジ切りだし部75と、データ変換部76から構成され
る。
FIG. 16 shows the structure of the encoding processing means 62. As shown in FIG. 16, the encoding processing means 62 includes a Huffman encoding unit 71, a table storage unit 72, a run-length data storage unit 73, a two-dimensional encoding unit 74, an edge cutout unit 75, It comprises a data conversion unit 76.

【0116】ハフマン符号化部71は、記憶手段61に
格納されているデータを取り出し、取り出したデータに
基づいてハフマン符号化処理による圧縮を行なう。1ス
キャンラインの圧縮データは先頭に付加されるEOL
(End Of Line)符号とその後に続くデータ
符号から構成される。そして、1ページの最終行の後は
6つの連続するEOL符号からなるRTC符号が付加さ
れる。EOL符号は「000000000001」で表
わされる12ビットの符号である。また、1スキャンラ
インの符号ビット数が予め定められたビット長Tよりも
短い場合には、最小符号ビット数の条件を満たすために
データ符号の後に可変長の「0」が付加される。図4に
MH符号化におけるデータ符号を示す。データ符号は白
または黒のランレングスを示す可変長符号であり、白ラ
ンと黒ランが交互に発生する。なお、スキャンラインの
先頭は白のランから開始し、先頭ピクセルが黒の場合は
白0ピクセルを示す符号が用いられる。データ符号に
は、ランレングスが63以下の場合は図5に示す一つの
ターミネイト符号が用いられる。ランレングスが64以
上の場合は図6および図7に示すランレングスを64で
割った商を表わすメークアップ符号と、ランレングスの
64の剰余を表わすターミネイト符号が用いられる。
The Huffman encoding unit 71 extracts data stored in the storage unit 61 and performs compression by Huffman encoding based on the extracted data. EOL added to the beginning of compressed data of one scan line
(End Of Line) code and a data code following the code. After the last line of one page, an RTC code composed of six consecutive EOL codes is added. The EOL code is a 12-bit code represented by “0000000000001”. If the number of code bits in one scan line is shorter than a predetermined bit length T, a variable length “0” is added after the data code to satisfy the condition of the minimum code bit number. FIG. 4 shows data codes in MH coding. The data code is a variable length code indicating a white or black run length, and white runs and black runs alternately occur. It should be noted that the head of the scan line starts from a white run, and when the head pixel is black, a code indicating a white 0 pixel is used. When the run length is 63 or less, one terminating code shown in FIG. 5 is used as the data code. When the run length is 64 or more, a makeup code representing a quotient obtained by dividing the run length by 64 shown in FIGS. 6 and 7 and a terminating code representing a remainder of 64 of the run length are used.

【0117】テーブル格納部72には、図5〜7、およ
び図9に示したテーブルが格納されており、ハフマン復
号部21はテーブルを参照して符号を切り出す。
The tables shown in FIGS. 5 to 7 and 9 are stored in the table storage section 72, and the Huffman decoding section 21 cuts out codes by referring to the tables.

【0118】ランレングスデータ格納部73は、ハフマ
ン符号化部71において生成されたランレングスデータ
を一時格納する。
The run-length data storage 73 temporarily stores the run-length data generated by the Huffman encoder 71.

【0119】2次元符号化部74は、ハフマン符号化部
71においてスキャンラインを1次元符号化した後に1
または3本の連続したスキャンラインを2次元符号化す
る。2次元符号化部74における2次元符号化処理にお
いては、現在符号化しているスキャンラインの直前のス
キャンラインをラインバッファ63から取り出して参照
し、この参照スキャンラインと符号化スキャンラインの
変化画素(黒から白または白から黒へ変化する画素)の
位置関係を符号化する。符号化に当たっては以下に示す
変化画素を定義する。
After the two-dimensional encoding unit 74 performs one-dimensional encoding on the scan line in the Huffman encoding unit 71,
Alternatively, three consecutive scan lines are two-dimensionally encoded. In the two-dimensional encoding process in the two-dimensional encoding unit 74, the scan line immediately before the scan line currently being encoded is taken out from the line buffer 63 and referred to, and the reference scan line and the changed pixel of the encoded scan line ( The positional relationship between pixels that change from black to white or from white to black) is encoded. In coding, the following changed pixels are defined.

【0120】 a0: 符号化スキャンラインの起点変化画素 a1: 符号化スキャンライン上のa0より右の最初の
変化画素 a2: 符号化スキャンライン上のa1より右の最初の
変化画素 b1: 参照スキャンライン上の変化画素のうち、a0
より右でa0と反対色の画素 b2: 参照スキャンライン上でb1より右の最初の変
化画素
A0: Start-point change pixel of the coded scan line a1: First change pixel to the right of a0 on the coded scan line a2: First change pixel to the right of a1 on the coded scan line b1: Reference scan line Of the above change pixels, a0
A pixel to the right of the opposite color to a0 b2: The first changed pixel to the right of b1 on the reference scan line

【0121】そして、これらの変化画素の位置関係によ
って、次の3つの符号化モードの中から一つを選択す
る。これを図8に示す。
Then, one of the following three encoding modes is selected according to the positional relationship between these changed pixels. This is shown in FIG.

【0122】(a)パスモード a1の左側にb2がある場合はパスモードとなる。この
場合、図9に示すように「0001」に符号化される。
符号化後は新しいa0をb2の真下に設定する。
(A) Pass mode When b2 is on the left side of a1, the pass mode is set. In this case, it is encoded into "0001" as shown in FIG.
After encoding, a new a0 is set immediately below b2.

【0123】(b)垂直モード a1とb1の距離が3画素以内の場合は垂直モードとな
る。a1とb1の相対距離により、V0,VR1,VR
2,VR3,VL1,VL2,VL3の7つの符号のい
ずれかに符号化される。なお、VRnはa2がa1のn
画素右にあることを意味し、VLnはa2がa1のn画
素左にあることを意味する。符号化後は新しいa0をa
1の位置に設定する。
(B) Vertical mode When the distance between a1 and b1 is within 3 pixels, the mode is the vertical mode. According to the relative distance between a1 and b1, V0, VR1, VR
2, VR3, VL1, VL2, and VL3. Note that VRn is n in which a2 is a1.
VLn means that a2 is n pixels to the left of a1. After encoding, a
Set to position 1.

【0124】(c)水平モード a1とb1の距離が3画素より大きい場合は水平モード
となる。水平モードの場合、「001」に続いてa0と
a1の距離と色、a1とa2の距離と色をMH符号で表
わす。符号化後は新しいa0をa2の位置に設定する。
(C) Horizontal mode When the distance between a1 and b1 is larger than 3 pixels, the horizontal mode is set. In the case of the horizontal mode, the distance and the color between a0 and a1 and the distance and the color between a1 and a2 are represented by MH codes after "001". After the encoding, a new a0 is set at the position of a2.

【0125】なお、MR符号化では、1次元符号化と2
次元符号化が混在するので、EOL符号の後にタグビッ
トを設け、後続するスキャンラインが1次元符号化で符
号化されているか、2次元符号化で符号化されているか
を識別できるようにしている。
In MR encoding, one-dimensional encoding and 2
Since the dimensional coding is mixed, a tag bit is provided after the EOL code so that it is possible to identify whether the subsequent scan line is coded by one-dimensional coding or two-dimensional coding. .

【0126】なお、MMR符号化では、すべてのスキャ
ンラインを2次元符号化圧縮する。最初のスキャンライ
ンを符号化するには、参照スキャンラインとして仮想的
な全白ラインを設定する。1ページの最終ラインの後に
は、RTC符号としてEOL符号を連続して二つ付加
し、その後に1ページ分の符号データのビット数が8ビ
ットバウンダリとなるように「0」を付加する。
In the MMR encoding, all scan lines are two-dimensionally encoded and compressed. To encode the first scan line, a virtual all-white line is set as a reference scan line. After the last line of one page, two EOL codes are successively added as the RTC code, and then “0” is added so that the number of bits of the code data for one page becomes an 8-bit boundary.

【0127】エッジ切りだし部75は、ラインバッファ
63に格納されている参照データがビットマップ形式の
場合にのみ使用される。エッジ切りだし部75は、ライ
ンバッファ63を左端からスキャンし、画素の変化点を
検出しランレングスを出力する。すなわち、ビットマッ
プ形式からランレングスデータ形式の変換処理を行なう
ものである。
The edge extracting section 75 is used only when the reference data stored in the line buffer 63 is in the bitmap format. The edge cutout unit 75 scans the line buffer 63 from the left end, detects a pixel change point, and outputs a run length. That is, conversion processing from a bitmap format to a run-length data format is performed.

【0128】2次元符号化部74は、ラインバッファ6
3のフラグ、すなわちラインバッファ63に格納されて
いるデータがランレングスデータかビットマップデータ
かを示すフラグを読み出すことによってラインバッファ
63に格納された参照スキャンライン情報がランレング
スデータかビットマップデータのいずれであるかを判断
する。
The two-dimensional encoding unit 74 includes the line buffer 6
By reading the flag of No. 3, that is, the flag indicating whether the data stored in the line buffer 63 is the run-length data or the bitmap data, the reference scan line information stored in the line buffer 63 is changed to the run-length data or the bitmap data. Determine which one.

【0129】そして、2次元符号化部74は、ラインバ
ッファ63に格納された参照スキャンライン情報がビッ
トマップデータの場合はエッジ切りだし部75において
実行される参照スキャンラインのビットマップ形式から
ランレングスデータ形式の変換処理の結果として得られ
る参照スキャンラインのランレングスデータをエッジ切
りだし部75を介して受け取る。
When the reference scan line information stored in the line buffer 63 is bitmap data, the two-dimensional encoding unit 74 changes the run length from the bitmap format of the reference scanline executed in the edge extracting unit 75. The run-length data of the reference scan line obtained as a result of the data format conversion processing is received via the edge cutout unit 75.

【0130】ラインバッファ63に格納された参照スキ
ャンライン情報がランレングスデータの場合は2次元符
号化部74は、ラインバッファ63に直接要求してラン
レングスデータを取り出す。
When the reference scan line information stored in the line buffer 63 is run-length data, the two-dimensional encoding unit 74 directly requests the line buffer 63 to extract the run-length data.

【0131】2次元符号化部74は、ハフマン符号化部
71からランレングスデータ格納部73を介して出力さ
れる符号化すべきデータのランレングスデータ、およ
び、エッジ切りだし部75もしくはラインバッファ63
から取得する参照スキャンライン情報としてのランレン
グスデータをもとに、符号化すべきデータのランレング
スデータの2次元符号化処理を行なう。
The two-dimensional encoding unit 74 includes run-length data of data to be encoded, which is output from the Huffman encoding unit 71 via the run-length data storage unit 73, and the edge extraction unit 75 or the line buffer 63.
Performs two-dimensional encoding of run-length data of data to be encoded, based on the run-length data as reference scan line information acquired from.

【0132】ランレングスデータ格納部73は、符号化
すべきデータのランレングスデータを格納する。また、
ラインバッファ制御手段64、2次元符号化部74のリ
クエストにしたがって、これらのモジュールにランレン
グスデータを出力する。
The run-length data storage 73 stores run-length data of data to be encoded. Also,
In accordance with a request from the line buffer control unit 64 and the two-dimensional encoding unit 74, run-length data is output to these modules.

【0133】データ変換部76は、ランレングスデータ
格納部73に格納されたランレングスデータがラインバ
ッファ63のサイズより大の場合にランレングスデータ
からビットマップへの変換処理を行なう。データ変換部
76において生成されたビットマップデータはラインバ
ッファ63に格納される。
The data conversion section 76 converts the run-length data into a bitmap when the run-length data stored in the run-length data storage section 73 is larger than the size of the line buffer 63. The bitmap data generated by the data converter 76 is stored in the line buffer 63.

【0134】次に、ラインバッファ制御手段64につい
て説明する。図17にラインバッファ制御手段64の構
成を示す。ラインバッファ制御手段64は、データ形式
判定部81と、データ取得部82と、データ書き込み部
83とから構成される。
Next, the line buffer control means 64 will be described. FIG. 17 shows the configuration of the line buffer control means 64. The line buffer control unit 64 includes a data format determination unit 81, a data acquisition unit 82, and a data writing unit 83.

【0135】データ形式判定部81は、ハフマン符号化
部71(図16参照)からランレングスデータのサイズ
を取得し、それをラインバッファのサイズと比較するこ
とによって、ラインバッファ63に格納する際に使用す
るデータ形式を決定する。ここで、使用されるデータ形
式は、図2で示すようなランレングス形式またはビット
マップ形式とする。データ形式判定部81によって決定
されたデータ形式は、データ取得部82と、データ書き
込み部83に通知される。
The data format judging section 81 obtains the size of the run-length data from the Huffman coding section 71 (see FIG. 16), compares it with the size of the line buffer, and stores it in the line buffer 63. Decide which data format to use. Here, the data format used is a run-length format or a bitmap format as shown in FIG. The data format determined by the data format determination unit 81 is notified to the data acquisition unit 82 and the data writing unit 83.

【0136】ラインバッファ制御手段64におけるラン
レングスデータのデータサイズとラインバッファ63の
サイズを比較を行なうために必要となるランレングスデ
ータのデータサイズdatasizeは、以下の式をも
って算出する。
The data size datasize of the run-length data required to compare the data size of the run-length data in the line buffer control means 64 with the size of the line buffer 63 is calculated by the following equation.

【0137】[0137]

【数6】 (Equation 6)

【0138】ここで、runbitはランレングスを表
現するときに必要となるビット数であり、画像の横幅の
最大長がWのときは、1+log2(W)を下回らない
整数となる(先頭の1ビットは白あるいは黒を示すため
に必要)。すなわち、Wが256のときは、runbi
tは9ビットとなる。したがって、ラインバッファ63
のサイズとして画像の最大の横幅Wと等しい256ビッ
トを採用した場合、runcountが28以下のとき
にランレングスデータサイズはラインバッファサイズを
下回り、ラインバッファに収容可能となる。
Here, runbit is the number of bits required to represent the run length, and when the maximum width of the image is W, it is an integer not less than 1 + log2 (W) (the first one bit). Is needed to indicate white or black). That is, when W is 256, runbi
t has 9 bits. Therefore, the line buffer 63
When 256 bits equal to the maximum width W of the image are adopted as the size of the image, when the runcount is 28 or less, the run length data size is smaller than the line buffer size and can be accommodated in the line buffer.

【0139】ランレングスデータの方がラインバッファ
63よりも小さければ、ラインバッファの格納形式とし
てランレングス形式が採用され、ラインバッファ制御手
段64はこのランレングスデータをラインバッファ63
に格納する。この格納時に、ラインバッファ制御手段6
4は、ランレングスデータで格納したことを示すフラグ
をラインバッファにセットする。
If the run-length data is smaller than the line buffer 63, the run-length format is adopted as the storage format of the line buffer, and the line buffer controller 64 stores the run-length data in the line buffer 63.
To be stored. At the time of this storage, the line buffer control means 6
No. 4 sets a flag indicating that the data is stored as run-length data in the line buffer.

【0140】ランレングスデータの方がラインバッファ
63よりも大きければ、このランレングスデータはライ
ンバッファに格納不可能であるため、ラインバッファの
格納形式としてビットマップ形式が採用される。
If the run-length data is larger than the line buffer 63, the run-length data cannot be stored in the line buffer. Therefore, a bitmap format is adopted as the storage format of the line buffer.

【0141】このとき、ラインバッファ63に格納する
ビットマップデータは、データ変換部76の生成したビ
ットマップデータである。すなわち、ハフマン符号化部
71が生成したランレングスデータをランレングスデー
タ格納部73に格納し、これをデータ変換部76におい
て、ランレングスデータからビットマップデータへの変
換処理を行ない、この結果として得られるビットマップ
データをラインバッファ制御手段64が取得してライン
バッファ63に格納する。この格納時に、ラインバッフ
ァ制御手段64はビットマップデータ形式で格納したこ
とを示すフラグをラインバッファ63にセットする。
At this time, the bitmap data stored in the line buffer 63 is the bitmap data generated by the data conversion unit 76. That is, the run-length data generated by the Huffman encoding unit 71 is stored in the run-length data storage unit 73, and the data is converted in the data conversion unit 76 from the run-length data to bitmap data. The line buffer control means 64 acquires the bitmap data to be obtained and stores it in the line buffer 63. At the time of this storage, the line buffer control means 64 sets a flag indicating that the data is stored in the bitmap data format in the line buffer 63.

【0142】データ取得部82は、データ形式判定部8
1から通知されるデータ形式にしたがって、ラインバッ
ファ63に格納する1スキャンライン分のデータを選択
して取得する。すなわち、上述のように格納するデータ
形式がランレングス形式の場合は、ランレングス格納部
73からランレングスデータを取得し格納する。また、
格納するデータ形式がビットマップ形式の場合は、デー
タ変換部76からビットマップデータを取得する。
The data acquisition section 82 is provided with a data format determination section 8
In accordance with the data format notified from 1, data of one scan line stored in the line buffer 63 is selected and obtained. That is, when the data format to be stored is the run-length format as described above, the run-length data is acquired from the run-length storage unit 73 and stored. Also,
If the data format to be stored is the bitmap format, the bitmap data is obtained from the data conversion unit 76.

【0143】データ書き込み部83は、データ取得部8
2によって取得されたデータを、ラインバッファに書き
込む。また、データ形式を示すフラグ情報をラインバッ
ファに書き込む。このフラグ情報は、2次元符号化部7
4によって読み出される。
The data writing unit 83 is provided with the data acquisition unit 8
Write the data obtained in step 2 to the line buffer. Further, flag information indicating the data format is written to the line buffer. This flag information is stored in the two-dimensional encoding unit 7
4 is read.

【0144】以上、各モジュールの構成を説明した。次
に、実施例3における処理の流れについて図18および
図19のフローチャートを用いて説明する。
The configuration of each module has been described above. Next, the flow of processing in the third embodiment will be described with reference to the flowcharts in FIGS.

【0145】まず、図18のフローチャートを用いてラ
インバッファ63に対するデータ格納処理について説明
する。
First, data storage processing in the line buffer 63 will be described with reference to the flowchart of FIG.

【0146】まず、S301において、例えばネットワ
ークI/Fなどを経由して受信したデータを記憶手段6
1に格納する。なお、ここでは圧縮される対象となる画
像は二値画像であり、画像サイズの横幅の最大値をWと
する。ここではWを256ピクセルとする。フォントデ
ータの場合は、プリンタの出力解像度を600dpiと
すると、30ポイントまでの文字に相当する。
First, in S301, the data received via the network I / F, for example, is stored in the storage unit 6.
1 is stored. Here, the image to be compressed is a binary image, and the maximum value of the horizontal width of the image size is W. Here, W is 256 pixels. In the case of font data, if the output resolution of the printer is 600 dpi, it corresponds to characters up to 30 points.

【0147】次に、S302において、符号化処理手段
62におけるハフマン符号化部71がデータの位置次元
符号化処理を行なう。図5〜7、および図9のハフマン
テーブルを参照してランレングスデータに変換する。
Next, in S302, the Huffman encoding unit 71 in the encoding processing means 62 performs a data position dimension encoding process. It is converted to run-length data with reference to the Huffman tables of FIGS.

【0148】1スキャンライン分のデータがランレング
スデータに変換されたら、S303において、ラインバ
ッファ制御手段64は、ランレングスデータのデータサ
イズとラインバッファ63のサイズを比較して、該比較
に基づいてラインバッファ63に対する参照ラインデー
タとしての格納形式を判定する。このランレングスデー
タのデータサイズとラインバッファ63のサイズ比較を
行なうために、まず、ランレングスデータのデータサイ
ズ:datasizeを以下の式をもって算出する。
When the data for one scan line is converted into run-length data, in step S303, the line buffer control unit 64 compares the data size of the run-length data with the size of the line buffer 63, and based on the comparison. The storage format as reference line data in the line buffer 63 is determined. In order to compare the data size of the run length data with the size of the line buffer 63, first, the data size of the run length data: datasize is calculated by the following equation.

【0149】[0149]

【数7】 (Equation 7)

【0150】上記式中、runbitはランレングスを
表現するときに必要となるビット数であり、画像の横幅
の最大長がWのときは、1+log2(W)を下回らな
い整数となる。先頭の1ビットは白あるいは黒を示すた
めに必要となるビットである。
In the above equation, runbit is the number of bits required for expressing the run length. When the maximum width of the image is W, it is an integer not less than 1 + log2 (W). The first bit is a bit necessary to indicate white or black.

【0151】ランレングスデータの方がラインバッファ
63よりも小さければ、ラインバッファの格納形式とし
てランレングス形式が採用される。S304において、
ラインバッファ制御手段64はこのランレングスデータ
をラインバッファ63に格納する。この格納時に、ライ
ンバッファ制御手段64は、ランレングスデータで格納
したことを示すフラグをラインバッファにセットする。
If the run length data is smaller than the line buffer 63, the run length format is adopted as the storage format of the line buffer. In S304,
The line buffer control means 64 stores the run length data in the line buffer 63. At the time of this storage, the line buffer control means 64 sets a flag indicating that the data is stored as run-length data in the line buffer.

【0152】ランレングスデータの方がラインバッファ
63よりも大きければ、このランレングスデータはライ
ンバッファに格納不可能であるため、ラインバッファの
格納形式としてビットマップ形式が採用される。このと
き、ランレングスデータはランレングスデータ格納部7
3からデータ変換部76に出力され、S305におい
て、データ変換部76はランレングスデータからビット
マップデータへの変換を行なう。S306において、ラ
インバッファ制御手段64は、データ変換部76によっ
てビットマップデータとなったスキャンラインの情報を
取得し、ラインバッファ63に格納する。この格納時
に、ラインバッファ制御手段64は、ビットマップデー
タで格納したことを示すフラグをラインバッファにセッ
トする。
If the run-length data is larger than the line buffer 63, the run-length data cannot be stored in the line buffer. Therefore, a bitmap format is adopted as the storage format of the line buffer. At this time, the run length data is stored in the run length data storage unit 7.
3 to the data conversion unit 76, and in S305, the data conversion unit 76 converts the run-length data into bitmap data. In step S <b> 306, the line buffer control unit 64 acquires the information of the scan line that has become the bitmap data by the data conversion unit 76 and stores the information in the line buffer 63. At the time of this storage, the line buffer control means 64 sets a flag indicating that bitmap data has been stored in the line buffer.

【0153】S307において、今ラインバッファ63
に格納したスキャンラインが最終行であるかチェックを
行なう。最終行でなければS301に戻り、同様のシー
ケンスをくりかえす。最終行であれば終了する。
At S307, the current line buffer 63
It is checked whether the scan line stored in is the last line. If it is not the last line, the process returns to S301, and the same sequence is repeated. If the last line, end.

【0154】以上説明した通り、ランレングスデータサ
イズの方がラインバッファのサイズより小さいときはラ
ンレングスデータ形式でラインバッファに格納し、ラン
レングスデータサイズの方がラインバッファのサイズよ
り大きいときはビットマップデータ形式で格納すること
により、ランレングスデータ形式ではラインバッファに
格納できないようなスキャンラインに対してもラインバ
ッファに格納することを可能とし、さらには2次元符号
化処理を効率的に実行可能とする。
As described above, when the run-length data size is smaller than the line buffer size, the data is stored in the line buffer in the run-length data format. When the run-length data size is larger than the line buffer size, the bit is stored. By storing data in the map data format, scan lines that cannot be stored in the line buffer in the run-length data format can be stored in the line buffer, and two-dimensional encoding can be performed efficiently. And

【0155】次に図19のフローチャートを用いてライ
ンバッファ63から参照ラインデータを読み出して2次
元符号化処理を実行するフローについて説明する。
Next, a flow for reading reference line data from the line buffer 63 and executing a two-dimensional encoding process will be described with reference to the flowchart of FIG.

【0156】まず、ステップS401において、記憶手
段または図示されないネットワークI/Fなどを経由し
て受信したデータについてハフマン符号化部71におい
てEOL符号処理がなされる。続いて、ステップS40
2において2次元符号化処理において参照ラインとなる
データがラインバッファ63から読み出される。
First, in step S401, the data received via the storage means or the network I / F (not shown) is subjected to the EOL code processing in the Huffman coding section 71. Subsequently, step S40
In 2, data serving as a reference line in the two-dimensional encoding process is read from the line buffer 63.

【0157】次に、ステップS403において、ライン
バッファ63から読み出された参照ラインデータが、ラ
ンレングスリスト形式であるかビットマップ形式である
かを判定する。ビットマップ形式である場合、ステップ
S404において、ビットマップ形式からランレングス
データ形式の変換処理を行なう。ラインバッファ63に
格納されているデータがビットマップ形式の場合、エッ
ジ切りだし部75は、ラインバッファ63を左端からス
キャンし、画素の変化点を検出しランレングスを出力す
る。すなわち、ビットマップ形式からランレングスデー
タ形式の変換処理を行なう。
Next, in step S403, it is determined whether the reference line data read from the line buffer 63 is in a run-length list format or a bitmap format. If it is the bitmap format, in step S404, a conversion process from the bitmap format to the run-length data format is performed. When the data stored in the line buffer 63 is in the bitmap format, the edge cutout unit 75 scans the line buffer 63 from the left end, detects a pixel change point, and outputs a run length. That is, a conversion process from the bitmap format to the run-length data format is performed.

【0158】続いて、ステップS405において、符号
化処理対象であるデータのランレングスデータをランレ
ングスデータ格納部73から、2次元符号化部74に読
み出し、ステップS406において、参照ラインデータ
を参照して、ランレングスデータ格納部73から読み出
したデータの2次元符号化処理を行なう。
Subsequently, in step S405, the run-length data of the data to be encoded is read from the run-length data storage unit 73 to the two-dimensional encoding unit 74, and in step S406, the reference line data is referred to. , Two-dimensional encoding of the data read from the run-length data storage 73 is performed.

【0159】S407において、今符号化したスキャン
ラインが最終行であるかチェックを行なう。最終行でな
ければS401に戻り、同様のシーケンスをくりかえ
す。最終行であれば終了する。
In S407, it is checked whether the scan line just encoded is the last line. If it is not the last line, the process returns to S401, and the same sequence is repeated. If the last line, end.

【0160】以上説明した通り、本発明の画像圧縮処理
装置においては、ランレングスデータサイズの方がライ
ンバッファのサイズより小さいときはランレングスデー
タ形式でラインバッファに格納し、ランレングスデータ
サイズがラインバッファのサイズを超えるときはビット
マップデータ形式で格納し、これらのデータを参照デー
タとして使用した2次元符号化処理を実行することによ
り、ランレングスデータ形式ではラインバッファに格納
できないようなスキャンラインに対しても正確なデータ
をラインバッファに格納することが可能となり、符号化
処理においてより高精度の符号化が実現される。
As described above, in the image compression processing apparatus of the present invention, when the run-length data size is smaller than the line buffer size, the run-length data size is stored in the line buffer in the run-length data format. When the data exceeds the size of the buffer, the data is stored in a bitmap data format, and a two-dimensional encoding process using these data as reference data is executed. Even more accurate data can be stored in the line buffer, and higher-precision encoding is realized in the encoding process.

【0161】なお、上述した本発明のデータ圧縮処理構
成は、例えばパーソナルコンピュータ、プリンタ、ある
いは通信手段を持つプリンタとしてのネットワーク接続
型プリンタ、CAD、スキャナ、あるいはファクシミリ
装置等において構成することができる。
The above-described data compression processing configuration of the present invention can be implemented in, for example, a personal computer, a printer, a network-connected printer as a printer having communication means, a CAD, a scanner, a facsimile machine, or the like.

【0162】[0162]

【発明の効果】以上説明したように、本発明の画像伸長
処理装置および画像圧縮処理装置によれば、参照ライン
データを用いた2次元符号化処理、あるいはその復号処
理において、参照ラインとなる1スキャンラインのデー
タがランレングス形式ではラインバッファに格納できな
い場合に、ビットマップ形式によって格納する構成とす
ることによって、参照ラインデータを確実にラインバッ
ファに格納することが可能となるので、高精度の2次元
符号化圧縮処理または復号処理が可能となる。
As described above, according to the image decompression processing apparatus and the image compression processing apparatus of the present invention, in the two-dimensional encoding processing using the reference line data or the decoding processing thereof, one reference line is used. When the scan line data cannot be stored in the line buffer in the run-length format, by storing it in the bitmap format, the reference line data can be reliably stored in the line buffer. Two-dimensional encoding / compression processing or decoding processing can be performed.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の画像伸長処理装置の実施例を示すブロ
ック図である。
FIG. 1 is a block diagram showing an embodiment of an image decompression processing device according to the present invention.

【図2】本発明の装置におけるラインバッファへのデー
タ格納形式について説明する図である。
FIG. 2 is a diagram illustrating a data storage format in a line buffer in the device of the present invention.

【図3】MH符号化方式による1スキャンラインの圧縮
データの構成を示す図である。
FIG. 3 is a diagram illustrating a configuration of compressed data of one scan line according to the MH encoding method.

【図4】MH符号化方式におけるデータ符号を示す図で
ある。
FIG. 4 is a diagram showing a data code in the MH coding method.

【図5】MH符号化方式におけるターミネイト符号を示
す図である。
FIG. 5 is a diagram showing a terminating code in the MH encoding method.

【図6】MH符号化方式におけるメークアップ符号(そ
の1)を示す図である。
FIG. 6 is a diagram illustrating a make-up code (part 1) in the MH coding method.

【図7】MH符号化方式におけるメークアップ符号(そ
の2)を示す図である。
FIG. 7 is a diagram illustrating a make-up code (2) in the MH coding method.

【図8】MR符号化方式における3つのモードを示す図
である。
FIG. 8 is a diagram illustrating three modes in the MR encoding method.

【図9】MR符号化方式における3つのモードの変換コ
ードを示す図である。
FIG. 9 is a diagram showing conversion codes in three modes in the MR encoding method.

【図10】本発明の画像伸長処理装置の第1の変換手段
の詳細構成を示すブロック図である。
FIG. 10 is a block diagram showing a detailed configuration of a first conversion unit of the image decompression processing device of the present invention.

【図11】本発明の画像伸長処理装置のラインバッファ
制御手段の詳細構成を示すブロック図である。
FIG. 11 is a block diagram showing a detailed configuration of a line buffer control unit of the image decompression processing device of the present invention.

【図12】本発明の画像伸長処理装置の処理フローを示
す図である。
FIG. 12 is a diagram showing a processing flow of the image decompression processing device of the present invention.

【図13】本発明の画像伸長処理装置の実施例2におけ
る第2の変換手段の詳細構成を示すブロック図である。
FIG. 13 is a block diagram illustrating a detailed configuration of a second conversion unit in Embodiment 2 of the image decompression processing device of the present invention.

【図14】本発明の画像伸長処理装置の実施例2におけ
る処理フローを示す図である。
FIG. 14 is a diagram showing a processing flow in Embodiment 2 of the image decompression processing device of the present invention.

【図15】本発明の画像圧縮処理装置の実施例を示すブ
ロック図である。
FIG. 15 is a block diagram showing an embodiment of the image compression processing device of the present invention.

【図16】本発明の画像圧縮処理装置の符号化処理手段
の詳細構成を示すブロック図である。
FIG. 16 is a block diagram showing a detailed configuration of an encoding processing unit of the image compression processing device of the present invention.

【図17】本発明の画像圧縮処理装置のラインバッファ
制御手段の詳細構成を示すブロック図である。
FIG. 17 is a block diagram showing a detailed configuration of a line buffer control unit of the image compression processing device of the present invention.

【図18】本発明の画像圧縮処理装置のラインバッファ
に対するデータ格納処理を説明するフロー図である。
FIG. 18 is a flowchart illustrating data storage processing to a line buffer of the image compression processing device of the present invention.

【図19】本発明の画像圧縮処理装置の符号化処理を説
明するフロー図である。
FIG. 19 is a flowchart illustrating an encoding process of the image compression processing device of the present invention.

【符号の説明】[Explanation of symbols]

1 記憶手段 2 第1の変換手段 3 第2の変換手段 4 ラインバッファ 5 ラインバッファ制御手段 21 ハフマン復号部 22 ハフマンテーブル 23 エッジ切り出し部 24 2次元復号部 25 ランレングスデータ格納部 31 ランレングス伸長部 32 ビットマップ格納部 51 データ形式判定部 52 データ取得部 53 データ書き込み部 61 記憶手段 62 符号化処理手段 63 ラインバッファ 64 ラインバッファ制御手段 71 ハフマン符号化部 72 テーブル格納部 73 ランレングスデータ格納部 74 2次元符号化部 75 エッジ切り出し部 76 データ変換部 81 データ形式判定部 82 データ取得部 83 データ書き込み部 DESCRIPTION OF SYMBOLS 1 Storage means 2 1st conversion means 3 2nd conversion means 4 Line buffer 5 Line buffer control means 21 Huffman decoding part 22 Huffman table 23 Edge extraction part 24 Two-dimensional decoding part 25 Run length data storage part 31 Run length extension part 32 Bitmap storage unit 51 Data format determination unit 52 Data acquisition unit 53 Data writing unit 61 Storage unit 62 Encoding processing unit 63 Line buffer 64 Line buffer control unit 71 Huffman encoding unit 72 Table storage unit 73 Run-length data storage unit 74 Two-dimensional encoding unit 75 Edge extraction unit 76 Data conversion unit 81 Data format determination unit 82 Data acquisition unit 83 Data writing unit

フロントページの続き Fターム(参考) 5B057 CA02 CA06 CA12 CB02 CB06 CB12 CC01 CG04 CG10 DB02 DB05 DB08 5C059 KK35 MA00 ME05 SS11 UA02 UA05 UA32 5C078 AA01 BA26 BA27 CA12 CA27 CA31 DA00 DA02 DA05 DA06Continued on the front page F term (reference) 5B057 CA02 CA06 CA12 CB02 CB06 CB12 CC01 CG04 CG10 DB02 DB05 DB08 5C059 KK35 MA00 ME05 SS11 UA02 UA05 UA32 5C078 AA01 BA26 BA27 CA12 CA27 CA31 DA00 DA02 DA05 DA06

Claims (15)

【特許請求の範囲】[Claims] 【請求項1】2次元符号化によって圧縮された圧縮デー
タをビットマップデータに伸長する画像伸長処理装置に
おいて、 伸長を行なう2次元符号化圧縮データを一時格納する記
憶手段と、 前記記憶手段に格納された2次元符号化圧縮データから
ランレングスデータに変換する処理を実行する第1の変
換手段と、 前記第1の変換手段において生成されたランレングスデ
ータからビットマップデータに変換する実行する第2の
変換手段と、 1スキャンライン分のデータを参照スキャンラインデー
タとして保持するラインバッファと、 前記第1の変換手段において生成されたランレングスデ
ータからなるランレングスデータ形式、または前記第2
の変換手段において生成されたビットマップデータ形式
のいずれかのデータ形式を選択して1スキャンライン分
のデータを前記ラインバッファに書き込む制御を行なう
ラインバッファ制御手段とを有し、 前記第1の変換手段は、前記ラインバッファに格納され
た1スキャンライン分のデータを参照して、2次元符号
化圧縮データからランレングスデータへの変換処理を実
行するとともに、前記ラインバッファに格納された参照
スキャンラインデータがビットマップデータ形式である
場合にビットマップデータをランレングスデータに変換
する処理を実行する構成を有することを特徴とする画像
伸長処理装置。
1. An image decompression processing apparatus for decompressing compressed data compressed by two-dimensional encoding into bitmap data, comprising: storage means for temporarily storing two-dimensional encoded compressed data to be decompressed; First converting means for performing a process of converting the obtained two-dimensional encoded compressed data into run-length data; and a second performing of converting the run-length data generated by the first converting means into bitmap data. Conversion means, a line buffer for holding one scan line of data as reference scan line data, and a run-length data format comprising the run-length data generated by the first conversion means;
Line buffer control means for selecting one of the bit map data formats generated by the conversion means and writing data for one scan line into the line buffer. Means for performing a conversion process from the two-dimensional encoded compressed data to the run-length data with reference to the data for one scan line stored in the line buffer, and a reference scan line stored in the line buffer; An image decompression processing apparatus having a configuration for executing processing for converting bitmap data into run-length data when the data is in a bitmap data format.
【請求項2】前記ラインバッファ制御手段は、前記第1
の変換手段において生成されたランレングスデータ形式
の1スキャンライン分のデータサイズとラインバッファ
のサイズとの比較処理を実行し、 前記比較処理の結果、前記第1の変換手段において生成
されたランレングスデータ形式の1スキャンライン分の
データサイズが前記ラインバッファのサイズを上回った
場合、前記第2の変換手段において生成されたビットマ
ップデータ形式のビットマップデータを前記ラインバッ
ファに書き込み、 前記比較処理の結果、前記第1の変換手段において生成
されたランレングスデータ形式の1スキャンライン分の
データサイズが前記ラインバッファのサイズを上回らな
い場合、前記第1の変換手段において生成されたランレ
ングスデータを前記ラインバッファに書き込む処理を実
行する構成を有することを特徴とする請求項1に記載の
画像伸長処理装置。
2. The method according to claim 1, wherein said line buffer control means includes:
Performing a comparison process between the data size of one scan line in the run-length data format generated by the conversion unit and the size of the line buffer, and as a result of the comparison process, the run-length generated by the first conversion unit. When the data size of one scan line in the data format exceeds the size of the line buffer, the bitmap data in the bitmap data format generated by the second conversion means is written to the line buffer. As a result, if the data size of one scan line in the run-length data format generated by the first conversion means does not exceed the size of the line buffer, the run-length data generated by the first conversion means is converted to the run-length data. It has a configuration to execute the process of writing to the line buffer Image decompression apparatus according to claim 1, wherein the door.
【請求項3】前記ラインバッファ制御手段は、1スキャ
ンラインあたりに発生するランの数を計測することによ
って、前記第1の変換手段において生成されたランレン
グスデータ形式の1スキャンライン分のデータ量を計測
して、前記ラインバッファに格納するデータ形式を決定
する構成を有することを特徴とする請求項1または2に
記載の画像伸長処理装置。
3. The data amount for one scan line in the run length data format generated by the first conversion means by measuring the number of runs generated per scan line. The image decompression processing device according to claim 1, further comprising: a configuration for measuring a data format and determining a data format to be stored in the line buffer.
【請求項4】前記ラインバッファ制御手段は、前記ライ
ンバッファに格納するデータ形式が、ランレングスデー
タ形式であるかビットマップデータ形式であるかを示す
識別フラグを前記ラインバッファへのデータ格納時に併
せてセットする構成を有することを特徴とする請求項1
乃至3いずれかに記載の画像伸長処理装置。
4. The line buffer control means according to claim 1, further comprising: an identification flag indicating whether a data format stored in said line buffer is a run-length data format or a bitmap data format when data is stored in said line buffer. 2. The apparatus according to claim 1, further comprising:
4. The image decompression processing device according to any one of claims 1 to 3.
【請求項5】前記第1の変換手段は、前記ラインバッフ
ァに格納されたデータがビットマップデータ形式である
ことを前記識別フラグに基づいて検出した場合に、前記
ラインバッファに格納されたビットマップデータをラン
レングスデータに変換する処理を実行する構成を有する
ことを特徴とする請求項4に記載の画像伸長処理装置。
5. The apparatus according to claim 1, wherein said first converting means detects the data stored in said line buffer in a bitmap data format based on said identification flag. The image decompression processing apparatus according to claim 4, further comprising a configuration for executing processing for converting data into run-length data.
【請求項6】前記第2の変換手段は、該第2の変換手段
において生成したビットマップデータを一時的に保持す
るビットマップデータ格納部を有することを特徴とする
請求項1乃至5いずれかに記載の画像伸長処理装置。
6. The apparatus according to claim 1, wherein said second conversion means has a bitmap data storage for temporarily storing the bitmap data generated by said second conversion means. 5. The image decompression processing device according to 1.
【請求項7】前記2次元符号化圧縮データはモディファ
イドリード符号であることを特徴とする請求項1乃至6
いずれかに記載の画像伸長処理装置。
7. The method according to claim 1, wherein the two-dimensional encoded compressed data is a modified read code.
The image decompression processing device according to any one of the above.
【請求項8】前記2次元符号化圧縮データはモディファ
イドモディファイドリード符号であることを特徴とする
請求項1乃至6いずれかに記載の画像伸長処理装置。
8. An image decompression processing apparatus according to claim 1, wherein said two-dimensional encoded compressed data is a modified modified read code.
【請求項9】2次元符号化によって画像データの圧縮を
実行し2次元符号化圧縮データを生成する画像圧縮処理
装置において、 1スキャンライン分のデータを参照スキャンラインデー
タとして保持するラインバッファと、 ランレングスデータからなるランレングスデータ形式、
またはビットマップデータ形式のいずれかのデータ形式
を選択して1スキャンライン分のデータを前記ラインバ
ッファに書き込む制御を行なうラインバッファ制御手段
と、 前記ラインバッファに格納された1スキャンライン分の
データを参照して、2次元符号化処理を実行するととも
に、前記ラインバッファに格納された参照スキャンライ
ンデータがビットマップデータ形式である場合にビット
マップデータをランレングスデータに変換する処理を実
行する構成を有する符号化処理手段と、 を有することを特徴とする画像圧縮処理装置。
9. An image compression processing apparatus for compressing image data by two-dimensional encoding to generate two-dimensional encoded compressed data, comprising: a line buffer for holding data of one scan line as reference scan line data; Run-length data format consisting of run-length data,
A line buffer control means for selecting one of the bitmap data formats and writing data for one scan line to the line buffer; and for controlling the data for one scan line stored in the line buffer. Referring to FIG. 1, a configuration for executing a two-dimensional encoding process and executing a process of converting bitmap data into run-length data when the reference scan line data stored in the line buffer is in a bitmap data format. An image compression processing apparatus comprising:
【請求項10】前記ラインバッファ制御手段は、前記ラ
インバッファに格納予定のランレングスデータ形式の1
スキャンライン分のデータサイズとラインバッファのサ
イズとの比較処理を実行し、 前記比較処理の結果、前記ラインバッファに格納予定の
ランレングスデータ形式の1スキャンライン分のデータ
サイズが前記ラインバッファのサイズを上回った場合、
前記ラインバッファに格納予定のランレングスデータを
ビットマップデータ形式に変換して生成されるビットマ
ップデータを前記ラインバッファに書き込み、 前記比較処理の結果、前記ラインバッファに格納予定の
ランレングスデータ形式の1スキャンライン分のデータ
サイズが前記ラインバッファのサイズを上回らない場
合、前記ラインバッファに格納予定のランレングスデー
タを前記ラインバッファに書き込む処理を実行する構成
を有することを特徴とする請求項9に記載の画像圧縮処
理装置。
10. The line buffer control means according to claim 1, wherein said line buffer control means is a run-length data format to be stored in said line buffer.
A comparison process is performed between the data size of the scan line and the size of the line buffer. As a result of the comparison process, the data size of one scan line in the run-length data format to be stored in the line buffer is the size of the line buffer. Is exceeded,
The bitmap data generated by converting the run length data to be stored in the line buffer into a bitmap data format is written to the line buffer. As a result of the comparison processing, the run length data format to be stored in the line buffer is written. 10. The method according to claim 9, wherein when the data size of one scan line does not exceed the size of the line buffer, a process of writing run-length data to be stored in the line buffer to the line buffer is performed. The image compression processing apparatus according to any one of the preceding claims.
【請求項11】前記ラインバッファ制御手段は、1スキ
ャンラインあたりに発生するランの数を計測することに
よって、前記ラインバッファに格納予定のランレングス
データ形式の1スキャンライン分のデータ量を計測し
て、前記ラインバッファに格納するデータ形式を決定す
る構成を有することを特徴とする請求項9または10に
記載の画像圧縮処理装置。
11. The line buffer control means measures a data amount for one scan line in a run length data format to be stored in the line buffer by measuring the number of runs generated per scan line. The image compression processing apparatus according to claim 9, further comprising a configuration for determining a data format to be stored in the line buffer.
【請求項12】前記ラインバッファ制御手段は、前記ラ
インバッファに格納するデータ形式が、ランレングスデ
ータ形式であるかビットマップデータ形式であるかを示
す識別フラグを前記ラインバッファへのデータ格納時に
併せてセットする構成を有することを特徴とする請求項
9乃至11いずれかに記載の画像圧縮処理装置。
12. The line buffer control means according to claim 1, further comprising: an identification flag indicating whether a data format stored in said line buffer is a run-length data format or a bitmap data format, when data is stored in said line buffer. The image compression processing apparatus according to claim 9, wherein the image compression processing apparatus has a configuration in which the image compression processing is set.
【請求項13】前記符号化処理手段は、前記ラインバッ
ファに格納されたデータがビットマップデータ形式であ
ることを前記識別フラグに基づいて検出した場合に、前
記ラインバッファに格納されたビットマップデータをラ
ンレングスデータに変換する処理を実行する構成を有す
ることを特徴とする請求項12に記載の画像圧縮処理装
置。
13. When the encoding processing means detects that the data stored in the line buffer is in a bitmap data format based on the identification flag, the encoding processing means stores the bitmap data stored in the line buffer. 13. The image compression processing apparatus according to claim 12, wherein the apparatus has a configuration for executing a process of converting the image data into run-length data.
【請求項14】前記2次元符号化圧縮データはモディフ
ァイドリード符号であることを特徴とする請求項9乃至
13いずれかに記載の画像圧縮処理装置。
14. The image compression processing apparatus according to claim 9, wherein said two-dimensional encoded compressed data is a modified read code.
【請求項15】前記2次元符号化圧縮データはモディフ
ァイドモディファイドリード符号であることを特徴とす
る請求項9乃至13いずれかに記載の画像圧縮処理装
置。
15. The image compression processing apparatus according to claim 9, wherein said two-dimensional encoded compressed data is a modified modified read code.
JP24980499A 1999-09-03 1999-09-03 Picture expansion processing device and picture compression processing device Pending JP2001078042A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP24980499A JP2001078042A (en) 1999-09-03 1999-09-03 Picture expansion processing device and picture compression processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP24980499A JP2001078042A (en) 1999-09-03 1999-09-03 Picture expansion processing device and picture compression processing device

Publications (1)

Publication Number Publication Date
JP2001078042A true JP2001078042A (en) 2001-03-23

Family

ID=17198468

Family Applications (1)

Application Number Title Priority Date Filing Date
JP24980499A Pending JP2001078042A (en) 1999-09-03 1999-09-03 Picture expansion processing device and picture compression processing device

Country Status (1)

Country Link
JP (1) JP2001078042A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010103932A (en) * 2008-10-27 2010-05-06 Fuji Xerox Co Ltd Encoding device, decoding device and image processing system
JP2012070391A (en) * 2001-08-23 2012-04-05 Polycom Inc System and method for video error concealment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012070391A (en) * 2001-08-23 2012-04-05 Polycom Inc System and method for video error concealment
JP2010103932A (en) * 2008-10-27 2010-05-06 Fuji Xerox Co Ltd Encoding device, decoding device and image processing system

Similar Documents

Publication Publication Date Title
JP4366408B2 (en) Graphic image compression system and method
JP5432450B2 (en) Lossless color image data compression using entropy coding
KR101490215B1 (en) Image processing apparatus and processing method therefor
JP3461309B2 (en) Huffman coded data compression device
JP3278298B2 (en) Bitmap data compression method and compression apparatus
EP0902398B1 (en) Method and system for compressing and decompressing binary representations of dithered images
JP4164257B2 (en) Image processing apparatus, image processing method, program, and storage medium
US8320018B2 (en) Method and means for converting image data in encoded format
JPH10215379A (en) Image coder and image decoder
JP2001144969A (en) Compression method for raster data
JP3619025B2 (en) Encoding method and encoding apparatus
JP2002229759A (en) Code converting method for supporting image conversion
JP2001078042A (en) Picture expansion processing device and picture compression processing device
US8494261B2 (en) Image processing apparatus, image processing method, and computer-readable medium
JP4260908B2 (en) Run-length encoding method and image processing apparatus
JPH06113145A (en) Image processor
JP2000078415A (en) Image processing system, image compressing device and recording medium
JP5599033B2 (en) Image processing apparatus and method, and program
JPH08274947A (en) Image rotation method and image rotation device
JP2001217722A (en) Device and method for encoding information, and computer readable storage medium
KR900007566B1 (en) Picture data converting device
JP2002232701A (en) Image processor, image processing method, image processing program, and recording medium recording image processing program
JPH0774958A (en) Method and device for storing picture
JPH09200536A (en) Coder and decoder
JP2002326401A (en) Drawing processor and drawing processing method