JP2003244448A - Encoding method and decoding method - Google Patents

Encoding method and decoding method

Info

Publication number
JP2003244448A
JP2003244448A JP2002038132A JP2002038132A JP2003244448A JP 2003244448 A JP2003244448 A JP 2003244448A JP 2002038132 A JP2002038132 A JP 2002038132A JP 2002038132 A JP2002038132 A JP 2002038132A JP 2003244448 A JP2003244448 A JP 2003244448A
Authority
JP
Japan
Prior art keywords
image data
command
encoding
data
code
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
JP2002038132A
Other languages
Japanese (ja)
Other versions
JP2003244448A5 (en
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 JP2002038132A priority Critical patent/JP2003244448A/en
Priority to EP02258367.8A priority patent/EP1318665B1/en
Priority to CN 200810094578 priority patent/CN101282405B/en
Priority to CNB02155529XA priority patent/CN100397866C/en
Priority to CN 200810097396 priority patent/CN101282406B/en
Priority to CN2008100973975A priority patent/CN101282407B/en
Priority to US10/310,812 priority patent/US7245396B2/en
Publication of JP2003244448A publication Critical patent/JP2003244448A/en
Publication of JP2003244448A5 publication Critical patent/JP2003244448A5/ja
Pending legal-status Critical Current

Links

Landscapes

  • Compression Of Band Width Or Redundancy In Fax (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an encoding method in which image data having a background pattern can be well compressed even when the background pattern is less correlated with nearby image data in the case of compressing the image data. <P>SOLUTION: As the encoding method for encoding the image data for a plurality of pages, this method is provided with a first memory for storing image data on a page to be encoded, an encoding means for encoding the image data stored in the first memory and a second memory for storing image data on the previous page and the encoding means performs encoding while referring to the image data on the previous page stored in the second memory. <P>COPYRIGHT: (C)2003,JPO

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、同一の背景パター
ンを有する複数のページの画像データを圧縮するために
符号化し、又、その符号を復号する符号化方法及び復号
方法に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an encoding method and an encoding method for encoding image data of a plurality of pages having the same background pattern for compression and decoding the code.

【0002】[0002]

【従来の技術】従来の圧縮技術では、例えばランレング
ス符号或はデルタロウ符号のように、画像データが左隣
或は上隣のような近隣のデータと同じ画素値になる傾向
が強いことを利用して、同一ページ内の近隣の画像デー
タを参照し、同一であれば圧縮する符号化方法が一般的
である。
2. Description of the Related Art In the conventional compression technique, it is used that image data has a strong tendency to have the same pixel value as neighboring data such as left adjacent or upper adjacent, such as run length code or delta row code. Then, an encoding method is generally used in which neighboring image data in the same page are referred to and if they are the same, compression is performed.

【0003】壁紙或はテクスチャ等と呼ばれる背景パタ
ーンに重ねて文字や図形等を出力するアプリケーション
プログラムが出力する印刷データを画像データに展開し
て印刷する場合において、データサイズを小さくするた
めにこの画像データを圧縮する場合、背景パターン自体
が良く圧縮できる場合は画像データ全体を良く圧縮する
ことは容易である。
When print data output by an application program that outputs characters or figures overlaid on a background pattern called wallpaper or texture is expanded into image data and printed, this image is used to reduce the data size. When compressing data, if the background pattern itself can be compressed well, it is easy to compress the entire image data well.

【0004】[0004]

【発明が解決しようとする課題】しかしながら、背景パ
ターンそれ自体が余り圧縮できない場合も多く、そのよ
うな場合には画像データ全体を良く圧縮することは必ず
しも容易ではない。
However, in many cases, the background pattern itself cannot be compressed so much, and in such a case, it is not always easy to compress the entire image data well.

【0005】図10はそのような印刷データの一例であ
り、従来技術では、文字の部分の画像データは良く圧縮
することができるが、背景パターンの部分の画像データ
は不規則なパターンを有し、近隣の画像データとの相関
が低いため、余り良く圧縮することができない。背景パ
ターンは一般的に面積が広いため、ページ全体に占める
割合が高く、背景パターンが良く圧縮できない場合には
ページ全体も又良く圧縮することができない。
FIG. 10 is an example of such print data. In the prior art, the image data of the character portion can be compressed well, but the image data of the background pattern portion has an irregular pattern. , It cannot be compressed very well because the correlation with the neighboring image data is low. Since the background pattern generally has a large area, it occupies a large proportion in the entire page, and if the background pattern cannot be compressed well, the entire page cannot be compressed well either.

【0006】本発明は上記問題に鑑みてなされたもの
で、その目的とする処は、背景パターンを有する画像デ
ータを圧縮する際に、背景パターンが近隣の画像データ
との相関が低い場合であっても、良く圧縮することがで
きる符号化方法及びその符号を復号する復号方法を提供
することにある。
The present invention has been made in view of the above problems, and an object of the present invention is, when compressing image data having a background pattern, a background pattern having a low correlation with neighboring image data. Even so, an object of the present invention is to provide an encoding method that can be well compressed and a decoding method that decodes the code.

【0007】[0007]

【課題を解決するための手段】上記目的を達成するた
め、本発明は、複数ページの画像データを符号化する符
号化方法において、符号化しようとするページの画像デ
ータを格納する第1のメモリと、前記第1のメモリに格
納された画像データを符号化する符号化手段と、直前の
ページの画像データを格納する第2のメモリとを備え、
前記符号化手段は前記第2のメモリに格納された直前の
ページの画像データを参照して符号化を行うことを特徴
とする。
To achieve the above object, the present invention provides a first memory for storing image data of a page to be encoded in an encoding method for encoding image data of a plurality of pages. An encoding unit that encodes the image data stored in the first memory, and a second memory that stores the image data of the immediately preceding page,
The encoding means performs encoding by referring to the image data of the immediately preceding page stored in the second memory.

【0008】又、本発明は、複数ページの画像データを
符号化した符号を復号する復号方法において、符号を復
号する復号手段と、前記復号手段により復号された画像
データを格納する第1のメモリと、前記第1のメモリに
格納された画像データを符号化する再符号化手段と、前
記再符号化手段により符号化された符号を格納する第2
のメモリと、前記第2のメモリに格納された符号を復号
する再復号手段とを備え、前記復号手段は直前のページ
の画像データを参照する符号を復号した場合には前記再
復号手段が復号した画像データを参照して復号するとと
もに、前記再符号化手段は符号化しようとするページの
画像データのみを参照して符号化を行うことを特徴とす
る。
Further, according to the present invention, in a decoding method for decoding a code obtained by coding image data of a plurality of pages, a decoding means for decoding the code and a first memory for storing the image data decoded by the decoding means. A re-encoding unit that encodes the image data stored in the first memory; and a second unit that stores the code encoded by the re-encoding unit.
Memory and re-decoding means for decoding the code stored in the second memory, and when the decoding means decodes the code that refers to the image data of the immediately preceding page, the re-decoding means decodes the code. The above-mentioned image data is referred to for decoding, and the re-encoding means performs encoding by referring to only the image data of the page to be encoded.

【0009】[0009]

【発明の実施の形態】以下に本発明の実施の形態を添付
図面に基づいて説明する。
BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of the present invention will be described below with reference to the accompanying drawings.

【0010】<実施の形態1>図1は本発明装置の構成
を示すブロック図である。図中、1はコンピュータであ
り、CPU、メモリ、ハードディスク、フロッピー(登
録商標)ディスクドライブ、キーボード、マウス、モニ
タ、パラレルポート等のハードウェア(不図示)を備え
る。2はオペレーティングシステムであり、コンピュー
タ1が備えるハードウェア、アプリケーション3、プリ
ンタドライバ4、ポートドライバ5等のソフトウェアを
管理する。アプリケーション3は、例えばワードプロセ
ッサのようなアプリケーションソフトウェアであり、操
作者の指示に従って文書の作成・印刷等を行う。
<Embodiment 1> FIG. 1 is a block diagram showing the configuration of the device of the present invention. In the figure, reference numeral 1 denotes a computer, which includes hardware (not shown) 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. Reference numeral 2 denotes an operating system, which manages the hardware of the computer 1, software such as applications 3, printer drivers 4, and port drivers 5. The application 3 is, for example, application software such as a word processor, and creates and prints a document according to an instruction from the operator.

【0011】4はプリンタドライバであり、アプリケー
ション3が発行した印刷指令をオペレーティングシステ
ム2を経て受け取り、該印刷指令をプリンタ6が解釈可
能なプリンタコマンドに変換する。5はポートドライバ
であり、プリンタドライバ4が変換したプリンタコマン
ドをオペレーティングシステム2を経て受け取り、パラ
レルポートを経由してプリンタ6に送信する。6はプリ
ンタであり、ポートドライバ5から受信したプリンタコ
マンドに従って印刷を行う。
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 interpretable by the printer 6. A port driver 5 receives the printer command converted by the printer driver 4 via the operating system 2 and sends it to the printer 6 via the parallel port. A printer 6 prints according to a printer command received from the port driver 5.

【0012】図2はプリンタ6の構成を示すブロック図
である。
FIG. 2 is a block diagram showing the configuration of the printer 6.

【0013】図2において、11はパラレルポートであ
り、コンピュータ1からプリンタコマンドを受信する。
12はFIFO(ファーストインファーストアウト)メ
モリであり、パラレルポート11が受信した符号化デー
タを記憶し、記憶したデータを先入れ先出しの順に復号
回路13に出力する。復号回路13は、FIFOメモリ
12に記憶された符号列データを復号し、プリンタエン
ジン14及び再符号化回路17に出力する。プリンタエ
ンジン14はレーザビームプリンタエンジンであり、制
御回路15の指示により、復号回路13が出力した画像
データに従って印刷を行う。
In FIG. 2, reference numeral 11 is a parallel port, which receives a printer command from the computer 1.
A FIFO (first in first out) memory 12 stores the encoded data received by the parallel port 11, and outputs the stored data 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 and the re-encoding circuit 17. The printer engine 14 is a laser beam printer engine, and prints according to the image data output by the decoding circuit 13 according to an instruction from the control circuit 15.

【0014】15は制御回路であり、例えば1チップC
PUで構成され、パラレルポート11、FIFOメモリ
12、復号回路13、再符号化回路17、ページメモリ
18、再復号回路19及びプリンタエンジン14の制御
を行う。17は再符号化回路であり、復号回路13から
出力された画像データを符号化して出力する。18はペ
ージメモリであり、再符号化回路17が出力した少なく
とも1ページの符号を格納する。19は再復号回路であ
り、再符号化回路17によって符号化されてページメモ
リ18に格納された符号を復号し出力する。
Reference numeral 15 is a control circuit, for example, one chip C
It is composed of a PU and controls the parallel port 11, the FIFO memory 12, the decoding circuit 13, the re-encoding circuit 17, the page memory 18, the re-decoding circuit 19 and the printer engine 14. A re-encoding circuit 17 encodes the image data output from the decoding circuit 13 and outputs the encoded image data. A page memory 18 stores the code of at least one page output from the re-encoding circuit 17. A re-decoding circuit 19 decodes and outputs the code encoded by the re-encoding circuit 17 and stored in the page memory 18.

【0015】以下、印刷動作について説明する。The printing operation will be described below.

【0016】操作者がコンピュータ1側でアプリケーシ
ョン3を操作して印刷データを生成し、これを印刷指示
すると、アプリケーション3からオペレーティングシス
テム2を経由してプリンタドライバ4に印刷指令が渡さ
れる。プリンタドライバ4はアプリケーション3から発
行された印刷指令に基づき、画像データに変換する。そ
して、プリンタドライバ3は、後述する符号化手順に基
づき、作成した画像データから符号化データを生成し、
用紙サイズ、ビットマップデータのラインの長さとライ
ン数等を指定する印刷制御コマンド、圧縮パラメタを指
定する圧縮パラメタ指定コマンド、ページ終了を示す改
ページコマンドと共に出力する。
When the operator operates the application 3 on the computer 1 side to generate print data and gives a print instruction to the print data, the print instruction is passed from the application 3 to the printer driver 4 via the operating system 2. The printer driver 4 converts the image data into image data based on the print command issued from the application 3. Then, the printer driver 3 generates coded data from the created image data based on a coding procedure described later,
It is output together with a print control command that specifies the paper size, the line length and the number of lines of bitmap data, a compression parameter specification command that specifies compression parameters, and a page break command that indicates the end of a page.

【0017】ポートドライバ5は、プリンタドライバ3
が作成した一連のプリンタコマンドをプリンタ6に送信
する。制御回路15はパラレルポート11を経由してプ
リンタコマンドを受信する。受信したプリンタコマンド
が印刷制御コマンド又は圧縮パラメタ指定コマンドであ
れば、印刷制御のために制御回路15の内部に保持す
る。又、受信したプリンタコマンドが符号化データであ
った場合は、FIFOメモリ12に格納する。その後、
ページ終了コマンドの受信により、1ページを構成する
プリンタコマンドの受信が完了したことを検出したとき
に、プリンタエンジン14に印刷の開始を指示する。印
刷の開始が指示されると、プリンタエンジン14は画像
データを受け入れ可能になったときに、復号回路13に
画像データの出力を要求する。
The port driver 5 is the printer driver 3
Sends a series of printer commands created by the printer 6 to the printer 6. The control circuit 15 receives the printer command via the parallel port 11. If the received printer command is a print control command or a compression parameter designation 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. afterwards,
When the completion of receiving the printer command forming one page is detected by receiving the page end command, the printer engine 14 is instructed to start printing. When the start of printing is instructed, the printer engine 14 requests the decoding circuit 13 to output image data when it becomes possible to accept the image data.

【0018】復号回路13は、プリンタエンジン14に
画像データの出力を要求されている場合には、FIFO
メモリ12から符号化データを読み出し、復号した画像
データをプリンタエンジン14に出力する。このように
して符号化データは順次復号されて画像データとして出
力され、画像データの出力が全て終了すると、1ページ
の印刷が完了する。
When the printer engine 14 is requested to output the image data, the decoding circuit 13 uses the FIFO.
The encoded data is read from the memory 12 and the decoded image data is output to the printer engine 14. In this way, the encoded data is sequentially decoded and output as image data, and when the output of the image data is completed, the printing of one page is completed.

【0019】再符号化回路17は、復号回路13が画像
データを出力するたびに、出力された画像データを符号
化する。再符号化回路17が行う符号化処理は、前ペー
ジのデータを参照せずに該ページのデータのみを参照し
て符号化する符号化処理であればどのようなものでも良
く、例えば左隣のみ、上隣のみ、左隣と上隣の双方、或
は所定のバイト数左の位置及び所定のライン数上の位置
のデータを参照して符号化する。再符号化回路17によ
り符号化された符号はページメモリ18に格納される。
こうして1ページの印刷が完了したときには、ページメ
モリ18には印刷されたページの画像データが符号化さ
れて格納されている。
The re-encoding circuit 17 encodes the output image data every time the decoding circuit 13 outputs the image data. The encoding process performed by the re-encoding circuit 17 may be any encoding process as long as the encoding process is performed by referring to only the data of the previous page without referring to the data of the previous page. , The data is encoded only by referring to the data on the upper side only, on both the left side and the upper side, or on the left side by a predetermined number of bytes and the position on a predetermined number of lines. The code encoded by the re-encoding circuit 17 is stored in the page memory 18.
When the printing of one page is completed in this way, the image data of the printed page is encoded and stored in the page memory 18.

【0020】続いて2ページ目を構成するプリンタコマ
ンドの受信が完了すると同様に印刷が開始され、画像デ
ータは順次プリンタエンジン14に出力されるととも
に、再符号化回路17により符号化されてページメモリ
18に格納される。又、再復号回路19は、2ページ目
の印刷が起動される前に、制御回路15の指示により動
作を開始し、ページメモリ18に格納されている、直前
のページの画像データを符号化した符号を読み取り、復
号する。読み取られた符号が格納されていた領域は空き
領域となる。
Subsequently, when the reception of the printer command forming the second page is completed, printing is started in the same manner, and the image data is sequentially output to the printer engine 14 and encoded by the re-encoding circuit 17 to be page memory. 18 is stored. Further, the re-decoding circuit 19 starts the operation according to the instruction of the control circuit 15 before the printing of the second page is started, and encodes the image data of the immediately preceding page stored in the page memory 18. Read and decode the code. The area where the read code is stored becomes an empty area.

【0021】再復号回路19は、復号回路13が画像デ
ータを出力するのに歩調を合わせて復号したデータを出
力する。このデータは、復号回路13が直前のページの
画像データを参照する符号を復号した場合には参照デー
タとして使用され、それ以外の場合には使用されずに捨
てられる。
The re-decoding circuit 19 outputs the data decoded by the decoding circuit 13 in step with the output of the image data. This data is used as reference data when the decoding circuit 13 decodes a code that refers to the image data of the previous page, and is discarded without being used otherwise.

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

【0023】図3は図2に示したプリンタドライバ4が
生成する符号の一例を示す図である。本実施の形態で説
明する符号は、所定ライン上のラインのデータ列を複写
する上複写、同一ラインの所定バイト左のデータ列を複
写する左複写、前ページ同一位置のデータ列を複写する
前ページ複写及びデータを直接指定する生データの4種
類の操作のうち、1つを指定する。尚、上複写及び左複
写が参照する所定の位置は、2値化に使用したディザマ
トリクスの周期に応じた値である。
FIG. 3 is a diagram showing an example of codes generated by the printer driver 4 shown in FIG. The codes described in the present embodiment are: upper copy for copying a data string of a line on a predetermined line, left copy for copying a data string of a predetermined byte left of the same line, and before copying a data string at the same position on the previous page. One of four types of operations of page copy and raw data for directly specifying data is specified. The predetermined position referred to by the upper copy and the left copy has a value corresponding to the cycle of the dither matrix used for binarization.

【0024】図3に示すように、コマンドコードのビッ
トが「0」の場合はRAWコマンドであり、引き続く8
ビットのデータをそのまま生データとして指定する。
As shown in FIG. 3, when the bit of the command code is "0", it is a RAW command, and the subsequent 8
Specify the bit data as it is as raw data.

【0025】又、コマンドコードのビットが「10」の
場合は、COPY UPコマンドであり、引き続くカウ
ント符号が示すバイト数だけ上複写を行う。
When the bit of the command code is "10", the command is a COPY UP command, and the upper copy is performed by the number of bytes indicated by the subsequent count code.

【0026】又、コマンドコードのビットが「110」
の場合は、COPY LEFTコマンドであり、引き続
くカウント符号が示すバイト数だけ複写を行う。
The command code bit is "110".
In the case of, the command is a COPY LEFT command, and copying is performed by the number of bytes indicated by the subsequent count code.

【0027】又、コマンドコードのビットが「111
0」の場合は、COPY PREVIOUS PAGE
コマンドであり、引き続くカウント符号が示すバイト数
だけ前ページ複写を行う。
The command code bit is "111".
If "0", COPY PREVIOUS PAGE
This is a command, and the previous page is copied by the number of bytes indicated by the subsequent count code.

【0028】又、コマンドコードのビットが「1111
0」の場合は、COUNT HIGHコマンドであり、
引き続くカウント符号が示す数の64倍を後続するCO
PYUP,COPY LEFTまたはCOPY PRE
VIOUS PAGEコマンドのカウントに加算するこ
とを示す。
The command code bit is "1111".
If it is "0", it is a COUNT HIGH command,
CO that is 64 times the number indicated by the subsequent count code
PYUP, COPY LEFT or COPY PRE
Indicates addition to the VIOUS PAGE command count.

【0029】又、コマンドコードのビットが「1111
1」の場合は、EOBコマンドであり、符号列の終了を
示す。
Further, the bit of the command code is "1111".
In the case of "1", it is an EOB command and indicates the end of the code string.

【0030】図4は図3に示した符号に引き続くカウン
ト符号の一例を示す。
FIG. 4 shows an example of a count code following the code shown in FIG.

【0031】図に示すように、カウントコードのビット
が「111111」の場合は,COUNT0符号であ
り、カウントが0であることを示す。
As shown in the figure, when the bit of the count code is "111111", it is the COUNT0 code, which indicates that the count is zero.

【0032】又、カウントコードのビットが「0」の場
合は、COUNT1符号であり、カウントが1であるこ
とを示す。
When the bit of the count code is "0", it is the COUNT1 code, which means that the count is 1.

【0033】又、カウントコードのビットが「10」の
場合は、COUNT2−3符号であり、カウントが引き
続く1ビットに2を加算した値であることを示す。
When the bit of the count code is "10", it is a COUNT2-3 code, and it indicates that the count is a value obtained by adding 2 to the subsequent 1 bit.

【0034】又、カウントコードのビットが「110」
の場合は、COUNT4−7符号であり、カウントが引
き続く2ビットに4を加算した値であることを示す。
Further, the bit of the count code is "110".
In the case of, it is a COUNT4-7 code, and indicates that the count is a value obtained by adding 4 to the subsequent 2 bits.

【0035】又、カウントコードのビットが「111
0」の場合は、COUNT8−15符号であり、カウン
トが引き続く3ビットに8を加算した値であることを示
す。
The bit of the count code is "111".
In the case of "0", it is a COUNT8-15 code and indicates that the count is a value obtained by adding 8 to the following 3 bits.

【0036】又、カウントコードのビットが「1111
0」の場合は、COUNT16−31符号であり、カウ
ントが引き続く4ビットに16を加算した値であること
を示す。
The bit of the count code is "1111".
In the case of "0", it is a COUNT16-31 code, and indicates that the count is a value obtained by adding 16 to the following 4 bits.

【0037】又、カウントコードのビットが「1111
10」の場合は、COUNT32−63符号であり、カ
ウントが引き続く5ビットに32を加算した値であるこ
とを示す。
The bit of the count code is "1111".
In the case of "10", it is a COUNT 32-63 code, and indicates that the count is a value obtained by adding 32 to the following 5 bits.

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

【0039】符号列「00000000 011001
01 01111101 00111011 1111
1111 10000000」は図5に示すように解釈
される。先ず、先頭の「0」はRAWコマンドなので、
引き続く8ビットのデータ「00000000」をその
まま生データとして指定する。
The code string "00000000 011001
01 01111101 00111011 1111
1111 10000000 "is interpreted as shown in FIG. First of all, the first "0" is a RAW command, so
The subsequent 8-bit data "00000000" is directly specified as raw data.

【0040】次に、「110」は左複写コマンドであ
り、引き続く「0」はCOUNT1符号なので、1バイ
トの左複写を示す。
Next, "110" is a left copy command, and since the following "0" is a COUNT1 code, it indicates 1 byte left copy.

【0041】次に、「10」は上複写コマンドであり、
引き続く「10」はCOUNT2−3符号であるので、
引き続く1ビット「1」に2を加算した値、即ち3バイ
トの上複写を示す。
Next, "10" is an upper copy command,
Since the subsequent "10" is the COUNT2-3 code,
A value obtained by adding 2 to the subsequent 1 bit "1", that is, an upper copy of 3 bytes is shown.

【0042】次に、「11110」はCOUNT HI
GHコマンドであり、引き続く「10」はCOUNT2
−3符号であるので、引き続く1ビット「0」に2を加
算した値の64倍、即ち128を後続するコマンドのカ
ウントに加算することを示す。
Next, "11110" is COUNT HI.
It is a GH command, and the subsequent "10" is COUNT2.
Since it is a -3 code, it indicates that 64 times the value obtained by adding 2 to the subsequent 1 bit "0", that is, 128 is added to the count of the subsequent command.

【0043】次に、「1110」は前ページ複写コマン
ドであり、引き続く「111111」はCOUNT0符
号なので、0バイトの前ページ複写を示す。但し、この
場合はCOUNT HIGH 2コマンドが先行してい
るため、128が加算され、128バイトの前ページ複
写を示す。
Next, "1110" is the previous page copy command, and the subsequent "111111" is the COUNT0 code, and therefore indicates 0 byte previous page copy. However, in this case, since the COUNT HIGH 2 command precedes, 128 is added to indicate 128-byte previous page copy.

【0044】次に、「11111」はEOBコマンドで
あり、符号列の終了を示す。引き続く「000000
0」はバイト境界に整列するための詰め物であり、特別
な意味を持たない。
Next, "11111" is an EOB command and indicates the end of the code string. Continue to "000000
"0" is a padding for aligning to a byte boundary and has no special meaning.

【0045】次に、図6に示すフローチャートを参照
し、プリンタドライバ4の処理の詳細を説明する。
Next, the details of the processing of the printer driver 4 will be described with reference to the flowchart shown in FIG.

【0046】プリンタドライバ4がオペレーティングシ
ステム2から呼び出されると、先ずS1にて呼び出しの
種類が描画指令であるか判定する。呼び出しの種類が描
画指令であった場合は、S2にて描画処理を行う。具体
的には、オペレーティングシステム2を経由してアプリ
ケーション3から指示された、文字、図形又はビットマ
ップ等を8ビットのグレイスケール画像に変換し、記録
して、処理を終了する。
When the printer driver 4 is called from the operating system 2, it is first determined in S1 whether the calling type is a drawing command. If the call type is a drawing command, the drawing process is performed in S2. Specifically, a character, a figure, a bitmap, or the like instructed by the application 3 via the operating system 2 is converted into an 8-bit grayscale image, recorded, and the process ends.

【0047】S1にて呼び出しの種類が描画指令でなか
った場合は、S7にて呼び出しの種類がページ終了指令
であるか判定する。呼び出しの種類がページ終了指令で
あった場合には、S8にて、2値化処理を行う。具体的
にはS2にて記録された8ビットのグレイスケール画像
を、ディザマトリックスを使用して,白黒1ビットの画
像に変換する。
If the calling type is not a drawing command in S1, it is determined in S7 whether the calling type is a page end command. If the call type is the page end command, binarization processing is performed in S8. Specifically, the 8-bit grayscale image recorded in S2 is converted into a monochrome 1-bit image using a dither matrix.

【0048】次に、S9にて、印刷条件指定コマンド、
具体的には用紙サイズ、給紙カセット、解像度、階調
数、1ラインのバイト数、1ページのライン数等の印刷
に必要な条件を指定するコマンドを出力する。
Next, in S9, the print condition designation command,
Specifically, it outputs a command that specifies conditions necessary for printing, such as paper size, paper cassette, resolution, number of gradations, number of bytes per line, number of lines per page.

【0049】次に、S10にて、符号化時に使用する上
複写時に複写元が何ライン上の位置であるかを指定する
上複写垂直オフセット値及び左複写時に複写元が同一ラ
インの何バイト左の位置であるかを指定する左複写水平
オフセット値を指定する圧縮パラメタ指定コマンドを出
力する。
Next, in step S10, an upper copy vertical offset value for specifying the position of the copy source at the time of the upper copy used at the time of encoding, and the left side of the same line at the time of copying, the number of bytes left of the same line. Outputs a compression parameter specification command that specifies the left copy horizontal offset value that specifies whether or not the position is.

【0050】ここで、上複写垂直オフセット値及び左複
写水平オフセット値は、S8にて使用したディザマトリ
ックスに応じて、予め理論的に、或は実験により最適値
を求めておき、それを使用する。
Here, the upper copy vertical offset value and the left copy horizontal offset value are used in advance by theoretically or experimentally obtaining optimum values according to the dither matrix used in S8. .

【0051】次にS11にて、後述する符号化手順に従
い画像データを符号化する。このときに、S10にて出
力した圧縮パラメタ指定コマンドが指定する、上複写垂
直オフセット値及び左複写水平オフセット値を用いて符
号化を行う。次に、S12にて、S11にて符号化され
た画像データのサイズ及びライン数を指定する画像デー
タコマンドヘッダを出力する。次に、S13にて、S1
1にて符号化された画像データを出力する。次に、S1
4にて、ページの終了を指定する改ページコマンドを出
力する。次に、S15にて、現ページの画像データを前
ページメモリに転送して処理を終了する。
Next, in S11, the image data is encoded according to the encoding procedure described later. At this time, encoding is performed using the upper copy vertical offset value and the left copy horizontal offset value specified by the compression parameter specification command output in S10. Next, in S12, an image data command header designating the size and the number of lines of the image data encoded in S11 is output. Next, in S13, S1
The image data encoded in 1 is output. Next, S1
At 4, a page break command designating the end of the page is output. Next, in S15, the image data of the current page is transferred to the previous page memory, and the process ends.

【0052】S7にて呼び出しの種類がページ終了指令
でなかった場合には、S16にて、呼び出しの種類に応
じたその他の処理、例えばページ開始指令あるいはプリ
ンタ能力問い合わせ指令等に対応する処理を行い、終了
する。
If the call type is not the page end command in S7, other processes corresponding to the call type are performed in S16, for example, a process corresponding to a page start command or a printer capability inquiry command. ,finish.

【0053】次に、図7を参照し図6のS11の符号化
処理の詳細を説明する。
Details of the encoding process of S11 of FIG. 6 will be described below with reference to FIG.

【0054】先ず、S51にて、ライン番号Yを0に初
期化する。次に、S52にて、ライン先頭からのバイト
オフセットXを0に初期化する。次に、S53にて、上
位置が有効な画像領域にあるか判定する。具体的には、
図6のS47にて出力した上複写位置を示すライン数が
ライン番号Yよりも小でないか判定する。上複写位置を
示すライン数がライン番号Yよりも小でない場合は、上
位置が有効な画像領域にある場合なので、S54にて現
在の位置(X,Y)と、上位置(X,Y−上複写位置を
示すライン数)から始まるバイト列が連続して一致する
長さを求める。尚、この際に、ライン末まで連続して一
致している場合には、ライン末で打ち切るものとする。
又、連続して一致する長さがカウント符号の最大値であ
る4095バイトを超える場合には、4095バイトで
打ち切るものとする。
First, in S51, the line number Y is initialized to 0. Next, in S52, the byte offset X from the beginning of the line is initialized to 0. Next, in S53, it is determined whether the upper position is in a valid image area. In particular,
It is determined whether the number of lines indicating the upper copy position output in S47 of FIG. 6 is smaller than the line number Y. If the number of lines indicating the upper copy position is not smaller than the line number Y, it means that the upper position is in a valid image area. Therefore, in S54, the current position (X, Y) and the upper position (X, Y- The length at which the byte string starting from the number of lines indicating the upper copy position) continuously matches is calculated. At this time, if the lines match continuously up to the end of the line, the line is cut off.
If the length of consecutive matches exceeds 4095 bytes, which is the maximum value of the count code, the length is cut off at 4095 bytes.

【0055】次に、S55にて、S54にて求めた長さ
が0であるか判定する。S54にて求めた長さが0でな
い場合には、S56にて、S54にて求めた長さが63
より大であるか判定する。S54にて求めた長さが63
より大である場合には、S57にてCOUNT HIG
Hコマンドをバッファに出力し、次いでS58にて、カ
ウントの上位、即ちS54にて求めた長さを64で除算
した商を符号化してバッファに出力し、S59に進む。
S56にて、S54にて求めた長さが63より大でない
場合には直接S59に進む。
Next, in S55, it is determined whether or not the length obtained in S54 is zero. If the length obtained in S54 is not 0, the length obtained in S54 is 63 in S56.
Determine if it is greater. The length obtained in S54 is 63
If it is larger, COUNT HIG at S57
The H command is output to the buffer, and then, in S58, the upper part of the count, that is, the quotient obtained by dividing the length obtained in S54 by 64 is encoded and output to the buffer, and the process proceeds to S59.
In S56, if the length obtained in S54 is not greater than 63, the process directly proceeds to S59.

【0056】次に、S59にてCOPY UPコマンド
をバッファに出力し、次にS60にて、カウントの下
位、即ち、S54にて求めた長さを64で除算した剰余
を符号化してバッファに出力する。
Next, in S59, a COPY UP command is output to the buffer, and in S60, the lower part of the count, that is, the remainder obtained by dividing the length obtained in S54 by 64 is encoded and output to the buffer. To do.

【0057】S53にて、上複写位置を示すライン数が
ライン番号Yよりも小である場合及びS55にて長さが
0であった場合は、S62にて、左位置が有効な画像領
域にあるか判定する。具体的には、図6のS47にて出
力した左複写位置を示すバイト数が、ライン先頭からの
バイトオフセットXよりも小でないか判定する。左複写
位置を示すバイト数が、ライン先頭からのバイトオフセ
ットXよりも小でない場合は、左位置が有効な画像領域
にある場合なので、S63にて現在の位置(X,Y)
と、左位置(X−左複写位置を示すバイト数,Y)から
始まるバイト列が連続して一致する長さを求める。尚、
この際に、ライン末まで連続して一致している場合に
は、ライン末で打ち切るものとする。又、連続して一致
する長さがカウント符号の最大値である4095バイト
を超える場合には、4095バイトで打ち切るものとす
る。
If the number of lines indicating the upper copy position is smaller than the line number Y in S53 and the length is 0 in S55, the left position becomes the valid image area in S62. Determine if there is. Specifically, it is determined whether the number of bytes indicating the left copy position output in S47 of FIG. 6 is smaller than the byte offset X from the line head. If the number of bytes indicating the left copy position is not smaller than the byte offset X from the beginning of the line, it means that the left position is in the valid image area. Therefore, in S63, the current position (X, Y) is set.
And the length at which the byte string starting from the left position (X-the number of bytes indicating the left copy position, Y) is consecutively obtained. still,
At this time, if the lines match continuously up to the end of the line, the line is cut off at the end. If the length of consecutive matches exceeds 4095 bytes, which is the maximum value of the count code, the length is cut off at 4095 bytes.

【0058】次に、S64にて、S63にて求めた長さ
が0であるか判定する。S63にて求めた長さが0でな
い場合には、S65にて、S63にて求めた長さが63
より大であるか判定する。S63にて求めた長さが63
より大である場合には、S66にてCOUNT HIG
Hコマンドをバッファに出力し、次いでS69にて、カ
ウントの上位、即ち、S63にて求めた長さを64で除
算した商を符号化してバッファに出力し、S68に進
む。S65にて、S63にて求めた長さが63より大で
ない場合には直接S68に進む。
Next, in S64, it is determined whether or not the length obtained in S63 is zero. If the length calculated in S63 is not 0, the length calculated in S63 is 63 in S65.
Determine if it is greater. The length obtained in S63 is 63
If it is larger, COUNT HIG at S66
The H command is output to the buffer, and then in S69, the upper part of the count, that is, the quotient obtained by dividing the length obtained in S63 by 64 is encoded and output to the buffer, and the process proceeds to S68. In S65, if the length obtained in S63 is not greater than 63, the process directly proceeds to S68.

【0059】次に、S69にて、COPY LEFTコ
マンドをバッファに出力し、次にS60にて、カウント
の下位、即ち、S63にて求めた長さを64で除算した
剰余を符号化してバッファに出力する。
Next, in S69, a COPY LEFT command is output to the buffer, and in S60, the lower part of the count, that is, the remainder obtained by dividing the length obtained in S63 by 64 is encoded and stored in the buffer. Output.

【0060】S62にて、左複写位置を示すバイト数
が、ライン先頭からのバイトオフセットXよりも小であ
る場合及びS64にて長さが0であった場合は、S69
にて、前ページメモリに有効な画像が格納されているか
判定する。具体的には、ページ番号が1でないか判定す
る。ページ番号が1でない場合は、図6のS15にて前
ページメモリに画像データが転送されている場合なの
で、S70にて現ページの画像データの現在の位置
(X,Y)と、前ページメモリに格納されている画像デ
ータの現在の位置(X,Y)から始まるバイト列が連続
して一致する長さを求める、尚、この際に、ライン末ま
で連続して一致している場合には、ライン末で打ち切る
ものとする。又、連続して一致する長さが、カウント符
号の最大値である4095バイトを超える場合には,4
095バイトで打ち切るものとする。
If the number of bytes indicating the left copy position is smaller than the byte offset X from the beginning of the line in S62 and the length is 0 in S64, S69.
At, it is determined whether a valid image is stored in the previous page memory. Specifically, it is determined whether the page number is 1. If the page number is not 1, it means that the image data has been transferred to the previous page memory in S15 of FIG. 6, so in S70 the current position (X, Y) of the image data of the current page and the previous page memory. The length at which the byte string starting from the current position (X, Y) of the image data stored in is consecutively obtained is obtained. , Shall be terminated at the end of the line. If the length of consecutive matches exceeds 4095 bytes, which is the maximum value of the count code, 4
It shall be terminated at 095 bytes.

【0061】次に、S71にて、S70にて求めた長さ
が0であるか判定する。S70にて求めた長さが0でな
い場合には、S72にて,S70にて求めた長さが63
より大であるか判定する。S70にて求めた長さが63
より大である場合には、S73にてCOUNT HIG
Hコマンドをバッファに出力し、次いでS74にて、カ
ウントの上位、即ち、S70にて求めた長さを64で除
算した商を符号化してバッファに出力し、S75に進
む。S72にて、S70にて求めた長さが63より大で
ない場合には直接S75に進む。
Next, in S71, it is determined whether or not the length obtained in S70 is zero. If the length calculated in S70 is not 0, the length calculated in S70 is 63 in S72.
Determine if it is greater. The length obtained in S70 is 63
If it is larger, COUNT HIG at S73
The H command is output to the buffer, then in S74, the upper part of the count, that is, the quotient obtained by dividing the length obtained in S70 by 64 is encoded and output to the buffer, and the process proceeds to S75. In S72, if the length obtained in S70 is not greater than 63, the process directly proceeds to S75.

【0062】次に、S75にて、COPY PREVI
OUS PAGEコマンドをバッファに出力し、次にS
60にて、カウントの下位、即ち、S70にて求めた長
さを64で除算した剰余を符号化してバッファに出力す
る。
Next, in S75, COPY PREVI
Output OUS PAGE command to buffer, then S
At 60, the lower part of the count, that is, the remainder obtained by dividing the length obtained at S70 by 64 is encoded and output to the buffer.

【0063】S69にて、ページ番号が1である場合及
びS71にて長さが0であった場合は、S76にて、R
AWコマンドをバッファに出力し、次に現在の位置
(X,Y)のデータ1バイトを生データとしてバッファ
に出力する。
If the page number is 1 in S69 and the length is 0 in S71, R is set in S76.
The AW command is output to the buffer, and then 1 byte of data at the current position (X, Y) is output to the buffer as raw data.

【0064】何れの場合も、S78に進み、処理したバ
イト数をXに加算する。次に、S79にて、Xがライン
末に達したか、即ち、Xが1ラインのバイト数に等しい
か判定する。Xが1ラインのバイト数より小である場合
は、S53に戻り、処理を継続する。Xが1ラインのバ
イト数と等しい場合は、S80にてライン番号Yに1を
加算し、次にS81にて画像の処理が終了したか、即
ち、Yが画像のライン数と等しいか判定する。
In any case, the process proceeds to S78 and the processed byte number is added to X. Next, in S79, it is determined whether X has reached the end of the line, that is, X is equal to the number of bytes in one line. If X is smaller than the number of bytes in one line, the process returns to S53 to continue the process. If X is equal to the number of bytes in one line, 1 is added to the line number Y in S80, and then it is determined in S81 whether the image processing is completed, that is, Y is equal to the number of lines in the image. .

【0065】Yが画像のライン数より小である場合は、
S52に戻り、処理を継続する。Yが画像のライン数と
等しい場合は、S82にてEOBコマンドをバッファに
出力し、次にS83にてバイト境界に整列するために必
要な数だけビット「0」をバッファに出力し、処理を終
了する。
If Y is less than the number of lines in the image,
The process returns to S52 and the process is continued. If Y is equal to the number of lines in the image, the EOB command is output to the buffer in S82, and then the bit "0" is output to the buffer in the number necessary for aligning to the byte boundary in S83, and the process is executed. finish.

【0066】次に、図9を参照し、図2に示した復号回
路13の詳細について説明する。尚、図9は図2に示し
た復号回路13の詳細を示すブロック図である。
Next, the details of the decoding circuit 13 shown in FIG. 2 will be described with reference to FIG. 9 is a block diagram showing details of the decoding circuit 13 shown in FIG.

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

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

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

【0070】コマンドデコード回路24は、例えばリー
ドオンリーメモリ、或はワイヤードロジックにより構成
され、セレクタ22によって位置合わせが行われた、入
力バッファ21に格納された符号データを復号し、復号
したコマンドに従ってカウンタ26、上複写出力回路2
7、前ページ複写出力回路28、左複写出力回路29、
生データ出力回路30及びビットカウンタ23に、前述
の、或は後述する各種の信号を出力する。
The command decoding 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 and aligned by the selector 22, and counters according to the decoded command. 26, upper copy output circuit 2
7, previous page copy output circuit 28, left copy output circuit 29,
The raw data output circuit 30 and the bit counter 23 output various signals described above or below.

【0071】カウンタ26は、COPY UP,COP
Y LEFT或はCOPY PREVIOUS PAG
Eコマンドの処理バイト数を保持し、1バイトのデータ
出力が行われる毎に減算される。カウンタ26は上位6
ビットと下位6ビットを独立に設定可能であり、コマン
ドデコード回路23がCOUNT HIGHコマンドを
復号した時にはコマンドデコード回路23が出力する、
処理バイト数の加算値をカウンタ26の上位に格納す
る。又、コマンドデコード回路23がCOPYUP,C
OPY LEFT或はCOPY PREVIOUS P
AGEコマンドを復号した時にはコマンドデコード回路
23が出力する、処理バイト数をカウンタ26の下位に
格納する。
The counter 26 has COPY UP, COP
Y LEFT or COPY PREVIOUS PAG
The number of bytes processed by the E command is held, and is subtracted each time 1-byte data is output. Counter 26 is the top 6
The bit and the lower 6 bits can be set independently, and when the command decode circuit 23 decodes the COUNT HIGH command, the command decode circuit 23 outputs.
The added value of the number of processed bytes is stored in the higher order of the counter 26. In addition, the command decode circuit 23 has COPYUP, C
OPY LEFT or COPY PREVIOUS P
When the AGE command is decoded, the number of bytes processed by the command decoding circuit 23 is stored in the lower part of the counter 26.

【0072】上複写出力回路27は、カウンタ26が保
持する処理バイト数に従ってラインバッファ31から上
複写位置のデータを読み取り、出力する。
The upper copy output circuit 27 reads the data at the upper copy position from the line buffer 31 according to the number of processing bytes held by the counter 26 and outputs it.

【0073】上複写位置に相当するラインバッファ31
のアドレスは、上複写出力回路27に内蔵されるレジス
タに保持される。このレジスタの初期値は、予め制御回
路15により上複写位置に相当する値が書き込まれてお
り、復号回路13が1バイトの画像データを出力するた
びに自動的に加算されるとともに、その結果ラインバッ
ファ31の最終アドレスを超えた場合は、自動的にライ
ンバッファ31の先頭アドレスに再設定される。
Line buffer 31 corresponding to the upper copy position
The address of is stored in a register incorporated in the upper copy output circuit 27. The initial value of this register is previously written with a value corresponding to the upper copy position by the control circuit 15, and is automatically added every time the decoding circuit 13 outputs 1-byte image data, and the result line When the end address of the buffer 31 is exceeded, the start address of the line buffer 31 is automatically reset.

【0074】前ページ複写出力回路28は、カウンタ2
6が保持する処理バイト数に従って、再復号回路19が
出力する、前ページの同一位置の画像データを読み取
り、出力する。
The previous page copy output circuit 28 uses the counter 2
The image data at the same position on the previous page, which is output from the re-decoding circuit 19, is read and output according to the number of processing bytes held by 6.

【0075】左複写出力回路29は、カウンタ26が保
持する処理バイト数に従って、ラインバッファ31から
左複写位置のデータを読み取り、出力する。
The left copy output circuit 29 reads the data at the left copy position from the line buffer 31 and outputs it according to the number of bytes processed by the counter 26.

【0076】左複写位置に相当するラインバッファ31
のアドレスは、左複写出力回路29に内蔵されるレジス
タに保持される。このレジスタの初期値は、予め制御回
路15により左複写位置に相当する値が書き込まれてお
り、復号回路13が1バイトの画像データを出力するた
びに自動的に加算されるとともに、その結果、ラインバ
ッファ31の最終アドレスを超えた場合は、自動的にラ
インバッファ31の先頭アドレスに再設定される。
Line buffer 31 corresponding to the left copy position
The address of is stored in the register incorporated in the left copy output circuit 29. As the initial value of this register, a value corresponding to the left copy position is written in advance by the control circuit 15, and is automatically added every time the decoding circuit 13 outputs 1-byte image data, and as a result, When the end address of the line buffer 31 is exceeded, the start address of the line buffer 31 is automatically reset.

【0077】生データ出力回路30は、コマンドデコー
ド回路24が出力した1バイトの生データを出力する。
The raw data output circuit 30 outputs the 1-byte raw data output by the command decoding circuit 24.

【0078】ラインバッファ31は、複数のラインの復
号データを保持し、上複写回路27或は左複写回路29
が出力するアドレスに従って、復号データの読み出しを
行うとともに、上複写回路27、前ページ複写回路2
8、左複写回路29或は生データ出力回路30が出力し
た復号データを現在の位置に書き込む。
The line buffer 31 holds the decoded data of a plurality of lines, and the upper copy circuit 27 or the left copy circuit 29.
The decoded data is read according to the address output by the upper copy circuit 27 and the previous page copy circuit 2
8. The decoded data output from the left copy circuit 29 or the raw data output circuit 30 is written at the current position.

【0079】現在の位置に相当するラインバッファ31
のアドレスは、ラインバッファ31に内蔵されるレジス
タに保持される。このレジスタの初期値は、予め制御回
路15によりラインバッファ31の先頭アドレスが書き
込まれており、復号回路13が1バイトの画像データを
出力するたびに自動的に加算されるとともに、その結
果、ラインバッファ31の最終アドレスを超えた場合
は、自動的にラインバッファ31の先頭アドレスに再設
定される。
The line buffer 31 corresponding to the current position
The address of is stored in a register built in the line buffer 31. The initial value of this register is written in advance with the start address of the line buffer 31 by the control circuit 15, and is automatically added every time the decoding circuit 13 outputs 1-byte image data. When the end address of the buffer 31 is exceeded, the start address of the line buffer 31 is automatically reset.

【0080】コマンドデコード回路24はCOPY U
Pコマンドをデコードすると、引き続くカウントをデコ
ードし、カウンタ26の下位に格納するとともに、上複
写出力回路27に信号を出力する。カウンタ26の上位
には、COUNT HIGHコマンドが先行しなかった
場合には0が、先行した場合にはCOUNT HIGH
コマンドが示す上位カウントが格納されている。上複写
位置のデータがラインバッファ31から読み取られ、上
複写出力回路27に入力される。上複写出力回路27が
このデータを出力すると、出力された復号データは、ラ
インバッファ31の現在の位置に書き込まれる。このよ
うにして、カウンタ26が0に達するまで、復号データ
の出力が行われる。
The command decode circuit 24 is a COPY U
When the P command is decoded, the subsequent count is decoded and stored under the counter 26, and a signal is output to the upper copy output circuit 27. The high order of the counter 26 is 0 when the COUNT HIGH command does not precede, and the COUNT HIGH when it precedes.
The high-order count indicated by the command is stored. The data at the upper copy position is read from the line buffer 31 and input to the upper copy output circuit 27. When the upper copy output circuit 27 outputs this data, the output decoded data is written at the current position of the line buffer 31. In this way, the decoded data is output until the counter 26 reaches 0.

【0081】コマンドデコード回路24はCOPY P
REVIOUS PAGEコマンドをデコードすると、
引き続くカウントをデコードし、カウンタ26の下位に
格納するとともに、前ページ複写出力回路28に信号を
出力する。カウンタ26の上位には、COUNT HI
GHコマンドが先行しなかった場合には0が、先行した
場合にはCOUNT HIGHコマンドが示す上位カウ
ントが格納されている。前ページの同一位置のデータが
再復号回路19から前ページ複写出力回路28に入力さ
れる。前ページ複写出力回路28がこのデータを出力す
ると、出力された復号データは、ラインバッファ31の
現在の位置に書き込まれる。このようにして、カウンタ
26が0に達するまで、復号データの出力が行われる。
The command decode circuit 24 uses the COPY P
When the REVIOUS PAGE command is decoded,
The subsequent count is decoded and stored in the lower part of the counter 26, and a signal is output to the previous page copy output circuit 28. Above the counter 26 is a COUNT HI
When the GH command does not precede, 0 is stored, and when it precedes, the upper count indicated by the COUNT HIGH command is stored. The data at the same position on the previous page is input from the re-decoding circuit 19 to the previous page copy output circuit 28. When the previous page copy output circuit 28 outputs this data, the output decoded data is written in the current position of the line buffer 31. In this way, the decoded data is output until the counter 26 reaches 0.

【0082】コマンドデコード回路24はCOPY L
EFTコマンドをデコードすると、引き続くカウントを
デコードし、カウンタ26の下位に格納するとともに、
左複写出力回路29に信号を出力する。カウンタ26の
上位には、COUNT HIGHコマンドが先行しなか
った場合には0が、先行した場合にはCOUNT HI
GHコマンドが示す上位カウントが格納されている。左
複写位置のデータがラインバッファ31から読み取ら
れ、左複写出力回路29に入力される。左複写出力回路
29がこのデータを出力すると、出力された復号データ
は、ラインバッファ31の現在の位置に書き込まれる。
このようにして、カウンタ26が0に達するまで、復号
データの出力が行われる。
The command decoding circuit 24 uses COPY L
When the EFT command is decoded, the subsequent count is decoded and stored under the counter 26, and
A signal is output to the left copy output circuit 29. The high order of the counter 26 is 0 when the COUNT HIGH command does not precede, and the COUNT HI when it precedes.
The upper count indicated by the GH command is stored. The data at the left copy position is read from the line buffer 31 and input to the left copy output circuit 29. When the left copy output circuit 29 outputs this data, the output decoded data is written in the current position of the line buffer 31.
In this way, the decoded data is output until the counter 26 reaches 0.

【0083】コマンドデコード回路24はRAWコマン
ドをデコードすると、引き続く1バイトの生データを生
データ出力回路30に出力する。生データ出力回路30
がこのデータを出力すると、出力された復号データは、
ラインバッファ31の現在の位置に書き込まれる。
When the command decoding circuit 24 decodes the RAW command, it outputs the subsequent 1-byte raw data to the raw data output circuit 30. Raw data output circuit 30
When this data is output by, the output decoded data is
It is written in the current position of the line buffer 31.

【0084】コマンドデコード回路24はCOUNT
HIGHコマンドをデコードすると、引き続くカウント
をデコードし、カウンタ26の上位に格納する。
The command decode circuit 24 is COUNT
When the HIGH command is decoded, the subsequent count is decoded and stored in the upper part of the counter 26.

【0085】<その他の実施の形態>尚、上述の実施形
態では、画像データ1バイトを単位として符号化及び復
号が行われているが、これに代えて他の単位、例えば1
画素或は2バイト等を単位としても良い。
<Other Embodiments> In the above embodiment, encoding and decoding are performed in units of 1 byte of image data, but instead of this, other units such as 1 are used.
A pixel or 2 bytes may be used as a unit.

【0086】又、上述の実施の形態では、白黒画像を扱
っていたが、これに代えてカラー画像を扱うようにして
も良い。
Further, in the above-mentioned embodiment, the black and white image is handled, but instead of this, a color image may be handled.

【0087】又、上述の実施の形態では、1画素が1ビ
ットにより構成されていたが、これに代えて他の値、例
えば2ビット、4ビット或は8ビットとしても良い。
Further, in the above-mentioned embodiment, one pixel is composed of 1 bit, but it may be replaced by another value such as 2 bits, 4 bits or 8 bits.

【0088】又、上述の実施の形態では、ハードウェア
によって復号していたが、これに代えてソフトウェアで
復号するようにしても良い。又、述の実施の形態では、
ディザ処理を行っているが、これに代えてディザ処理を
行わないようにしても良い。
Further, in the above embodiment, the decoding is performed by hardware, but instead of this, decoding may be performed by software. Also, in the embodiment described above,
Although the dither processing is performed, the dither processing may not be performed instead.

【0089】[0089]

【発明の効果】以上詳細に説明したように、本発明で
は、注目位置の左方及び上方に加えて、前ページの同一
位置を参照して符号化を行うため、左方及び上方の参照
位置との相関が低い画像であっても、連続するページで
同一の背景パターンを使用する場合等、前ページとの相
関性が高い画像を符号化する際に効率良く圧縮すること
ができる。
As described in detail above, according to the present invention, since the coding is performed by referring to the same position on the previous page in addition to the left side and the upper side of the target position, the left and upper reference positions are referred to. Even if the image has a low correlation with, it can be efficiently compressed when encoding an image having a high correlation with the previous page, such as when the same background pattern is used in consecutive pages.

【0090】又、本発明では、参照されるべき前ページ
の画像データを符号化して保持するため、画像データを
そのまま保持する場合に比べて、より小容量のメモリで
前ページの画像データを保持することができる。
Further, in the present invention, since the image data of the previous page to be referred to is encoded and held, the image data of the previous page is held in a memory having a smaller capacity than in the case where the image data is held as it is. can do.

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

【図1】本発明方式の構成を示すブロック図である。FIG. 1 is a block diagram showing a configuration of a system of the present invention.

【図2】本発明方式のプリンタの構成の詳細を示すブロ
ック図である。
FIG. 2 is a block diagram showing details of the configuration of a printer according to the present invention.

【図3】本発明方式の符号を示す表である。FIG. 3 is a table showing codes of the method of the present invention.

【図4】本発明方式の符号を示す表である。FIG. 4 is a table showing codes of the method of the present invention.

【図5】本発明方式の符号の実例を説明する図である。FIG. 5 is a diagram for explaining an actual example of codes according to the method of the present invention.

【図6】本発明方式のプリンタドライバの処理手順を示
すフローチャートである。
FIG. 6 is a flowchart showing a processing procedure of a printer driver according to the present invention.

【図7】本発明方式の符号化手順を示すフローチャート
である。
FIG. 7 is a flowchart showing an encoding procedure of the method of the present invention.

【図8】背景パターンの一例を示す図である。FIG. 8 is a diagram showing an example of a background pattern.

【図9】本発明方式の復号回路の詳細を示すブロック図
である。
FIG. 9 is a block diagram showing details of a decoding circuit according to the present invention.

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

1 コンピュータ 2 オペレーティングシステム 3 アプリケーション 4 プリンタドライバ 5 ポートドライバ 6 プリンタ 11 パラレルポート 12 FIFOメモリ 13 復号回路 14 プリンタエンジン 15 制御回路 17 再符号化回路 18 ページメモリ 1 computer 2 operating system 3 applications 4 Printer driver 5 port driver 6 printer 11 parallel port 12 FIFO memory 13 Decoding circuit 14 Printer engine 15 Control circuit 17 Re-encoding circuit 18 page memory

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 複数ページの画像データを符号化する符
号化方法であって、符号化しようとするページの画像デ
ータを格納する第1のメモリと、前記第1のメモリに格
納された画像データを符号化する符号化手段と、直前の
ページの画像データを格納する第2のメモリとを備え、
前記符号化手段は前記第2のメモリに格納された直前の
ページの画像データを参照して符号化を行うことを特徴
とする符号化方法。
1. An encoding method for encoding image data of a plurality of pages, comprising: a first memory for storing image data of a page to be encoded; and image data stored in the first memory. And a second memory for storing the image data of the immediately preceding page,
The encoding method, wherein the encoding means encodes with reference to the image data of the previous page stored in the second memory.
【請求項2】 複数ページの画像データを符号化した符
号を復号する復号方法であって、符号を復号する復号手
段と、前記復号手段により復号された画像データを格納
する第1のメモリと、前記第1のメモリに格納された画
像データを符号化する再符号化手段と、前記再符号化手
段により符号化された符号を格納する第2のメモリと、
前記第2のメモリに格納された符号を復号する再復号手
段とを備え、前記復号手段は直前のページの画像データ
を参照する符号を復号した場合には前記再復号手段が復
号した画像データを参照して復号するとともに、前記再
符号化手段は符号化しようとするページの画像データの
みを参照して符号化を行うことを特徴とする復号方法。
2. A decoding method for decoding a code obtained by coding image data of a plurality of pages, the decoding means decoding the code, and a first memory storing the image data decoded by the decoding means. Re-encoding means for encoding the image data stored in the first memory, a second memory for storing the code encoded by the re-encoding means,
Re-decoding means for decoding the code stored in the second memory, wherein the decoding means decodes the image data decoded by the re-decoding means when decoding the code referring to the image data of the immediately preceding page. The decoding method is characterized in that the re-encoding means performs encoding by referring to only the image data of the page to be encoded while referring to the decoding.
JP2002038132A 2001-12-06 2002-02-15 Encoding method and decoding method Pending JP2003244448A (en)

Priority Applications (7)

Application Number Priority Date Filing Date Title
JP2002038132A JP2003244448A (en) 2002-02-15 2002-02-15 Encoding method and decoding method
EP02258367.8A EP1318665B1 (en) 2001-12-06 2002-12-04 Image processing apparatus and method, program, and storage medium
CN 200810094578 CN101282405B (en) 2001-12-06 2002-12-05 Image processing apparatus and method
CNB02155529XA CN100397866C (en) 2001-12-06 2002-12-05 Image processor, image processing method, program and memory medium
CN 200810097396 CN101282406B (en) 2001-12-06 2002-12-05 Image processing apparatus
CN2008100973975A CN101282407B (en) 2001-12-06 2002-12-05 Image processing apparatus and method
US10/310,812 US7245396B2 (en) 2001-12-06 2002-12-06 Image data coding apparatus, image data decoding apparatus, image data coding method and image data decoding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002038132A JP2003244448A (en) 2002-02-15 2002-02-15 Encoding method and decoding method

Publications (2)

Publication Number Publication Date
JP2003244448A true JP2003244448A (en) 2003-08-29
JP2003244448A5 JP2003244448A5 (en) 2005-08-25

Family

ID=27779524

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002038132A Pending JP2003244448A (en) 2001-12-06 2002-02-15 Encoding method and decoding method

Country Status (1)

Country Link
JP (1) JP2003244448A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007158510A (en) * 2005-12-01 2007-06-21 Canon Inc Image processor and its control method, computer program, and computer readable memory medium
JP2008504734A (en) * 2004-06-25 2008-02-14 アボセント コーポレイション Digital video compression command priority
JP2009010871A (en) * 2007-06-29 2009-01-15 Toshiba Corp Screen transfer device, method thereof and program for image transfer
US8385429B2 (en) 2002-10-01 2013-02-26 Avocent Corporation Video compression encoder
US8660194B2 (en) 2006-04-28 2014-02-25 Avocent Corporation DVC delta commands
US8805096B2 (en) 2004-06-25 2014-08-12 Avocent Corporation Video compression noise immunity

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9560371B2 (en) 2003-07-30 2017-01-31 Avocent Corporation Video compression system

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8385429B2 (en) 2002-10-01 2013-02-26 Avocent Corporation Video compression encoder
US9743095B2 (en) 2002-10-01 2017-08-22 Avocent Corporation Video compression encoder
JP2008504734A (en) * 2004-06-25 2008-02-14 アボセント コーポレイション Digital video compression command priority
US8805096B2 (en) 2004-06-25 2014-08-12 Avocent Corporation Video compression noise immunity
JP2007158510A (en) * 2005-12-01 2007-06-21 Canon Inc Image processor and its control method, computer program, and computer readable memory medium
US8319987B2 (en) 2005-12-01 2012-11-27 Canon Kabushiki Kaisha Image processing apparatus and control method for compressing image data by determining common images amongst a plurality of page images
US8660194B2 (en) 2006-04-28 2014-02-25 Avocent Corporation DVC delta commands
JP2009010871A (en) * 2007-06-29 2009-01-15 Toshiba Corp Screen transfer device, method thereof and program for image transfer

Similar Documents

Publication Publication Date Title
US7245396B2 (en) Image data coding apparatus, image data decoding apparatus, image data coding method and image data decoding method
US7468803B2 (en) Image processing apparatus and image processing method
EP0703549B1 (en) A two dimensional method and system for compressing bi-level images
JP2003244448A (en) Encoding method and decoding method
US6816618B1 (en) Adaptive variable length image coding apparatus
JP4164257B2 (en) Image processing apparatus, image processing method, program, and storage medium
JP2001053620A (en) Method and device for encoding, method and device for decoding, and storage medium
JPH07264417A (en) Image coding method
JP2006304243A (en) Image processor, printer and image processing method
US5915042A (en) Coding and decoding methods and apparatus for compressing and expanding image data
JP2003250053A (en) Image encoder, image decoder, image encoding method, image decoding method, program, and storage medium
JP3970007B2 (en) Image processing apparatus, image processing method, program, and storage medium
US6069980A (en) Adaptive character image generation and synthesis
JP2003189108A (en) Image compression method
JP3170313B2 (en) Image processing device
JP2001217722A (en) Device and method for encoding information, and computer readable storage medium
JP2002051221A (en) Device, system and method for encoding and decoding image and storage medium
JP2984053B2 (en) Image processing device
JP3280171B2 (en) Output device for compressing and holding data and data compression control method
JPH06197189A (en) Facsimile equipment
JP2003250050A (en) Image processing apparatus and control method thereof
JP2006128944A (en) Information processing device, information processing method, image forming device, program, storage medium, and printing system
JP2000251061A (en) Device and method for processing image and recording medium for image processing
JPH11339026A (en) Recording controller and recording control method
JP2009194936A (en) Image processor, printer and image processing method

Legal Events

Date Code Title Description
RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20041116

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050215

A621 Written request for application examination

Effective date: 20050215

Free format text: JAPANESE INTERMEDIATE CODE: A621

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060718

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20070130