JP2002223360A - Encoding device and method, decoding device and method, storage medium, printer driver and storage medium for storing the same - Google Patents

Encoding device and method, decoding device and method, storage medium, printer driver and storage medium for storing the same

Info

Publication number
JP2002223360A
JP2002223360A JP2001020684A JP2001020684A JP2002223360A JP 2002223360 A JP2002223360 A JP 2002223360A JP 2001020684 A JP2001020684 A JP 2001020684A JP 2001020684 A JP2001020684 A JP 2001020684A JP 2002223360 A JP2002223360 A JP 2002223360A
Authority
JP
Japan
Prior art keywords
code
pixel
encoding
data
decoding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP2001020684A
Other languages
Japanese (ja)
Inventor
Yoichi Sakamoto
陽一 坂本
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2001020684A priority Critical patent/JP2002223360A/en
Publication of JP2002223360A publication Critical patent/JP2002223360A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Record Information Processing For Printing (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

PROBLEM TO BE SOLVED: To reversibly encode a multi-level image with high compressibility or to efficiently decode this encoded multi-level image. SOLUTION: A printer driver 4 encodes multi-level image data based on print data indicated by a computer application and outputs the encoded multi- level image data to a printer 6 through a port driver 5. In this case, the printer driver 4 generates a code corresponding to the number of values of the preceding pixel which continues, a code corresponding to a difference value with respect to a previous pixel, and a code showing how many pieces of data that continue from the same position in a scan direction in the preceding line are used and outputs those codes.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、多値画像データを
圧縮するための符号化及びその符号を復号する復号化を
行う装置、方法、記憶媒体、並びにそれを適用したプリ
ンタドライバに関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an apparatus, a method, and a storage medium for performing encoding for compressing multivalued image data and decoding for decoding the code, and a printer driver to which the apparatus is applied. .

【0002】[0002]

【従来の技術】多値画像データを圧縮するには、JPE
Gのごとき非可逆圧縮を用いるのが一般的である。しか
し非可逆圧縮では原画像に近い画像が再現できるもの
の、原画像と同一の画像を再現することはできず、意図
しない画像が再現されることがある。また、JPEGの
ごとき非可逆圧縮では、高い圧縮率は得られるものの、
符号化における計算量が多く、ソフトウェアで符号化し
た場合に、符号化にかなりの時間を要する。また、ハー
ドウェアで復号した場合に復号器の規模も大きくなると
いう欠点がある。
2. Description of the Related Art To compress multi-valued image data, JPE
It is common to use lossy compression such as G. However, although lossy compression can reproduce an image close to the original image, the same image as the original image cannot be reproduced, and an unintended image may be reproduced. In a lossy compression such as JPEG, a high compression ratio can be obtained,
The amount of calculation in encoding is large, and when encoding with software, encoding requires a considerable amount of time. In addition, there is a disadvantage that the scale of the decoder becomes large when decoding is performed by hardware.

【0003】一方、可逆圧縮では、原画像と同一の画像
を再現することができるものの、高い圧縮率を達成する
ことが困難である。また、符号化に時間を要するという
欠点もある。
On the other hand, lossless compression can reproduce the same image as the original image, but it is difficult to achieve a high compression ratio. There is also a disadvantage that encoding requires time.

【0004】例えば可逆圧縮の一つとして、ランレング
ス符号を用いる方法がある.ランレングス符号は、同一
データが繰り返す場合に繰り返しの長さとデータを符号
化するものである。ランレングス符号は、ソフトウェア
によってかなり高速に符号化を行うことができるが、画
像データのように水平・垂直の両方向に相関がある場合
でも、水平方向の相関のみ圧縮に寄与し、垂直方向の相
関があっても圧縮に寄与しないため、高い圧縮率を得る
ことが困難である。
For example, as one of the lossless compression methods, there is a method using a run-length code. The run-length code is used to encode the repetition length and data when the same data repeats. Run-length codes can be encoded very quickly by software.However, even when image data has correlation in both horizontal and vertical directions, only horizontal correlation contributes to compression and vertical correlation However, it does not contribute to the compression even if it exists, so it is difficult to obtain a high compression ratio.

【0005】また、別の可逆圧縮としてデルタロウ符号
を用いる方法がある。デルタロウ符号は、直前のライン
と同じデータが続いている場合に、続いている長さを符
号化するものである。デルタロウ符号は、ソフトウェア
によってかなり高速に符号化を行うことができるが、画
像データのように水平・垂直の両方向に相関がある場合
でも、垂直方向の相関のみ圧縮に寄与し、水平方向の相
関があっても圧縮に寄与しないため、高い圧縮率を得る
ことが困難である。
[0005] As another reversible compression, there is a method using a delta row code. The delta row code encodes the length of the continuous data when the same data as the immediately preceding line continues. The Delta Row code can be encoded at a considerably high speed by software.However, even when there is a correlation in both the horizontal and vertical directions such as image data, only the vertical correlation contributes to the compression, and the horizontal correlation is reduced. Even if it does not contribute to compression, it is difficult to obtain a high compression ratio.

【0006】また、別の可逆圧縮としてハフマン符号を
用いる方法がある。ハフマン符号は、データの分布を調
べ、出現頻度の高いデータを短い符号に符号化するもの
である。ハフマン符号は画像データのように水平・垂直
の両方向に相関がある場合でも、どちらの方向の相関も
圧縮に寄与しないため、高い圧縮率を得ることが困難で
ある。
There is a method using Huffman codes as another reversible compression. The Huffman code checks the distribution of data and encodes data with a high frequency of appearance into a short code. Even when the Huffman code has a correlation in both the horizontal and vertical directions as in image data, it is difficult to obtain a high compression rate because the correlation in either direction does not contribute to compression.

【0007】そのほかにもLZ77符号、LZ78符
号、JBIG符号など様々な符号が考案されているが、
いずれも水平・垂直の相関が最も顕著である直左のデー
タ、および直上のデータ以外のデータを調べる必要があ
るため、符号化における計算量が多く、ソフトウェアで
符号化した場合に、符号化にかなりの時間を要し、ま
た、ハードウェアで復号した場合に復号器の規模も大き
くなるという欠点がある。
Various other codes such as LZ77 code, LZ78 code, JBIG code have been devised.
In both cases, it is necessary to examine the data other than the data immediately above and to the left of the horizontal and vertical correlations, so that the amount of calculation in the coding is large. It takes a considerable amount of time, and has the disadvantage that the size of the decoder increases when decoding is performed by hardware.

【0008】[0008]

【発明が解決しようとする課題】本発明は、多値画像を
高い圧縮率で可逆符号化し、または、この符号を効率良
く復号する符号化装置及び方法、復号装置及び方法、及
び記憶媒体、並びにプリンタドライバ及びそれを格納す
る記憶媒体を提供しようとするものである。
SUMMARY OF THE INVENTION The present invention provides an encoding apparatus and method, a decoding apparatus and method, a storage medium, and a storage medium for losslessly encoding a multi-valued image at a high compression rate or efficiently decoding this code. It is intended to provide a printer driver and a storage medium for storing the printer driver.

【0009】[0009]

【課題を解決するための手段】かかる課題を解決するた
め、例えば本発明の符号化装置は以下の構成を備える。
すなわち、出力対象の多値イメージデータを符号化する
符号化装置であって、直前の画素の値がいくつ連続する
かに応じた符号を発生する連続画素符号化手段と、直前
の画素に対する差分値に対応する符号を発生する差分値
符号化手段と、直前のライン中の走査方向に同じ位置か
ら連続するデータを幾つ用いるかを示す符号を発生する
前ライン参照符号化手段と、前記連続画素符号化手段、
前記差分値符号化手段、及び、前記前ライン参照符号化
手段を適応的に用いて生成した符号を出力する出力手段
とを備える。
In order to solve such a problem, for example, an encoding apparatus according to the present invention has the following arrangement.
That is, a coding apparatus for coding multivalued image data to be output, a continuous pixel coding means for generating a code corresponding to the number of consecutive values of the immediately preceding pixel, and a difference value with respect to the immediately preceding pixel. A difference value encoding means for generating a code corresponding to the preceding line; a previous line reference encoding means for generating a code indicating how many consecutive data are used from the same position in the scanning direction in the immediately preceding line; Means,
The image processing apparatus further includes an output unit that outputs a code generated by adaptively using the difference value encoding unit and the previous line reference encoding unit.

【0010】また本発明では復号にあたって、直前のラ
インを保持するラインバッファを用いて、直前のライン
の複写、直左のデータの繰り返し、あるいは直左のデー
タへの加算といった、単純な操作によって復号を行う。
In the present invention, decoding is performed by a simple operation such as copying the immediately preceding line, repeating the immediately preceding left data, or adding to the immediately preceding left data, using the line buffer holding the immediately preceding line. I do.

【0011】なお、本発明の好適な実施態様は、上記に
加えて、多値画像を圧縮する際の計算量を小さくし、ソ
フトウェアで符号化した場合に符号化に要する時間が小
さい符号化方法を提供することである。また別の態様の
目的は、符号を復号する際の計算量を小さくし、ソフト
ウェアで復号した場合に復号に要する時間が小さいとと
もに、ハードウェアで復号した場合に復号器に要する回
路規模が小さいすることである。
It is to be noted that, in addition to the above, a preferred embodiment of the present invention provides a coding method in which the amount of calculation when compressing a multi-valued image is reduced and the time required for coding is reduced when coding by software. It is to provide. Another object of the present invention is to reduce the amount of calculation when decoding a code, reduce the time required for decoding when decoding by software, and reduce the circuit scale required for a decoder when decoding by hardware. That is.

【0012】[0012]

【発明の実施の形態】以下、添付図面に従って本発明に
係る実施形態を詳細に説明する。
Embodiments of the present invention will be described below in detail with reference to the accompanying drawings.

【0013】<第1実施形態>図1は本発明装置の構成
を示すブロック図である。図中、1はコンピュータ(例
えば米国マイクロソフト社のWindowsをOSにしたパー
ソナルコンピュータ等)であり、CPU、メモリ、ハー
ドディスク、フロッピー(登録商標)ディスクドライ
ブ、キーボード、マウス、モニタ、パラレルポート等の
ハードウェア(不図示)を備える。2はオペレーティン
グシステムであり、コンピュータ1が備えるハードウェ
ア、およびアプリケーション3、プリンタドライバ4、
ポートドライバ5などのソフトウェアを管理する。アプ
リケーション3は、例えばワードプロセッサのようなア
プリケーションソフトウェアであり、操作者の指示に従
って文書の作成・印刷などを行う。4はプリンタドライ
バであり、アプリケーション3が発行した印刷指令をオ
ペレーティングシステム2を経て受け取り、該印刷指令
をプリンタ6が解釈可能なプリンタコマンドに変換す
る。5はポートドライバであり、プリンタドライバ4が
変換したプリンタコマンドをオペレーティングシステム
2を経て受け取り、パラレルポートを経由してプリンタ
6に送信する。6はプリンタであり、ポートドライバ5
から受信したプリンタコマンドに従って印刷を行う。
<First Embodiment> FIG. 1 is a block diagram showing the configuration of the apparatus of the present invention. In FIG. 1, reference numeral 1 denotes a computer (for example, a personal computer or the like using Microsoft's Windows as an OS), such as a CPU, a memory, a hard disk, a floppy (registered trademark) disk drive, a keyboard, a mouse, a monitor, and a parallel port. (Not shown). Reference numeral 2 denotes an operating system, which includes hardware included in the computer 1, an application 3, a printer driver 4,
It manages software such as the port driver 5. The application 3 is, for example, application software such as a word processor, and creates and prints a document in accordance with an instruction from an operator. A printer driver 4 receives a print command issued by the application 3 via the operating system 2 and converts the print command into a printer command that can be interpreted by the printer 6. Reference numeral 5 denotes a port driver which receives a printer command converted by the printer driver 4 via the operating system 2 and transmits the command to the printer 6 via a parallel port. Reference numeral 6 denotes a printer, and a port driver 5
Print according to the printer command received from the printer.

【0014】図2はプリンタ6の構成を示すブロック図
である。図中、11はパラレルポートであり、コンピュ
ータ1からプリンタコマンドを受信する。12はFIF
O(ファーストインファーストアウト)メモリであり、
パラレルポート11が受信した符号化データを記憶し、
記憶したデータを先入れ先出しの順に復号回路13に出
力する。復号回路13は、FIFOメモリ12に記憶さ
れた符号列データを復号し、プリンタエンジン14に出
力する。プリンタエンジン14はレーザビームプリンタ
エンジンであり、制御回路15の指示により、復号回路
13が出力した画像データに従って印刷を行う。画像デ
ータはシアン、マゼンタ、黄、黒の各色ごとに面順序で
出力される。また、各色の画素は8ビットで構成され、
256階調を表現することができる。15は制御回路で
あり、例えば1チップCPUで構成され、パラレルポー
ト11、FIFOメモリ12、復号回路13、およびプ
リンタエンジン14の制御を行う。以下、印刷動作につ
いて説明する。
FIG. 2 is a block diagram showing the configuration of the printer 6. In the figure, a parallel port 11 receives a printer command from the computer 1. 12 is FIF
O (first in first out) memory,
The encoded data received by the parallel port 11 is stored,
The stored data is output to the decoding circuit 13 in a first-in first-out order. The decoding circuit 13 decodes the code string data stored in the FIFO memory 12 and outputs it to the printer engine 14. The printer engine 14 is a laser beam printer engine, and performs printing in accordance with the image data output from the decoding circuit 13 according to an instruction from the control circuit 15. The image data is output in plane order for each color of cyan, magenta, yellow, and black. Each color pixel is composed of 8 bits.
256 gradations can be expressed. Reference numeral 15 denotes a control circuit, which is formed of, for example, a one-chip CPU, and controls the parallel port 11, the FIFO memory 12, the decoding circuit 13, and the printer engine 14. Hereinafter, the printing operation will be described.

【0015】操作者がコンピュータ1側でアプリケーシ
ョン3を操作して印刷データを生成し、これを印刷指示
すると、アプリケーション3からオペレーティングシス
テム2を経由してプリンタドライバ4に印刷指令が渡さ
れる。プリンタドライバ4はアプリケーション3から発
行された印刷指令に基づき、赤、緑、青の3色からなる
RGB画像データを作成し、次いでRGB画像データ
を、シアン、マゼンタ、黄、黒の4色からなるCMYK
画像データに変換する。そして、プリンタドライバ3
は、後述する符号化手順に基づき、作成した画像データ
から符号化データを生成し、用紙サイズ、ビットマップ
データのラインの長さとライン数などを指定する印刷制
御コマンドとともに符号化データを出力する。ポートド
ライバ5は、プリンタドライバ3が作成した、印刷制御
コマンドおよび符号化データからなる一連のプリンタコ
マンドを、プリンタ6に送信する。
When the operator operates the application 3 on the computer 1 to generate print data and gives a print instruction, a print command is passed from the application 3 to the printer driver 4 via the operating system 2. The printer driver 4 creates RGB image data of three colors of red, green, and blue based on a print command issued from the application 3, and then converts the RGB image data of four colors of cyan, magenta, yellow, and black. CMYK
Convert to image data. And the printer driver 3
Generates encoded data from the created image data based on an encoding procedure to be described later, and outputs the encoded data along with a print control command for specifying a paper size, a line length and the number of lines of bitmap data, and the like. The port driver 5 transmits to the printer 6 a series of printer commands created by the printer driver 3 and including a print control command and encoded data.

【0016】一方、プリンタ6は上記のようにして送信
されてきたデータに基づき、記録媒体(記録紙等)に画
像を形成するが、その動作は次の通りである。
On the other hand, the printer 6 forms an image on a recording medium (recording paper or the like) based on the data transmitted as described above, and the operation is as follows.

【0017】制御回路15はパラレルポート11を経由
してプリンタコマンドを受信する。受信したプリンタコ
マンドが印刷制御コマンドであれば、印刷制御のために
制御回路15の内部に保持する。また、受信したプリン
タコマンドが符号化データであった場合は、FIFOメ
モリ12に格納する。その後、ページ終了コマンドの受
信などにより、1ページを構成するプリンタコマンドの
受信が完了したことを検出したときに、プリンタエンジ
ン14に印刷の開始を指示する。印刷の開始が指示され
ると、プリンタエンジン14は給紙カセットから用紙を
給紙し、用紙が所定の位置に到達したときに、復号回路
13に画像データの出力を要求する。復号回路13は、
あらかじめFIFOメモリ12から符号化データを読み
出し、復号した画像データを内部のバッファに保持して
おき、プリンタエンジン14から画像データの出力を要
求されたときに、内部のバッファに保持していた画像デ
ータを出力する。復号回路13は、画像データを保持し
ていたバッファに空きができたときに、FIFOメモリ
12から引き続く符号化データを読み出し、復号して内
部のバッファに保持する。このようにして符号化データ
は順次復号されて画像データとして出力され、1ページ
の画像データの出力が全て終了すると、印刷が完了す
る。
The control circuit 15 receives a printer command via the parallel port 11. If the received printer command is a print control command, it is held in the control circuit 15 for print control. If the received printer command is encoded data, it is stored in the FIFO memory 12. Thereafter, when it is detected that the reception of the printer command constituting one page is completed by receiving a page end command or the like, the printer engine 14 is instructed to start printing. When the start of printing is instructed, the printer engine 14 feeds paper from the paper feed cassette, and requests the decoding circuit 13 to output image data when the paper reaches a predetermined position. The decoding circuit 13
The encoded data is read from the FIFO memory 12 in advance, and the decoded image data is stored in an internal buffer. When the printer engine 14 requests the output of the image data, the image data stored in the internal buffer is stored. Is output. The decoding circuit 13 reads out the subsequent coded data from the FIFO memory 12 when there is free space in the buffer holding the image data, decodes the coded data, and stores it in the internal buffer. In this manner, the encoded data is sequentially decoded and output as image data, and when the output of one page of image data is completed, printing is completed.

【0018】次に、図3および図4に示すテーブルを参
照し、図1に示したプリンタドライバ3が生成する符号
について説明する。
Next, the codes generated by the printer driver 3 shown in FIG. 1 will be described with reference to the tables shown in FIGS.

【0019】図3は、図1に示したプリンタドライバ3
が生成する符号化テーブルの一例を示す図である。本実
施形態で説明する符号は、ビット単位で可変長であり、
例えば3ビットから23ビットまでのビット列で表現さ
れる。各符号は、ハフマン符号と同様に、先頭から順に
調べることにより符号を識別することができるように構
成されている。なお、各画素データの各色成分は1バイ
ト(256階調)で表現され、0から255までのいず
れかを持つものとする。
FIG. 3 shows the printer driver 3 shown in FIG.
FIG. 3 is a diagram illustrating an example of an encoding table generated by. The code described in the present embodiment has a variable length in bit units,
For example, it is represented by a bit string from 3 bits to 23 bits. Like the Huffman code, each code is configured so that the code can be identified by sequentially examining the code from the beginning. Note that each color component of each pixel data is represented by 1 byte (256 gradations) and has any of 0 to 255.

【0020】また、説明を簡単にするため、ここで1つ
の色成分について説明する。他の色成分への切り替え
は、その旨の制御コマンドを指定することで行うものと
する。つまり、プリンタドライバは、Y、M、C、Kの
色成分の符号をブロック毎に出力し、各色成分の切り替
えは制御コマンドを与えることで行う。なお、出力順
は、ブロックに限らず、面(プレーン)順次としても構
わない。
In order to simplify the description, one color component will be described here. Switching to another color component is performed by designating a control command to that effect. That is, the printer driver outputs the codes of the Y, M, C, and K color components for each block, and switches between the color components is performed by giving a control command. Note that the output order is not limited to blocks, and may be plane (plane) sequential.

【0021】図3は、例えば、符号のビット列が「10
110100100」の場合は「EOL」コマンドであ
り、ライン終端まで直前のラインの同一位置をコピーす
ることを示す。印刷データは右余白があるのが一般的で
あり、この場合、各ラインの行末には空白が存在する。
EOLコマンドは、複写する画素数を明示的に指定する
Copyコマンドで代用できるため必須ではないが、複
写する画素数を明示的に指定することなしに直上のライ
ンの空白を複写することができるので、圧縮率の向上に
寄与することができる。
FIG. 3 shows, for example, that the bit sequence of the code is "10
“110100100” is an “EOL” command, indicating that the same position of the immediately preceding line is copied to the end of the line. Generally, print data has a right margin. In this case, a blank exists at the end of each line.
The EOL command is not essential because it can be replaced by a Copy command that explicitly specifies the number of pixels to be copied. However, since the blank on the line immediately above can be copied without explicitly specifying the number of pixels to be copied. , Can contribute to the improvement of the compression ratio.

【0022】また、符号のビット列が「0110011
0101000001010001」の場合は、EOB
コマンドであり、符号ブロックの終了を示す。画像デー
タは多数のブロックに分割されて送信されるのが一般的
であり、EOBコマンドはブロックの終了を示すととも
に、ビット単位の符号をバイト境界に整列する役割を果
たす。
When the code bit string is "0110011"
0101000001010001 ”, the EOB
Command indicating the end of the code block. Generally, image data is transmitted after being divided into a number of blocks, and the EOB command indicates the end of the block and plays a role of aligning a bit unit code on a byte boundary.

【0023】また、符号のビット列が「1011010
0011」、「000」、「10111」、「0011
1000100010」等の場合は、0バイトから63
バイトまでのCopyコマンドであり、直前のラインの
同位置のデータを、コマンドにより指定された画素数複
写する。なお、0バイトのCopyコマンドは単独で使
用されることはなく、後述するAddCountコマン
ドとの組み合わせで使用される。
The bit sequence of the code is "1011010".
0011 "," 000 "," 10111 "," 0011 "
1000100010 "and so on, from 0 bytes to 63
This is a Copy command up to a byte, and copies the data at the same position on the immediately preceding line by the number of pixels specified by the command. The 0-byte Copy command is not used alone, but is used in combination with an AddCount command described later.

【0024】また、符号のビット列が「1011010
0110110101」、「010」、「0111
0」、「101101001101101000」等の
場合は、0バイトから63バイトまでのRepeatコ
マンドであり、直前の画素データを、コマンドにより指
定された画素数繰り返す。なお、0バイトのRepea
tコマンドも単独で使用されることはなく、後述するA
ddCountコマンドとの組み合わせで使用される。
なお、直前の画素は、通常は復号しようとしている画素
の直左の画素であるが、復号しようとしている画素がラ
インの最左で、直左の画素が存在しない場合は、直前の
ラインのライン終端の画素を代りに使用する。また、復
号しようとしている画素が先頭行の最左である場合は、
0の画素データを代りに使用する。
The bit sequence of the code is "1011010".
0110110101 "," 010 "," 0111 "
In the case of "0", "101101001101101000", etc., it is a Repeat command from 0 bytes to 63 bytes, and the immediately preceding pixel data is repeated by the number of pixels specified by the command. Note that the 0-byte Repea
The t command is not used alone, and A
Used in combination with the ddCount command.
Note that the immediately preceding pixel is usually the pixel immediately to the left of the pixel to be decoded, but if the pixel to be decoded is the leftmost pixel of the line and there is no pixel to the left of the line, the line of the previous line is Use the last pixel instead. Also, if the pixel to be decoded is the leftmost of the first row,
0 pixel data is used instead.

【0025】また、符号のビット列が「1011010
000」、「01100101000」、「01110
10011111010」等の場合は、64バイトから
4032バイトまで(ただし64の整数倍)のAddC
ountコマンドであり、引き続くCopyコマンドま
たはRepeatコマンドのいずれかの画素数に、この
コマンドで指定された数を加算する。複写または繰り返
しの画素数は最大数千バイトに及ぶため、これら一つ一
つに独立したコマンドを割り当てると、コマンド数が著
しく増加するため、ハードウェアで復元する場合に復元
器の規模が大きくなるという欠点がある。一方、コマン
ド数を少なくするために複写または繰り返しの数を小さ
くすると、複写または繰り返しの画素数が大きい場合に
多数のコマンドに符号化しなければならず、圧縮率が低
下するという問題がある。上記の64の整数倍の値を持
つAddCountコマンドを設けることにより、複写
または繰り返しの画素数を制限することなしに、コマン
ドの数を少なくすることができる。例えば、繰り返し回
数が大きい場合には64×nでおおざっぱな繰り返しを
指定し、その後細かい繰り返し指定することで実現でき
ることになる。この結果、圧縮率を損ねることなしにハ
ードウェアで復元する場合に復元器の規模が大きくなる
という問題を回避できる。
The bit sequence of the code is "1011010".
000 "," 01100101000 "," 01110 "
10011111010 ", etc., an AddC of 64 bytes to 4032 bytes (however, an integral multiple of 64)
This is an out command, and the number specified by this command is added to the number of pixels of either the subsequent Copy command or Repeat command. Since the number of pixels to be copied or repeated reaches a maximum of several thousand bytes, assigning an independent command to each of them significantly increases the number of commands, so that the scale of the restorer becomes large when performing restoration by hardware. There is a disadvantage that. On the other hand, if the number of copying or repetition is reduced in order to reduce the number of commands, when the number of pixels of copying or repetition is large, it must be coded into a large number of commands, resulting in a problem that the compression ratio is reduced. By providing the AddCount command having a value that is an integer multiple of 64, the number of commands can be reduced without limiting the number of pixels for copying or repeating. For example, when the number of repetitions is large, it can be realized by designating a rough repetition by 64 × n, and then designating a fine repetition. As a result, it is possible to avoid the problem that the scale of the decompressor becomes large when performing decompression by hardware without deteriorating the compression ratio.

【0026】また、符号のビット列が「110」、「1
001」、「0110100100000010110
001」、「1010」、「111」等の場合は、1か
ら255までのPixelDiffコマンドであり、直
前の画素データとの差がそれぞれ1から255である1
画素を示す。
The code bit string is "110", "1"
001 "," 01101001000000010110
001 "," 1010 "," 111 ", etc., are PixelDiff commands from 1 to 255, and the difference from the immediately preceding pixel data is 1 to 255, respectively.
Indicates a pixel.

【0027】ここで注目する点は、直前の画素の値に加
算する値が1または255での符号長を最小にして、中
央の128で最大になるようにしている点である。この
理由は、第1には、多値画像の隣接する画素は同じよう
な画素データを持つことが多い、すなわち、多値画像に
おいて隣接する画素データの差は0を中心に分布するこ
とに起因する また、加算する値が255と大きい場合の符号長が短い
理由は、一般に文字・線画等の2値画像を多値スキャナ
で読み取った場合には、文字・線画のエッジ部の濃度が
0から255に変化したり、逆に255から0へ変化す
る。従って、文字線画の場合には、このような変化が頻
繁であるので、濃度変化が大きい場合にも符号長は小さ
くなるようにした。
The point to be noted here is that the value to be added to the value of the immediately preceding pixel is such that the code length at 1 or 255 is minimized and the value at the center 128 is maximized. The first reason is that adjacent pixels of a multi-valued image often have similar pixel data, that is, the difference between adjacent pixel data in a multi-valued image is distributed around 0. The reason why the code length is short when the value to be added is as large as 255 is that when a binary image such as a character or a line drawing is read by a multi-valued scanner, the density of the edge portion of the character or a line drawing is generally 0 to 0. It changes to 255 or conversely from 255 to 0. Therefore, in the case of a character line drawing, such a change is frequent, so that the code length is reduced even when the density change is large.

【0028】上記、PixelDiffコマンドで隣接
する画素データの差を符号化することにより、コマンド
の出現頻度の分布が偏るため、1または255のような
頻度の高い差の値に短い符号を割り当てることにより、
圧縮率を高くすることができる。
By encoding the difference between adjacent pixel data using the above-mentioned PixelDiff command, the distribution of the appearance frequency of the command is biased. Therefore, by assigning a short code to a value of a difference having a high frequency such as 1 or 255, ,
The compression ratio can be increased.

【0029】なお、画素データ間の演算は256を法と
して行われるので、−1は255により表現される。ま
た、隣接する画素データに差がない場合は、Repea
tコマンドにより表現することができるため、差が0で
あるPixelDiffコマンドは不要となる。
Since the calculation between pixel data is performed modulo 256, -1 is represented by 255. If there is no difference between adjacent pixel data,
Since it can be expressed by a t command, a PixelDiff command with a difference of 0 is unnecessary.

【0030】また、これらの符号は、あらかじめ多数の
画像データで各コマンドの出現頻度を求めておき、ハフ
マン符号と同様に、出現頻度の高いコマンドに短い符号
を、出現頻度の低いコマンドに比較的長い符号を割り当
てることにより圧縮率を高くすることができる。
For these codes, the appearance frequency of each command is obtained in advance from a large number of image data, and a short code is used for a command having a high appearance frequency and a command is used for a command having a low appearance frequency, similarly to the Huffman code. By assigning a long code, the compression ratio can be increased.

【0031】次に図4を参照し、図3に示される符号の
実例を説明する。
Next, an example of the reference numerals shown in FIG. 3 will be described with reference to FIG.

【0032】符号列「101111101010011
101101100111010110100100」
(この場合は39ビット)は、図5に示すように8つの
符号により構成される。今、復号しようとしている画素
がラインの先端(最左)であり、直前のラインの復号デ
ータが「0、0、0、0、0、0、128、128、1
28、128、128、128」であるとする。
The code string "101111101010011"
101101100111010110100100 "
(39 bits in this case) is composed of eight codes as shown in FIG. The pixel to be decoded is the leading end (leftmost) of the line, and the decoded data of the immediately preceding line is “0, 0, 0, 0, 0, 0, 128, 128, 1”.
28, 128, 128, 128 ".

【0033】先頭の符号「10111」はCopy2コ
マンドであり、直前のラインの直上の位置から2バイト
のデータ「0、0」の複写を示す。次に符号「110」
はPixelDiff1コマンドであり、直前の画素デ
ータ「0」に1を加算した画素データ「1」を示す。次
に符号「1010」はPixelDiff254コマン
ドであり、直前の画素データ「1」に254を加算した
画素データ「255」を示す。次に符号「01110」
はRepeat2コマンドであり、直前の画素データ
「255」を2バイト繰り返すことを示す。次に符号
「110」はPixelDiff1コマンドであり、直
前の画素データ「255」に1を加算した画素データ
「0」を示す。なお、この際の加算は256を法として
演算され、下位8ビットが有効となるため、この場合は
256ではなく0となる。次に符号「110」はPix
elDiff1コマンドであり、直前の画素データ
「0」に1を加算した画素データ「1」を示す。次に符
号「01110」はRepeat2コマンドであり、直
前の画素データ「1」を2バイト繰り返すことを示す。
次に符号「10110100100」はEOLコマンド
であり、直前のラインの直上の位置からライン終端(行
末)まで、この場合は2バイトのデータ「128、12
8」の複写を示す。
The first code "10111" is a Copy2 command, which indicates the copying of 2-byte data "0, 0" from the position immediately above the immediately preceding line. Next, the code “110”
Is a PixelDiff1 command, which indicates pixel data “1” obtained by adding 1 to the immediately preceding pixel data “0”. Next, reference numeral “1010” is a PixelDiff254 command, which indicates pixel data “255” obtained by adding 254 to the immediately preceding pixel data “1”. Next, the code “01110”
Is a Repeat2 command, which indicates that the immediately preceding pixel data “255” is repeated by 2 bytes. Next, reference numeral “110” is a PixelDiff1 command, which indicates pixel data “0” obtained by adding 1 to the immediately preceding pixel data “255”. Note that the addition at this time is calculated using 256 as a modulus, and the lower 8 bits are valid. Therefore, in this case, the value becomes 0 instead of 256. Next, the code “110” is Pix
This is an elDiff1 command, and indicates pixel data “1” obtained by adding 1 to the immediately preceding pixel data “0”. Next, a code “01110” is a Repeat 2 command, which indicates that the immediately preceding pixel data “1” is repeated by 2 bytes.
Next, the code “10110100100” is an EOL command, from the position immediately above the immediately preceding line to the end of the line (end of line), in this case, 2-byte data “128, 12”
8 ".

【0034】以上の結果、1画素の色成分が8ビットで
表現される場合、8×12画素=96バイト=768ビ
ット必要であったものが、実に39ビットで済むことに
なる。
As a result, when a color component of one pixel is represented by 8 bits, 39 bits are required instead of 8 × 12 pixels = 96 bytes = 768 bits.

【0035】次に、図5に示すフローチャートを参照
し、プリンタドライバ4の符号化手順の詳細を説明す
る。
Next, the encoding procedure of the printer driver 4 will be described in detail with reference to the flowchart shown in FIG.

【0036】プリンタドライバ4は、アプリケーション
3の指示に従ってRGB画像データを生成し、次いでR
GB画像データをCMYK画像データに変換する。RG
B→YMCKへの変換そのものは公知であるので、その
説明は省略する。
The printer driver 4 generates RGB image data in accordance with the instruction of the application 3,
The GB image data is converted into CMYK image data. RG
The conversion itself from B to YMCK is publicly known, and a description thereof will be omitted.

【0037】次に、画像データのブロックごとに、図5
の符号化手順を呼び出す。
Next, for each block of image data, FIG.
Is called.

【0038】まずステップS1にて、ブロックごとの初
期化を行う。具体的には変数Yと最終画素データに0を
格納する。なお、ここで言う変数Yは注目画素のライン
番号を、「最終画素データ」は注目画素の直前の画素デ
ータを保持する。次にステップS2にて変数Xに0を格
納する。変数Xは注目画素のカラム番号を保持する。
First, in step S1, initialization is performed for each block. Specifically, 0 is stored in the variable Y and the final pixel data. Here, the variable Y here holds the line number of the target pixel, and the “final pixel data” holds the pixel data immediately before the target pixel. Next, 0 is stored in a variable X in step S2. The variable X holds the column number of the pixel of interest.

【0039】次にステップS3にて、変数Yが0である
か判定する。変数Yが0でない場合は、直前のラインを
複写する可能性があるので、ステップS4にて注目画素
が直上の画素データと同一であるか判定する。注目画素
が直上の画素データと同一である場合は、直前のライン
のデータを複写できるので、ステップS5にて複写する
画素数を求める。具体的には、注目画素の右側の画素が
その直上の画素と連続して同一である画素数を求める。
ただしラインの右端に達した場合には、そこで打ち切る
ものとする。次にステップS6にて、ライン終端(右端
=行末)までの複写であるか判定する。具体的には、変
数Xと、ステップS5で求めた複写する画素数との和
が、1ラインの画素数に一致した場合にはライン右端ま
での複写と判定できる。行末までの複写ではない場合
は、ステップS7にて、ステップS5で求めた複写する
画素数が63より大であるか判定する。ステップS5で
求めた複写する画素数が63より大である場合は、ステ
ップS8にて、ステップS5で求めた複写する画素数に
従って、AddCountコマンドを出力する。いずれ
の場合もステップS9に進み、ステップS5で求めた複
写する画素数に従って、Copyコマンドを出力し、ス
テップS17に進む。
Next, in step S3, it is determined whether the variable Y is 0. If the variable Y is not 0, there is a possibility that the immediately preceding line is copied, so it is determined in step S4 whether the target pixel is the same as the pixel data immediately above. If the target pixel is the same as the pixel data immediately above, the data of the immediately preceding line can be copied, and the number of pixels to be copied is determined in step S5. Specifically, the number of pixels in which the pixel on the right of the target pixel is continuously the same as the pixel immediately above it is determined.
However, if it reaches the right end of the line, it shall be terminated there. Next, in step S6, it is determined whether or not copying is performed up to the end of the line (right end = end of line). Specifically, when the sum of the variable X and the number of pixels to be copied obtained in step S5 matches the number of pixels of one line, it can be determined that copying is to the right end of the line. If it is not the copying up to the end of the line, it is determined in step S7 whether the number of pixels to be copied obtained in step S5 is larger than 63. If the number of pixels to be copied determined in step S5 is greater than 63, an AddCount command is output in step S8 according to the number of pixels to be copied determined in step S5. In either case, the process proceeds to step S9, outputs a Copy command according to the number of pixels to be copied obtained in step S5, and proceeds to step S17.

【0040】また、ステップS6にて行末までの複写と
判定された場合は、ステップS10にてEOLコマンド
を出力し、ステップS17に進む。
If it is determined in step S6 that copying is to be performed up to the end of the line, an EOL command is output in step S10, and the flow advances to step S17.

【0041】一方、ステップS3にて変数Yが0であっ
た場合、およびステップS4にて直上の画素と同一でな
いと判定された場合はいずれもステップS11に進み、
注目画素が最終画素データと同一であるか判定する。注
目画素が最終画素データと同一である場合は、最終画素
を繰り返すことができるので、ステップS12にて繰り
返す画素数を求める。具体的には、注目画素の右側の画
素が最終画素データと連続して同一である画素数を求め
る。ただしラインの右端に達した場合には、そこで打ち
切るものとする。次にステップS13にて、ステップS
12で求めた繰り返す画素数が63より大であるか判定
する。ステップS12で求めた繰り返す画素数が63よ
り大である場合は、ステップS14にて、ステップS1
2で求めた繰り返す画素数に従って、AddCount
コマンドを出力する。いずれの場合もステップS15に
進み、ステップS12で求めた繰り返す画素数に従っ
て、Repeatコマンドを出力し、ステップS17に
進む。
On the other hand, if the variable Y is 0 in step S3 and if it is determined in step S4 that the variable is not the same as the pixel immediately above, the process proceeds to step S11.
It is determined whether the target pixel is the same as the last pixel data. If the target pixel is the same as the last pixel data, the last pixel can be repeated, and the number of pixels to be repeated is determined in step S12. Specifically, the number of pixels in which the pixel on the right side of the target pixel is continuously the same as the final pixel data is obtained. However, if it reaches the right end of the line, it shall be terminated there. Next, in Step S13, Step S
It is determined whether or not the number of repeated pixels obtained in step 12 is greater than 63. If the number of pixels to be repeated determined in step S12 is larger than 63, in step S14, step S1
AddCount according to the number of repeating pixels obtained in step 2
Output a command. In any case, the process proceeds to step S15, outputs a Repeat command according to the number of pixels to be repeated determined in step S12, and proceeds to step S17.

【0042】また、ステップS11にて、注目画素が最
終画素データと同一でない場合はS16にて、注目画素
データから最終画素データを減算した値に従って、Pi
xelDiffコマンドを出力し、ステップS17に進
む。
If it is determined in step S11 that the pixel of interest is not the same as the final pixel data, the flow proceeds to step S16 in accordance with the value obtained by subtracting the final pixel data from the pixel data of interest.
A xelDiff command is output, and the process proceeds to step S17.

【0043】さて、処理がステップS17に進むと、処
理された画素のうち最後の画素のデータを「最終画素デ
ータ」に格納し、次に変数Xに処理された画素数を加算
することにより更新する。そして、ステップS18にて
1ラインの処理が終了したか、具体的には変数Xが1ラ
インの画素数に達したか判定する。1ラインの処理が終
了していない場合はステップS3に戻り、現在のライン
の処理を続ける。また、1ラインの処理が終了した場合
は、ステップS19にて変数Yに1を加算することによ
り更新し、ステップS20にて該ブロックの処理が終了
したか、具体的には変数Yが該ブロックのライン数に達
したか判定する。該ブロックの処理が終了していない場
合はステップS2に戻り、次のラインの処理を続ける。
該ブロックの処理が終了した場合はステップS21にて
EOBコマンドを出力し、ステップS22にてバイト境
界に整列する。具体的には、出力したビット数が8の整
数倍でない場合は、8の整数倍に達するまでビット
「0」を出力し、次の処理に復帰する。
When the process proceeds to step S17, the data of the last pixel among the processed pixels is stored in the "final pixel data", and then updated by adding the number of processed pixels to the variable X. I do. Then, in step S18, it is determined whether the processing of one line has been completed, specifically, whether the variable X has reached the number of pixels of one line. If the processing for one line has not been completed, the process returns to step S3, and the processing for the current line is continued. When the processing of one line is completed, the processing is updated by adding 1 to the variable Y in step S19, and whether the processing of the block is completed in step S20, specifically, when the variable Y is It is determined whether the number of lines has been reached. If the processing of the block has not been completed, the process returns to step S2, and the processing of the next line is continued.
When the processing of the block is completed, an EOB command is output in step S21, and the block is aligned on a byte boundary in step S22. Specifically, if the number of output bits is not an integral multiple of 8, the bit “0” is output until the number of bits reaches the integral multiple of 8, and the process returns to the next process.

【0044】上記処理をブロック単位に行うことにな
る。なお、1頁全部について1つの色成分についての処
理を終えた後、次の色成分に対して行っても良いし、1
ブロック処理する毎に対象とする色成分を変更しても構
わない。
The above processing is performed for each block. After the process for one color component is completed for all pages, the process may be performed for the next color component.
The target color component may be changed every time the block processing is performed.

【0045】次に、実施形態におけるプリンタ6におけ
る復号回路13の詳細について説明する。
Next, the details of the decoding circuit 13 in the printer 6 in the embodiment will be described.

【0046】図6は、復号回路13の詳細を示すブロッ
ク図である。
FIG. 6 is a block diagram showing details of the decoding circuit 13.

【0047】同図において、入力バッファ21は、FI
FOメモリ12から読み出した符号データを格納する。
入力バッファ21は、少なくとも4バイトのデータを格
納することができ、バッファに空きが生じ、かつFIF
Oメモリ12にデータがある場合はFIFOメモリ12
からデータを読み出して格納する。入力バッファ21は
また、ビットカウンタ23に保持された、処理済ビット
数が8以上になった場合には、不要になった処理済デー
タを破棄する。
In the figure, an input buffer 21 is a FI
The code data read from the FO memory 12 is stored.
The input buffer 21 is capable of storing at least 4 bytes of data.
If there is data in the O memory 12, the FIFO memory 12
Read data from and store it. When the number of processed bits held in the bit counter 23 becomes eight or more, the input buffer 21 discards unnecessary processed data.

【0048】セレクタ22は、例えば23組の8入力セ
レクタであり、入力バッファ21に格納された符号デー
タを、ビットカウンタ23が示す処理済ビット数に従っ
て選択することにより、コマンドデコード回路24が処
理するために必要な、コマンドの開始位置合わせを行
う。これは、入力バッファ21がバイト単位にデータを
保持するのに対し、コマンドはビット単位の可変長デー
タであるため8箇所の開始位置があるために必要なもの
である。
The selector 22 is, for example, 23 sets of 8-input selectors, and the command decode circuit 24 processes the code data stored in the input buffer 21 by selecting the code data according to the number of processed bits indicated by the bit counter 23. Command start position necessary for this. This is necessary because the input buffer 21 holds data in byte units, whereas the command is variable-length data in bit units and thus has eight start positions.

【0049】ビットカウンタ23は、入力バッファ21
に格納された符号データのうち処理済みのビット数を格
納する。ビットカウンタ23はまた、コマンドデコード
回路24から出力された、コマンドのビット数を加算す
ることによりビットカウンタに格納された値を更新す
る。ビットカウンタ23はまた、入力バッファが処理済
データを破棄した場合には、破棄したビット数を減算す
る。ビットカウンタ23はまた、コマンドデコード回路
23がEOBコマンドを復号したときに、コマンドデコ
ード回路23からEOB信号を受信し、バイト境界合わ
せの処理を行う。具体的には、ビットカウンタの下位3
ビットが全て0であれば何もせず、そうでなければ8を
加算するとともに下位3ビットをクリアする。
The bit counter 23 is provided in the input buffer 21
And stores the number of processed bits in the code data stored in. The bit counter 23 also updates the value stored in the bit counter by adding the number of bits of the command output from the command decode circuit 24. When the input buffer discards the processed data, the bit counter 23 subtracts the number of discarded bits. When the command decode circuit 23 decodes the EOB command, the bit counter 23 receives the EOB signal from the command decode circuit 23 and performs a byte boundary alignment process. Specifically, the lower three bits of the bit counter
If the bits are all 0, nothing is done; otherwise, 8 is added and the lower 3 bits are cleared.

【0050】コマンドデコード回路24は、例えばリー
ドオンリーメモリ、あるいはワイヤードロジックにより
構成され、セレクタ22によって位置合わせが行われ
た、入力バッファ21に格納された符号データを復号
し、復号したコマンドに従ってカウンタ26、コピー出
力回路27、リピート出力回路28、データ出力回路2
9、ビットカウンタ23、および減算回路34に、前述
の、あるいは後述する各種の信号を出力する。
The command decode circuit 24 is composed of, for example, a read-only memory or a wired logic, decodes the code data stored in the input buffer 21, which has been aligned by the selector 22, and according to the decoded command, a counter 26. , Copy output circuit 27, repeat output circuit 28, data output circuit 2
9, and outputs the above-described or later-described various signals to the bit counter 23 and the subtraction circuit 34.

【0051】カウンタ26は、Copyコマンドまたは
Repeatコマンドの処理画素数を保持し、1バイト
の複写または繰り返しが行われる毎に減算される。なお
本実施形態では1画素の1色成分が1バイトであるた
め、1色成分の画素数とバイト数は一致する。カウンタ
26は上位6ビットと下位6ビットを独立に設定可能で
あり、コマンドデコード回路23がAddCountコ
マンドを復号した時にはコマンドデコード回路23が出
力する、処理画素数の加算値をカウンタ26の上位に格
納する。また、コマンドデコード回路23がCopyコ
マンドまたはRepeatコマンドを復号した時にはコ
マンドデコード回路23が出力する、処理画素数をカウ
ンタ26の下位に格納する。また、コマンドデコード回
路23がEOLコマンドを復号した時には減算回路34
が出力する、処理画素数をカウンタ26の上位および下
位に格納する。
The counter 26 holds the number of pixels processed by the Copy command or the Repeat command, and is decremented each time one byte is copied or repeated. In this embodiment, since one color component of one pixel is one byte, the number of pixels and the number of bytes of one color component match. The counter 26 can independently set the upper 6 bits and the lower 6 bits. When the command decode circuit 23 decodes the AddCount command, the command decode circuit 23 outputs the added value of the number of processed pixels in the upper position of the counter 26. I do. When the command decode circuit 23 decodes the Copy command or the Repeat command, the number of pixels to be processed, which is output from the command decode circuit 23, is stored in the lower part of the counter 26. When the command decode circuit 23 decodes the EOL command, the subtraction circuit 34
Are stored in the upper and lower bits of the counter 26.

【0052】コピー出力回路27は複写の制御を行い、
コマンドデコード回路23がCopyコマンドまたはE
OLコマンドを復号したときに、コマンドデコード回路
23から複写信号を受信し、カウンタ26に格納された
処理画素数で指定された回数複写処理を行う。具体的に
は、注目画素の直上の画素データ、即ちアドレスカウン
タ31が示す位置にラインバッファ33に格納されたデ
ータを復号データとして出力する。
The copy output circuit 27 controls copying, and
The command decode circuit 23 outputs a copy command or E
When the OL command is decoded, a copy signal is received from the command decode circuit 23, and the copy process is performed the number of times specified by the number of processing pixels stored in the counter 26. Specifically, pixel data immediately above the target pixel, that is, data stored in the line buffer 33 at the position indicated by the address counter 31, is output as decoded data.

【0053】リピート出力回路28は繰り返しの制御を
行い、コマンドデコード回路23がRepeatコマン
ドを復号したときに、コマンドデコード回路23から繰
り返し信号を受信し、カウンタ26に格納された処理画
素数で指定された回数繰り返し処理を行う。具体的に
は、注目画素の直前の画素データ、即ちデータレジスタ
30に格納されたデータを復号データとして出力する。
The repeat output circuit 28 controls the repetition. When the command decode circuit 23 decodes the Repeat command, the repeat output circuit 28 receives a repeat signal from the command decode circuit 23 and is designated by the number of processing pixels stored in the counter 26. It repeats the process for the number of times. Specifically, pixel data immediately before the target pixel, that is, data stored in the data register 30 is output as decoded data.

【0054】データ出力回路29は画素差分データの制
御を行い、コマンドデコード回路23がPixelDi
ffコマンドを復号したときに、コマンドデコード回路
23から画素差分信号を受信し、注目画素の直前の画素
データ、即ちデータレジスタ30に格納されたデータと
受信した画素差分データとの和を復号データとして出力
する。
The data output circuit 29 controls the pixel difference data, and the command decode circuit 23 controls the PixelDi
When the ff command is decoded, a pixel difference signal is received from the command decode circuit 23, and the pixel data immediately before the pixel of interest, that is, the sum of the data stored in the data register 30 and the received pixel difference data is used as decoded data. Output.

【0055】データレジスタ30は、コピー出力回路2
7、リピート出力回路28、またはデータ出力回路29
から復号データが出力される毎に、出力された復号デー
タを格納する。この結果、データレジスタ30には直前
の画素データが格納される。データレジスタ30はま
た、電源オン時に0に設定されるとともに、コマンドデ
コード回路23がEOBコマンドを復号したときに、コ
マンドデコード回路23からEOB信号を受信し、0を格
納する。この結果、符号データの各ブロックが開始する
ときには、データレジスタ30には0が格納されてい
る。
The data register 30 stores the copy output circuit 2
7. Repeat output circuit 28 or data output circuit 29
Each time the decrypted data is output from, the output decrypted data is stored. As a result, the immediately preceding pixel data is stored in the data register 30. The data register 30 is set to 0 when the power is turned on, and receives the EOB signal from the command decode circuit 23 and stores 0 when the command decode circuit 23 decodes the EOB command. As a result, when each block of the code data starts, 0 is stored in the data register 30.

【0056】ラインバッファ33は、少なくとも1ライ
ンの復号データを保持し、アドレスカウンタ32が保持
する現在のアドレスに、コピー出力回路27、リピート
出力回路28、またはデータ出力回路29から復号デー
タが出力される毎に、出力された復号データを格納す
る。この結果、ラインバッファ33には、直前のライン
の復号データが格納される。
The line buffer 33 holds at least one line of decoded data. The decoded data is output from the copy output circuit 27, the repeat output circuit 28, or the data output circuit 29 to the current address held by the address counter 32. Each time the data is output, the output decoded data is stored. As a result, the line buffer 33 stores the decoded data of the immediately preceding line.

【0057】アドレスカウンタ32は、ラインバッファ
33の、現在のアドレスを保持し、コピー出力回路2
7、リピート出力回路28、またはデータ出力回路29
から復号データが出力される毎にカウントアップし、ま
たその結果、ラインレングスレジスタ33が保持してい
る1ラインの画素数に達した場合は0に復帰する。ライ
ンレングスレジスタ33は、制御回路15があらかじめ
出力した、1ラインの画素数を保持する。
The address counter 32 holds the current address of the line buffer 33, and
7. Repeat output circuit 28 or data output circuit 29
The count is incremented each time the decoded data is output from. The result is that when the number of pixels of one line held by the line length register 33 has been reached, the count returns to zero. The line length register 33 holds the number of pixels of one line, which is output by the control circuit 15 in advance.

【0058】減算回路34は、コマンドデコード回路2
3がEOLコマンドを復号したときに、コマンドデコー
ド回路23からEOL信号を受信し、ラインレングスレジ
スタ33とアドレスカウンタ32の差を計算し、カウン
タ26に出力する。出力バッファ35は、コピー出力回
路27、リピート出力回路28、またはデータ出力回路
29から復号データが出力される毎に、出力された復号
データを格納する。出力バッファ35はまた、プリンタ
エンジン14から画像データの出力を要求されたとき
に、格納された復号データを出力する。
The subtraction circuit 34 is a command decoding circuit 2
3 decodes the EOL command, receives the EOL signal from the command decode circuit 23, calculates the difference between the line length register 33 and the address counter 32, and outputs the difference to the counter 26. The output buffer 35 stores the output decoded data every time the decoded data is output from the copy output circuit 27, the repeat output circuit 28, or the data output circuit 29. The output buffer 35 also outputs the stored decoded data when the printer engine 14 requests output of image data.

【0059】コマンドデコード回路24が、EOLコマ
ンドをデコードすると、減算回路34が計算したライン
レングスレジスタ33とアドレスカウンタ32の差、即
ち注目画素から行末までの画素数が、カウンタ26に格
納される。コピー出力回路27は、アドレスカウンタ2
3が示す、ラインバッファ33のデータ、即ち直上の画
素データを読み出し、出力バッファ35およびデータレ
ジスタ30に格納する。アドレスカウンタ32はカウン
トアップされ、カウンタ26はカウントダウンされる。
このようにして、カウンタ26が0に達するまで、復元
データの出力が行われる。
When the command decode circuit 24 decodes the EOL command, the difference between the line length register 33 and the address counter 32 calculated by the subtraction circuit 34, that is, the number of pixels from the target pixel to the end of the line is stored in the counter 26. The copy output circuit 27 includes an address counter 2
3, the data in the line buffer 33, that is, the pixel data immediately above, is read and stored in the output buffer 35 and the data register 30. The address counter 32 counts up, and the counter 26 counts down.
In this way, the output of the restored data is performed until the counter 26 reaches 0.

【0060】コマンドデコード回路24が、Copyコ
マンドをデコードすると、Copyコマンドが示す画素
数が、カウンタ26の下位に格納される。カウンタ26
の上位には、AddCountコマンドが先行しなかっ
た場合には0が、先行した場合にはAddCountコ
マンドが示す画素数の加算値が格納されている。コピー
出力回路27は、アドレスカウンタ23が示す、ライン
バッファ33のデータ、即ち直上の画素データを読み出
し、出力バッファ35およびデータレジスタ30に格納
する。アドレスカウンタ32はカウントアップされ、カ
ウンタ26はカウントダウンされる。このようにして、
カウンタ26が0に達するまで、復元データの出力が行
われる。
When the command decode circuit 24 decodes the copy command, the number of pixels indicated by the copy command is stored in the lower order of the counter 26. Counter 26
When the AddCount command does not precede, 0 is stored, and when the AddCount command precedes, the added value of the number of pixels indicated by the AddCount command is stored. The copy output circuit 27 reads the data of the line buffer 33 indicated by the address counter 23, that is, the pixel data immediately above, and stores the read data in the output buffer 35 and the data register 30. The address counter 32 counts up, and the counter 26 counts down. In this way,
Until the counter 26 reaches 0, output of restored data is performed.

【0061】コマンドデコード回路24が、Repea
tコマンドをデコードすると、Repeatコマンドが
示す画素数が、カウンタ26の下位に格納される。カウ
ンタ26の上位には、AddCountコマンドが先行
しなかった場合には0が、先行した場合にはAddCo
untコマンドが示す画素数の加算値が格納されてい
る。リピート出力回路28は、データレジスタ30に格
納された直前のデータを読み出し、出力バッファ35お
よびデータレジスタ30に格納する。アドレスカウンタ
32はカウントアップされ、カウンタ26はカウントダ
ウンされる。このようにして、カウンタ26が0に達す
るまで、復元データの出力が行われる。
The command decoding circuit 24
When the t command is decoded, the number of pixels indicated by the Repeat command is stored below the counter 26. When the AddCount command does not precede, the value of the counter 26 is 0.
The added value of the number of pixels indicated by the unt command is stored. The repeat output circuit 28 reads the immediately preceding data stored in the data register 30 and stores the data in the output buffer 35 and the data register 30. The address counter 32 counts up, and the counter 26 counts down. In this way, the output of the restored data is performed until the counter 26 reaches 0.

【0062】コマンドデコード回路24が、Pixel
Diffコマンドをデコードすると、データ出力回路2
9は、PixelDiffコマンドが示す直前の画素デ
ータとの差分値と、データレジスタ30に格納された直
前のデータとを加算し、出力バッファ35およびデータ
レジスタ30に格納する。アドレスカウンタ32はカウ
ントアップされる。
When the command decode circuit 24
When the Diff command is decoded, the data output circuit 2
9 adds the difference value between the immediately preceding pixel data indicated by the PixelDiff command and the immediately preceding data stored in the data register 30 and stores the result in the output buffer 35 and the data register 30. The address counter 32 is counted up.

【0063】<第2の実施形態>上記の第1の実施形態
では、ハードウェアの復号回路13を用いて復号を行っ
ているが、本第2の実施形態ではこれをソフトウェアで
行う点が異なる。なお、第2の実施形態における符号は
第1の実施形態における符号と同じであるものとする。
<Second Embodiment> In the above-described first embodiment, decoding is performed using the hardware decoding circuit 13. However, the second embodiment is different in that the decoding is performed by software. . The reference numerals in the second embodiment are the same as those in the first embodiment.

【0064】図7は第2実施形態におけるプリンタ6の
構成を示すブロック図である。図中、11はパラレルポ
ートであり、コンピュータ1からプリンタコマンドを受
信する。なお、コンピュータ1からのデータを受信でき
れば良いので、パラレルポートに限らず、各種インタフ
ェース(例えばUSBやイーサネット(登録商標)等)
を採用してもよい。16はメモリ(RAM)であり、パ
ラレルポート11が受信した符号化データを記憶すると
ともに、制御回路15が復号した画像データを格納する
ために用いる。プリンタエンジン14はレーザビームプ
リンタエンジンであり、制御回路15の指示により、メ
モリ16に格納された画像データに従って印刷を行う。
画像データはシアン、マゼンタ、黄、黒の各色ごとに面
順序で出力される。また、画素を構成する各色成分は8
ビットで構成され、それぞれが256階調を表現するこ
とができる。15は制御回路であり、例えば1チップC
PUで構成され、パラレルポート11、メモリ12、お
よびプリンタエンジン14の制御を行うとともに、後述
する復号手順に従って、メモリ16に格納された符号化
データを復号する。
FIG. 7 is a block diagram showing a configuration of the printer 6 according to the second embodiment. In the figure, a parallel port 11 receives a printer command from the computer 1. Since it is sufficient that data from the computer 1 can be received, not only the parallel port but also various interfaces (for example, USB, Ethernet (registered trademark), etc.)
May be adopted. A memory (RAM) 16 stores encoded data received by the parallel port 11 and stores image data decoded by the control circuit 15. The printer engine 14 is a laser beam printer engine, and performs printing in accordance with image data stored in the memory 16 according to an instruction from the control circuit 15.
The image data is output in plane order for each color of cyan, magenta, yellow, and black. Each color component constituting a pixel is 8
Each bit can represent 256 gradations. Reference numeral 15 denotes a control circuit, for example, one chip C
It is configured by a PU, controls the parallel port 11, the memory 12, and the printer engine 14, and decodes the encoded data stored in the memory 16 according to a decoding procedure described later.

【0065】図8は、符号の復号時に使用するデータ構
造の説明図である。符号列を先頭から1ビットずつ調べ
ていくことにより、どの符号であるか判定できるので、
あらかじめ図8に示す木構造の表を用意しておく。この
表は例えば制御回路15に内蔵されたリードオンリーメ
モリに格納しておくことができる。木構造を構成する各
ノードは、データビットが0であるときの子ノード0、
およびデータビットが1であるときの子ノード1の2つ
の子ノードを持つ。ただし、符号の最後に対応するノー
ドの場合は子ノードを持たない。
FIG. 8 is an explanatory diagram of a data structure used when decoding a code. By examining the code string one bit at a time from the beginning, it is possible to determine which code it is.
A table having a tree structure shown in FIG. 8 is prepared in advance. This table can be stored in, for example, a read-only memory built in the control circuit 15. Each node constituting the tree structure has a child node 0 when the data bit is 0,
And two child nodes of child node 1 when the data bit is 1. However, the node corresponding to the end of the code has no child node.

【0066】まず符号列を1ビット読み出し、根ノード
であるRootから、読み出したビットが0である場合
は子ノード0に、ビットが1である場合は子ノード1に
移動し、符号列の次のビットを読み出す。これを符号の
最後に到達するまで続ける。符号の最後に到達した場合
は、ノードに記憶されたコマンドを識別する番号を参照
するなどの方法により、符号に対応するコマンドを判定
することができる。例えば、符号列が「000」であっ
た場合、木構造を根(root)からたどると、「000」
を読み出した時点でCopy1コマンドに対応するノー
ドに到達するので、Copy1コマンドの処理を行えば
よい。
First, the code string is read by one bit, and from the root node Root, if the read bit is 0, the child node is moved to child node 0, and if the read bit is 1, the child node is moved to child node 1; Is read out. This continues until the end of the code is reached. If the end of the code has been reached, the command corresponding to the code can be determined by, for example, referring to a number for identifying the command stored in the node. For example, if the code string is “000”, the tree structure is traced from the root to “000”.
Is reached at the time point when the node corresponding to the Copy1 command is read, the processing of the Copy1 command may be performed.

【0067】次に、図9に示すフローチャートを参照
し、制御回路15が実行する復号手順の詳細を説明す
る。制御回路15は、1ブロックの符号化データを受信
し終えると図9に示す復号手順を呼び出す。
Next, the decoding procedure executed by the control circuit 15 will be described in detail with reference to the flowchart shown in FIG. When the control circuit 15 finishes receiving the encoded data of one block, it calls the decoding procedure shown in FIG.

【0068】まず、ステップS31にて初期化処理を行
う。具体的には、アドレスカウンタ、データカウンタ、
および最終データレジスタをともに0に設定する。次に
ステップS32にて、現在のノードを示すインデックス
(ポインタ)を、根(root)ノードに設定する。次にステ
ップS33にて符号列から1ビット読み出し、ステップ
S34にて読み出したビットを判定する。
First, an initialization process is performed in step S31. Specifically, an address counter, a data counter,
And the final data register are both set to 0. Next, in step S32, an index (pointer) indicating the current node is set to a root node. Next, one bit is read from the code string in step S33, and the bit read in step S34 is determined.

【0069】読み出したビットが0であればステップS
35に進み、インデックスを子ノード0に設定する。読
み出したビットが1であればステップS36に進み、イ
ンデックスを子ノード1に設定する。いずれの場合もス
テップS37に進み、インデックスにより示されたノー
ドがコマンドの最後に対応しているか判定する。インデ
ックスにより示されたノードがコマンドの最後に対応し
ていない場合には、ステップS33に戻り、符号列の読
み出しを続ける。このようにしてコマンドの最後に到達
すると、ステップS37からステップS38に進み、復
号したコマンドの種別を判定する。
If the read bit is 0, step S
Proceed to 35 to set the index to child node 0. If the read bit is 1, the process proceeds to step S36, and the index is set to the child node 1. In any case, the process proceeds to step S37 to determine whether the node indicated by the index corresponds to the end of the command. If the node indicated by the index does not correspond to the end of the command, the process returns to step S33 to continue reading the code string. When the end of the command is reached in this way, the process proceeds from step S37 to step S38, and the type of the decoded command is determined.

【0070】復号したコマンドがEOLコマンドであっ
た場合は、ステップS39にて複写する画素数を計算す
る。具体的には1ラインの画素数からアドレスカウンタ
の値を減算し、データカウンタに設定する。つぎにステ
ップS40にて、直前のラインから複写を行う。具体的
にはラインバッファ(メモリ16に予め確保しておい
く)の、アドレスカウンタが示す位置から、データカウ
ンタが示す画素数複写して出力し、データカウンタに0
を設定して、ステップS45に進む。
If the decoded command is an EOL command, the number of pixels to be copied is calculated in step S39. Specifically, the value of the address counter is subtracted from the number of pixels in one line, and the result is set in the data counter. Next, in step S40, copying is performed from the immediately preceding line. Specifically, the number of pixels indicated by the data counter is copied and output from the position indicated by the address counter in the line buffer (which is previously secured in the memory 16), and 0 is stored in the data counter.
Is set, and the process proceeds to step S45.

【0071】復号したコマンドがCopyコマンドであ
った場合は、ステップS41にて、直前のラインから複
写を行う。具体的には、データカウンタにCopyコマ
ンドが示す複写する画素数を加算し、ラインバッファ
の、アドレスカウンタが示す位置から、データカウンタ
が示す画素数複写して出力し、データカウンタに0を設
定して、ステップS45に進む。
If the decrypted command is a Copy command, copying is performed from the immediately preceding line in step S41. Specifically, the number of pixels to be copied indicated by the Copy command is added to the data counter, the number of pixels indicated by the data counter is copied and output from the position of the line buffer indicated by the address counter, and 0 is set to the data counter. Then, the process proceeds to step S45.

【0072】復号したコマンドがRepeatコマンド
であった場合は、ステップS42にて、直前のデータを
繰り返し出力する。具体的には、データカウンタにRe
peatコマンドが示す複写する画素数を加算し、最終
データレジスタの値を、データカウンタが示す画素数回
して出力すると同時に、ラインバッファの対応する位置
に格納し、データカウンタに0を設定して、ステップS
45に進む。
If the decoded command is a Repeat command, the immediately preceding data is repeatedly output in step S42. Specifically, the data counter has Re
The number of pixels to be copied indicated by the "peat" command is added, the value of the final data register is output by the number of pixels indicated by the data counter, and at the same time, the value is stored in the corresponding position of the line buffer. Step S
Proceed to 45.

【0073】復号したコマンドがPixelDiffコ
マンドであった場合は、ステップS44にて、最終デー
タに加算して出力する。具体的には、最終データレジス
タの値に、PixelDiffコマンドが示す差分値を
加算して出力し、ステップS45に進む。
If the decoded command is a PixelDiff command, it is added to the final data and output in step S44. Specifically, the difference value indicated by the PixelDiff command is added to the value of the last data register and output, and the process proceeds to step S45.

【0074】ステップS45に進むと、最後に出力した
データを最終データレジスタに格納し、また出力した画
素数に応じてアドレスカウンタをカウントアップする。
ここでアドレスカウンタが1ラインの画素数に達した場
合は、0を格納する。次にステップS32に戻り、次の
符号の復号を続ける。
In step S45, the last output data is stored in the final data register, and the address counter is counted up according to the number of output pixels.
Here, when the address counter reaches the number of pixels of one line, 0 is stored. Next, returning to step S32, decoding of the next code is continued.

【0075】ステップS38にて、復号したコマンドが
EOBコマンドであった場合は、復帰する。
If the decoded command is an EOB command in step S38, the process returns.

【0076】なお、上記実施形態では、カラー画像を例
にして説明したが、勿論、モノクロ(単色)印刷にも適
用できる。また、1画素、或いは1画素の色成分が8ビ
ットの例を示したが、これによって本願発明が限定され
るものではなく、例えば4ビットで表現しても構わな
い。
In the above embodiment, a color image has been described as an example. However, it is needless to say that the present invention can be applied to monochrome (single color) printing. Also, an example in which one pixel or a color component of one pixel has eight bits has been described. However, the present invention is not limited to this, and may be expressed by four bits, for example.

【0077】また、プリンタとしてレーザビームプリン
タに適用した例を示したが、印刷方式はこれに限るもの
ではなく、例えばインク液滴を吐出するタイプ、熱転写
タイプを採用したものに適用しても構わない。
Although an example in which the present invention is applied to a laser beam printer as a printer has been described, the printing method is not limited to this. For example, the present invention may be applied to a printer employing a type for discharging ink droplets or a thermal transfer type. Absent.

【0078】さらにまた、上記第1、第2の実施形態で
は、コンピュータとプリンタがダイレクトに接続される
例を示したが、ネットワークを介して接続されるように
しても実現できるものであるので、その接続形態は如何
なるものでも構わない。
Further, in the first and second embodiments, the example in which the computer and the printer are directly connected has been described. However, since the computer and the printer can be connected via a network, the present invention can be realized. The connection form may be of any type.

【0079】以上詳細に説明したように、多値画像を可
逆圧縮する際に、高い圧縮率を達成できるとともに、高
速に符号化および復元を行うことができ、さらに復元器
をハードウェアで構成した場合に小規模のハードウェア
で構成することができる。
As described in detail above, when losslessly compressing a multi-valued image, a high compression rate can be achieved, encoding and restoration can be performed at high speed, and a decompressor is constituted by hardware. In that case, it can be configured with small-scale hardware.

【0080】また、プリンタ側は、高度なページ記述言
語を解釈するインタプリタを搭載する必要もなく、コス
ト削減できると共に、通信のデータ量も少なくできるよ
うになる。
Further, the printer does not need to be equipped with an interpreter for interpreting a high-level page description language, so that the cost can be reduced and the amount of communication data can be reduced.

【0081】さらにまた、コンピュータ側で動作するプ
リンタドライバの実体は、ソフトウェアであるので、本
発明はコンピュータに外部よりプログラムをインストー
ルすることでも実現できるものである。プログラムを供
給する記憶媒体としては、フロッピーディスクやCD等
のメディアがあり、当然、インストール後に上記プリン
タドライバの機能を実現するプログラムコードを格納し
ているのであれば、これらの記憶媒体も本願発明に含ま
れる。
Further, the substance of the printer driver operating on the computer side is software, so that the present invention can also be realized by installing a program from outside the computer. The storage medium for supplying the program includes a medium such as a floppy disk or a CD. Naturally, if the program code for realizing the function of the printer driver after installation is stored, these storage mediums are also included in the present invention. included.

【0082】[0082]

【発明の効果】以上説明したように本発明によれば、多
値画像を高い圧縮率で可逆符号化し、または、この符号
を効率良く復号することが可能になる。
As described above, according to the present invention, it is possible to losslessly code a multi-valued image at a high compression rate or to decode this code efficiently.

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

【図1】実施形態におけるシステムブロック構成図であ
る。
FIG. 1 is a system block configuration diagram in an embodiment.

【図2】実施形態におけるプリンタのブロック構成図で
ある。
FIG. 2 is a block diagram of a printer according to the embodiment.

【図3】実施形態で採用する符号テーブルを示す図であ
る。
FIG. 3 is a diagram showing a code table used in the embodiment.

【図4】実施形態における符号及び復号の具体的な動作
を示す図である。
FIG. 4 is a diagram illustrating a specific operation of encoding and decoding in the embodiment.

【図5】実施形態におけるプリンタドライバの動作処理
手順を示すフローチャートである。
FIG. 5 is a flowchart illustrating an operation processing procedure of the printer driver according to the embodiment.

【図6】実施形態におけるプリンタ側の復号回路のブロ
ック構成図である。
FIG. 6 is a block diagram of a decoding circuit on the printer side in the embodiment.

【図7】第2の実施形態におけるプリンタのブロック構
成図である。
FIG. 7 is a block diagram of a printer according to a second embodiment.

【図8】第2の実施形態における復号処理で使用する木
構造表を示す図である。
FIG. 8 is a diagram illustrating a tree structure table used in a decoding process according to the second embodiment.

【図9】第2の実施形態におけるプリンタ側の復号化処
理手順を示すフローチャートである。
FIG. 9 is a flowchart illustrating a decryption processing procedure on the printer side according to the second embodiment.

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

1:コンピュータ 2:オペレーティングシステム 3:アプリケーション 4:プリンタドライバ 5:ポートドライバ 6:プリンタ 11:パラレルポート 12:FIFOメモリ 13:復号回路 14:プリンタエンジン 15:制御回路 1: Computer 2: Operating system 3: Application 4: Printer driver 5: Port driver 6: Printer 11: Parallel port 12: FIFO memory 13: Decoding circuit 14: Printer engine 15: Control circuit

───────────────────────────────────────────────────── フロントページの続き Fターム(参考) 2C087 AC07 AC08 BA02 BA03 BA07 BA12 BD13 BD14 BD40 5B021 AA01 BB02 BB12 CC05 5C078 AA04 BA22 BA32 DA01 DA02 DB13 5J064 AA02 BA01 BB01 BC01 BC05 BD07  ────────────────────────────────────────────────── ─── Continued on front page F term (reference) 2C087 AC07 AC08 BA02 BA03 BA07 BA12 BD13 BD14 BD40 5B021 AA01 BB02 BB12 CC05 5C078 AA04 BA22 BA32 DA01 DA02 DB13 5J064 AA02 BA01 BB01 BC01 BC05 BD07

Claims (20)

【特許請求の範囲】[Claims] 【請求項1】 出力対象の多値イメージデータを符号化
する符号化装置であって、 直前の画素の値がいくつ連続するかに応じた符号を発生
する連続画素符号化手段と、 直前の画素に対する差分値に対応する符号を発生する差
分値符号化手段と、 直前のライン中の走査方向に同じ位置から連続するデー
タを幾つ用いるかを示す符号を発生する前ライン参照符
号化手段と、 前記連続画素符号化手段、前記差分値符号化手段、及
び、前記前ライン参照符号化手段を適応的に用いて生成
した符号を出力する出力手段とを備えることを特徴とす
る符号化装置。
1. An encoding device for encoding multivalued image data to be output, comprising: a continuous pixel encoding means for generating a code corresponding to the number of consecutive values of the immediately preceding pixel; A difference value encoding means for generating a code corresponding to a difference value for the preceding line; a previous line reference encoding means for generating a code indicating how many consecutive data are used from the same position in the scanning direction in the immediately preceding line; An encoding apparatus comprising: continuous pixel encoding means; the difference value encoding means; and output means for outputting a code generated by adaptively using the previous line reference encoding means.
【請求項2】 更に、前記連続画素符号化手段及び前ラ
イン参照符号化手段における連続する画素数について、
所定数の整数倍単位の増加の補正を行うための符号を発
生する画素数補正符号化手段を備えることを特徴とする
請求項第1項に記載の符号化装置。
2. The number of continuous pixels in the continuous pixel encoding means and the preceding line reference encoding means,
2. The coding apparatus according to claim 1, further comprising a pixel number correction coding unit that generates a code for performing a correction of an increment of a predetermined number of integral multiples.
【請求項3】 更に、直前のラインの終端までのデータ
を用いることを示す符号を発生する手段を備えることを
特徴とする請求項第1項または第2項に記載の符号化装
置。
3. The encoding apparatus according to claim 1, further comprising means for generating a code indicating that data up to the end of the immediately preceding line is used.
【請求項4】 前記差分値符号化手段で発生する符号長
は、差分値のとり得る範囲内において上下限ほど短い符
号長の符号を発生することを特徴とする請求項第1項乃
至第3項のいずれか1項に記載の符号化装置。
4. The code length generated by said difference value coding means is such that a code length is shorter in upper and lower limits within a possible range of a difference value. An encoding device according to any one of the preceding claims.
【請求項5】 出力対象の多値イメージデータを符号化
する符号化方法であって、 直前の画素の値がいくつ連続するかに応じた符号を発生
する連続画素符号化工程と、 直前の画素に対する差分値に対応する符号を発生する差
分値符号化工程と、 直前のライン中の走査方向に同じ位置から連続するデー
タを幾つ用いるかを示す符号を発生する前ライン参照符
号化工程と、 前記連続画素符号化工程、前記差分値符号化工程、及
び、前記前ライン参照符号化工程を適応的に用いて生成
した符号を出力する出力工程とを備えることを特徴とす
る符号化方法。
5. An encoding method for encoding multivalued image data to be output, comprising: a continuous pixel encoding step of generating a code according to the number of consecutive values of the immediately preceding pixel; A difference value encoding step of generating a code corresponding to a difference value for; a previous line reference encoding step of generating a code indicating how many consecutive data are used from the same position in the scanning direction in the immediately preceding line; A coding method comprising: a continuous pixel coding step; a difference value coding step; and an output step of outputting a code generated by adaptively using the previous line reference coding step.
【請求項6】 更に、前記連続画素符号化工程及び前ラ
イン参照符号化工程における連続する画素数について、
所定数の整数倍単位の増加の補正を行う符号を発生する
画素数補正符号化工程を備えることを特徴とする請求項
第5項に記載の符号化方法。
6. The number of continuous pixels in the continuous pixel encoding step and the preceding line reference encoding step,
6. The encoding method according to claim 5, further comprising a pixel number correction encoding step of generating a code for correcting an increase by a predetermined integer multiple.
【請求項7】 更に、直前のラインの終端までのデータ
を用いることを示す符号を発生する工程を備えることを
特徴とする請求項第5項または第6項に記載の符号化方
法。
7. The encoding method according to claim 5, further comprising a step of generating a code indicating that data up to the end of the immediately preceding line is to be used.
【請求項8】 前記差分値符号化工程で発生する符号長
は、差分値のとり得る範囲内において上下限ほど短い符
号長の符号を発生することを特徴とする請求項第5項乃
至第7項のいずれか1項に記載の符号化方法。
8. The code length generated in the difference value encoding step is such that a code length is shorter in upper and lower limits within a range of a difference value. Item 7. The encoding method according to any one of the above items.
【請求項9】 コンピュータが読み込み実行することで
多値画像を符号化する装置として機能するプログラムで
あって、 直前の画素の値がいくつ連続するかに応じた符号を発生
する連続画素符号化工程のプログラムコードと、 直前の画素に対する差分値に対応する符号を発生する差
分値符号化工程のプログラムコードと、 直前のライン中の走査方向に同じ位置から連続するデー
タを幾つ用いるかを示す符号を発生する前ライン参照符
号化工程のプログラムコードと、 前記連続画素符号化工程、前記差分値符号化工程、及
び、前記前ライン参照符号化工程を適応的に用いて生成
した符号を出力する出力工程のプログラムコードとで構
成されることを特徴とするプログラム。
9. A program that functions as a device that encodes a multi-valued image by being read and executed by a computer, comprising: a continuous pixel encoding step of generating a code according to the number of consecutive values of the immediately preceding pixel. And a program code of a difference value encoding step for generating a code corresponding to a difference value with respect to the immediately preceding pixel, and a code indicating how many consecutive data are used from the same position in the scanning direction in the immediately preceding line. A program code of a preceding line reference encoding step to be generated; and an output step of outputting a code generated by adaptively using the continuous pixel encoding step, the difference value encoding step, and the preceding line reference encoding step. And a program code comprising:
【請求項10】 請求項第9項に記載のプログラムを格
納することを特徴とする記憶媒体。
10. A storage medium storing the program according to claim 9.
【請求項11】 請求項第1項に記載の符号化装置から
の符号を復号し多値画像を生成する復号装置であって、 復号した前ライン分の多値データを記憶するメモリと、 符号に従い、直前の画素の値を連続して複数の多値画素
群を発生する連続画素復号手段と、 符号に従い、直前の画素に対する差分値を加算すること
で多値画素を復号する差分値復号手段と、 符号に従い、前記メモリに格納された直前のライン中の
走査方向に同じ位置から連続して複数の多値画素を発生
する前ライン参照復号手段と、 前記連続画素復号手段、前記差分値復号手段、前記前ラ
イン参照復号手段を適応的に用いて多値画素データを生
成し、多値画像データとして出力する出力手段とを備え
ることを特徴とする復号装置。
11. A decoding device for decoding a code from the encoding device according to claim 1 to generate a multi-valued image, comprising: a memory for storing decoded multi-valued data for a previous line; And a continuous pixel decoding means for generating a plurality of multi-valued pixel groups by successively generating the value of the immediately preceding pixel, and a difference value decoding means for decoding the multi-valued pixel by adding the difference value to the immediately preceding pixel according to the sign A preceding line reference decoding means for continuously generating a plurality of multi-valued pixels from the same position in the scanning direction in the immediately preceding line stored in the memory according to the code, the continuous pixel decoding means, and the difference value decoding Means for generating multi-valued pixel data by adaptively using the preceding line reference decoding means and outputting the same as multi-valued image data.
【請求項12】 更に、与えられる符号列のビットの並
びに従い、前記連続画素復号手段、前記差分値復号手
段、或いは、前記前ライン参照復号手段のいずれで復号
すべきかを判別するための2分木構造の判別テーブルを
備えることを特徴とする請求項第11項に記載の復号装
置。
12. Further, according to an arrangement of bits of a given code string, a binary code for determining which of the continuous pixel decoding means, the difference value decoding means, and the preceding line reference decoding means should perform decoding. The decoding apparatus according to claim 11, further comprising a tree structure determination table.
【請求項13】 コンピュータと通信可能な印刷装置で
あって、 請求項第11項または第12項に記載の復号装置を有
し、ホストコンピュータより受信した符号を復号して記
録媒体上に印刷することを特徴とする印刷装置。
13. A printing device capable of communicating with a computer, comprising a decoding device according to claim 11, decoding a code received from a host computer and printing it on a recording medium. A printing device, characterized by:
【請求項14】 請求項第5項に記載の符号化方法で符
号化されたデータに基づいて多値画像に復号する復号方
法であって、 符号に従い、直前の画素の値を連続して複数の多値画素
群を発生する連続画素復号工程と、 符号に従い、直前の画素に対する差分値を加算すること
で多値画素を復号する差分値復号工程と、 符号に従い、前ラインのデータを格納している所定のメ
モリに格納された直前のライン中の走査方向に同じ位置
から連続して複数の多値画素を発生する前ライン参照復
号工程と、 前記連続画素復号工程、前記差分値復号工程、前記前ラ
イン参照復号工程を適応的に用いて多値画素データを生
成し、多値画像データとして出力する出力工程とを備え
ることを特徴とする復号方法。
14. A decoding method for decoding into a multi-valued image based on data encoded by the encoding method according to claim 5, wherein a plurality of values of the immediately preceding pixel are continuously obtained according to the code. A continuous pixel decoding step of generating a multi-valued pixel group of; a difference value decoding step of decoding a multi-valued pixel by adding a difference value to the immediately preceding pixel according to the sign; and storing data of the previous line according to the sign. A preceding line reference decoding step of continuously generating a plurality of multi-valued pixels from the same position in the scanning direction in the immediately preceding line stored in the predetermined memory, the continuous pixel decoding step, the difference value decoding step, An output step of adaptively using the preceding line reference decoding step to generate multi-valued pixel data and outputting the same as multi-valued image data.
【請求項15】 更に、与えられる符号列のビットの並
びに従い、前記連続画素復号工程、前記差分値復号工
程、或いは、前記前ライン参照復号工程のいずれで復号
すべきかを判別するための2分木構造の判別テーブルを
参照して、いずれかの復号工程を実行するかを決定する
ことを特徴とする請求項第14項に記載の復号方法。
15. A binary code for determining which of the continuous pixel decoding step, the difference value decoding step, and the preceding line reference decoding step to decode in accordance with the arrangement of bits of a given code string. 15. The decoding method according to claim 14, wherein it is determined which one of the decoding steps is to be performed by referring to the tree structure determination table.
【請求項16】 コンピュータにインストールされ、当
該コンピュータと通信可能な印刷装置用の符号化された
印刷データを生成するプリンタドライバであって、 直前の画素の値がいくつ連続するかに応じた符号を発生
する連続画素符号化工程のプログラムコードと、 直前の画素に対する差分値に対応する符号を発生する差
分値符号化工程のプログラムコードと、 直前のライン中の走査方向に同じ位置から連続するデー
タを幾つ用いるかを示す符号を発生する前ライン参照符
号化工程のプログラムコードと、 前記連続画素符号化工程、前記差分値符号化工程、及
び、前記前ライン参照符号化工程を適応的に用いて生成
した符号を前記印刷装置用のデータとして出力する出力
工程のプログラムコードで構成されることを特徴とする
プリンタドライバ。
16. A printer driver which is installed in a computer and generates encoded print data for a printing device capable of communicating with the computer, wherein the printer driver generates a code corresponding to the number of consecutive pixels immediately before. The program code of the consecutive pixel encoding process that occurs, the program code of the difference value encoding process that generates a code corresponding to the difference value with respect to the immediately preceding pixel, and the data that is continuous from the same position in the scanning direction in the previous line are A program code of a previous line reference encoding step for generating a code indicating how many codes to use, and a code generated by adaptively using the continuous pixel encoding step, the difference value encoding step, and the previous line reference encoding step Characterized by comprising a program code of an output step of outputting the code obtained as data for the printing apparatus. Iba.
【請求項17】 更に、前記連続画素符号化工程及び前
ライン参照符号化工程における連続する画素数につい
て、所定数の整数倍単位の増加の補正を行うための符号
を発生する画素数補正符号化工程のプログラムコードを
有することを特徴とする請求項第16項に記載のプリン
タドライバ。
17. A pixel number correction encoding for generating a code for correcting an increase of a predetermined number by an integral multiple of a continuous number of pixels in the continuous pixel encoding step and the preceding line reference encoding step. 17. The printer driver according to claim 16, comprising a program code of a process.
【請求項18】 更に、直前のラインの終端までのデー
タを用いることを示す符号を発生する工程のプログラム
コードを備えることを特徴とする請求項第16項または
第17項に記載のプリンタドライバ。
18. The printer driver according to claim 16, further comprising a program code for generating a code indicating that data up to the end of the immediately preceding line is used.
【請求項19】 前記差分値符号化工程で発生する符号
長は、差分値のとり得る範囲内において上下限ほど短い
符号長の符号を発生することを特徴とする請求項第16
項乃至第18項のいずれか1項に記載のプリンタドライ
バ。
19. The code length generated in the difference value encoding step is such that a code length is shorter in upper and lower limits within a range that the difference value can take.
Item 19. The printer driver according to any one of items 18 to 18.
【請求項20】 請求項第16項乃至第19項のいずれ
か1項に記載のプリンタドライバのプログラムを格納す
ることを特徴とする記憶媒体。
20. A storage medium storing the printer driver program according to claim 16. Description:
JP2001020684A 2001-01-29 2001-01-29 Encoding device and method, decoding device and method, storage medium, printer driver and storage medium for storing the same Withdrawn JP2002223360A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001020684A JP2002223360A (en) 2001-01-29 2001-01-29 Encoding device and method, decoding device and method, storage medium, printer driver and storage medium for storing the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001020684A JP2002223360A (en) 2001-01-29 2001-01-29 Encoding device and method, decoding device and method, storage medium, printer driver and storage medium for storing the same

Publications (1)

Publication Number Publication Date
JP2002223360A true JP2002223360A (en) 2002-08-09

Family

ID=18886358

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001020684A Withdrawn JP2002223360A (en) 2001-01-29 2001-01-29 Encoding device and method, decoding device and method, storage medium, printer driver and storage medium for storing the same

Country Status (1)

Country Link
JP (1) JP2002223360A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2031856A1 (en) 2007-08-31 2009-03-04 Canon Kabushiki Kaisha Image decoding apparatus and method
US7684629B2 (en) 2004-01-26 2010-03-23 Fujifilm Corporation Data compression apparatus, and data compression program storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7684629B2 (en) 2004-01-26 2010-03-23 Fujifilm Corporation Data compression apparatus, and data compression program storage medium
EP2031856A1 (en) 2007-08-31 2009-03-04 Canon Kabushiki Kaisha Image decoding apparatus and method
JP2009060444A (en) * 2007-08-31 2009-03-19 Canon Inc Image decoding apparatus and method, and recording device
US8351719B2 (en) 2007-08-31 2013-01-08 Canon Kabushiki Kaisha Image decoding apparatus, image decoding method, and printing apparatus

Similar Documents

Publication Publication Date Title
JP3400944B2 (en) Method of generating merged data elements and its print data processing pipeline
US5915079A (en) Multi-path data processing pipeline
US5940585A (en) Data merge unit
US20030107753A1 (en) Image processing apparatus and method, program, and storage medium
JP3843581B2 (en) Image encoding device, image decoding device, image processing device, image encoding method, image decoding method, and image processing method
JP2007082235A (en) Image data compressor and compressing method
US5729625A (en) Image processing method and apparatus which expand a pixel into multiple pixels, with a change in the number of gray levels
JP3461309B2 (en) Huffman coded data compression device
JP2006121645A (en) Image compression apparatus and image compression program
US8014622B2 (en) Image processing apparatus and method for attribute data encoding
JP2001069358A (en) Picture processor, its processing method and storage medium
US20010043747A1 (en) Signal processing equipment
JP2006238291A (en) Coding processing method of color image information, decoding processing method and printer using the same
JP4173505B2 (en) Data compression apparatus and data compression program
JP2003250053A (en) Image encoder, image decoder, image encoding method, image decoding method, program, and storage medium
JP2002223360A (en) Encoding device and method, decoding device and method, storage medium, printer driver and storage medium for storing the same
JP3970007B2 (en) Image processing apparatus, image processing method, program, and storage medium
JP2002043950A (en) Coding method and device, and decoding method and device
US7414757B2 (en) Method for compressing printing hint data sent to a printer
JP2618944B2 (en) Coding method of color image information
JP4377351B2 (en) Data compression apparatus and data compression program
JP3743471B2 (en) Printing system, printing apparatus and printing control apparatus
JP7110962B2 (en) Image processing method and image processing apparatus
JP2003174561A (en) Image processor, image processing method, program and storage medium
JPH0937081A (en) Device and method for processing picture

Legal Events

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

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20080401