JP2002043950A - Encoding method and apparatus, and decoding method and apparatus - Google Patents
Encoding method and apparatus, and decoding method and apparatusInfo
- Publication number
- JP2002043950A JP2002043950A JP2000221236A JP2000221236A JP2002043950A JP 2002043950 A JP2002043950 A JP 2002043950A JP 2000221236 A JP2000221236 A JP 2000221236A JP 2000221236 A JP2000221236 A JP 2000221236A JP 2002043950 A JP2002043950 A JP 2002043950A
- Authority
- JP
- Japan
- Prior art keywords
- data
- command
- line
- byte
- length
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Landscapes
- Compression Of Band Width Or Redundancy In Fax (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
(57)【要約】
【課題】符号化・復号化においてあるデータの繰り返し
を検出してこれを利用するにおいて、少なくとも2つの
異なるサイズのデータの繰り返しを用いて符号化・復号
化することを可能となり、圧縮率を向上する。
【解決手段】処理済データの複写で置換し得る部分を検
出し、該部分のデータ長を取得し、これに続いて複数種
類のサイズのうちのいずれかのサイズのデータの繰り返
しで置換し得る部分を取得した場合に、そのデータのサ
イズに応じてCopythen Repeat Byte、Copy then Repeat
Word、Copy then Repeat DoubleWordのいずれかのコマ
ンドが生成される。また、また、処理済データの複写で
置換し得る部分に続いてデータの繰り返しが適用できな
い部分が検出された場合には、Copythen Rawコマンドが
生成される。
(57) [Problem] To detect and use repetition of certain data in encoding / decoding, it is possible to perform encoding / decoding using repetition of data of at least two different sizes. And the compression ratio is improved. A part which can be replaced by copying processed data is detected, a data length of the part is acquired, and subsequently, replacement can be performed by repeating data of any one of a plurality of sizes. When the part is acquired, Copythen Repeat Byte, Copy then Repeat according to the size of the data
One of the commands Word, Copy then Repeat DoubleWord is generated. In addition, when a portion where data repetition cannot be applied is detected following a portion that can be replaced by copying processed data, a Copythen Raw command is generated.
Description
【0001】[0001]
【発明の属する技術分野】本発明は、画像データの符号
化及び復号化に関する。特に、グレイスケールまたはカ
ラー画像データのように一画素が多値で表現される、2
次元またはそれ以上の次元を持つデータ構造を圧縮する
ために符号化し、またその符号を復号するのに好適な符
号化及び復号化技術に関するものである。[0001] 1. Field of the Invention [0002] The present invention relates to encoding and decoding of image data. In particular, one pixel is represented by multi-values such as gray scale or color image data.
The present invention relates to an encoding and decoding technique suitable for encoding a data structure having dimensions or more dimensions for compression and decoding the code.
【0002】[0002]
【従来の技術】従来、画像データを圧縮する方法とし
て、ランレングス符号を用いる方法がある。ランレング
ス符号は、同一データが繰り返される場合に、そのデー
タと繰り返しの長さを符号化するものである。ランレン
グス符号は、ソフトウェアによってかなり高速に符号化
を行うことができるが、画像データのように水平・垂直
の両方向に相関がある場合でも、水平方向の相関のみが
圧縮に寄与し、垂直方向の相関があっても圧縮に寄与し
ない。このため、画像データに適用して高い圧縮率を得
ることは困難である。2. Description of the Related Art Conventionally, as a method for compressing image data, there is a method using a run-length code. When the same data is repeated, the run-length code encodes the data and the repetition length. Run-length codes can be encoded at very high speed by software.However, even when there is a correlation in both the horizontal and vertical directions, such as image data, only the horizontal correlation contributes to compression, and the vertical The correlation does not contribute to compression. For this reason, it is difficult to obtain a high compression rate by applying to image data.
【0003】また、別の方法としてデルタロウ符号を用
いる方法がある。デルタロウ符号は、直前のラインと同
じデータが続いている場合に、続いている長さを符号化
するものである。デルタロウ符号は、ソフトウェアによ
ってかなり高速に符号化を行うことができるが、画像デ
ータのように水平・垂直の両方向に相関がある場合で
も、垂直方向の相関のみが圧縮に寄与することになり、
水平方向の相関があっても圧縮に寄与しない。このた
め、画像データに適用して高い圧縮率を得ることが困難
である。As another method, 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, but even when there is a correlation in both the horizontal and vertical directions, such as image data, only the vertical correlation contributes to compression.
Even if there is a horizontal correlation, it does not contribute to compression. For this reason, it is difficult to obtain a high compression rate by applying to image data.
【0004】また、別の方法としてハフマン符号を用い
る方法がある。ハフマン符号は、データの分布を調べ、
出現頻度の高いデータを短い符号に符号化するものであ
る。ハフマン符号は画像データのように水平・垂直の両
方向に相関がある場合において、どちらの方向の相関も
圧縮に寄与しない。このため、画像データに適用して高
い圧縮率を得ることが困難である。As another method, there is a method using a Huffman code. Huffman code examines the distribution of data,
It encodes data with a high appearance frequency into a short code. When the Huffman code has a correlation in both the horizontal and vertical directions as in image data, the correlation in either direction does not contribute to compression. For this reason, it is difficult to obtain a high compression rate by applying to image data.
【0005】そのほかにもLZ77符号、LZ78符
号、JBIG符号など様々な符号が考案されているが、
いずれも水平・垂直の相関が最も顕著である直左のデー
タ、および直上のデータ以外のデータを調べる必要があ
る。このため、符号化における計算量が多く、ソフトウ
ェアで符号化した場合に、符号化にかなりの時間を要
し、また、ハードウェアで復号した場合に復号器の規模
も大きくなるという欠点がある。[0005] In addition, various codes such as LZ77 code, LZ78 code and JBIG code have been devised.
In each case, it is necessary to examine data other than the data immediately to the left and the data immediately above where the horizontal / vertical correlation is most remarkable. For this reason, there are disadvantages in that the amount of calculation in the encoding is large, a considerable amount of time is required for encoding when encoding by software, and the scale of the decoder increases when decoding by hardware.
【0006】また、別の方法として、ランレングス符号
とデルタロウ符号を併用し、水平・垂直の相関が最も顕
著である直左のデータ、および直上のデータのみを調べ
ることにより計算量を小さくし、ソフトウェアで符号化
した場合に要する時間を短くするとともに、水平・垂直
両方向の相関を利用する場合に使用される3種類の操
作、すなわちデータの繰り返し、複写、生データのうち
の少なくとも2つを同時に符号化することにより、より
圧縮率を高くする方法がある。しかしながら、この方法
によれば、ランレングス符号が表現する繰り返しデータ
が一種類、たとえば1バイトに限られている。塗りつぶ
しのパターンや減色のためのディザパターンは8×8ピ
クセルで構成されることが多いので、画像データが2値
の場合は同一バイトが繰り返されることが多くなり、1
バイトの繰り返しのランレングス符号が有効に作用す
る。しかしながら、画像データが多値の場合は同一バイ
トが連続せず、例えば1バイトおきに同一バイトが繰り
返されるようなことが多く、ランレングス符号が有効に
作用しないという欠点がある。As another method, a run-length code and a delta-row code are used in combination to reduce the amount of calculation by examining only the data immediately to the left and the data immediately above where the horizontal / vertical correlation is most remarkable. In addition to reducing the time required for encoding by software, at least two of the three types of operations used when utilizing both horizontal and vertical correlations, namely, data repetition, copying, and raw data, are performed simultaneously. There is a method of increasing the compression rate by encoding. However, according to this method, the repetition data represented by the run-length code is limited to one type, for example, one byte. Since a fill pattern or a dither pattern for color reduction is often composed of 8 × 8 pixels, the same byte is often repeated when the image data is binary, and
Run length codes with repeated bytes work effectively. However, when the image data is multi-valued, the same byte is not continuous, and for example, the same byte is often repeated every other byte, and there is a disadvantage that the run-length code does not work effectively.
【0007】[0007]
【発明が解決しようとする課題】本発明は、上記の問題
に鑑みてなされたものであり、符号化・復号化において
あるデータの繰り返しを検出してこれを利用するにおい
て、少なくとも2つの異なるサイズのデータの繰り返し
を用いて符号化・復号化することを可能とし、より圧縮
率を高くすることを目的とする。これにより、グレイス
ケールまたはカラー画像データのように一画素が多値で
表現される画像データであっても圧縮率を高くすること
ができる。また、本発明の他の目的は、水平・垂直両方
向の相関を利用して符号化する場合等において一般に使
用される3種類の操作、すなわちあるデータの繰り返
し、処理済データの複写、生データのうちの少なくとも
2つを同時に符号化可能とし、より圧縮率を高くするこ
とにある。また、本発明の他の目的は、画像データのよ
うな2次元以上のデータ構造を、水平・垂直両方向の相
関を利用して符号化することにより高い圧縮率を得るこ
とを目的とする。特に、水平・垂直の相関が最も顕著で
ある直左のデータおよび直上のデータを用いて圧縮を行
うことにより計算量を小さくし、ソフトウェアで符号化
した場合に要する時間を短くすることを目的とする。SUMMARY OF THE INVENTION The present invention has been made in view of the above-mentioned problems, and has been made in consideration of the above-described problem. It is an object of the present invention to enable encoding and decoding by using repetition of the above data, and to further increase the compression ratio. This makes it possible to increase the compression ratio even for image data in which one pixel is represented by multi-values such as gray scale or color image data. Another object of the present invention is to provide three types of operations generally used in encoding using both horizontal and vertical correlations, such as repetition of certain data, copying of processed data, and copying of raw data. An object of the present invention is to enable at least two of them to be coded at the same time and to increase the compression ratio. Another object of the present invention is to obtain a high compression ratio by encoding a data structure of two or more dimensions such as image data using correlation in both horizontal and vertical directions. In particular, the aim is to reduce the amount of calculation by performing compression using the data immediately above and the data immediately above where horizontal and vertical correlations are most noticeable, and to reduce the time required for encoding with software. I do.
【0008】[0008]
【課題を解決するための手段】上記の目的を達成するた
めの本発明の一態様によれば、処理済データの複写で置
換し得る部分を検出し、該部分のデータ長を取得する第
1取得手段と、複数種類のサイズのうちのいずれかのサ
イズのデータの繰り返しで置換し得る部分を検出し、該
データの内容と該部分のデータ長を取得する第2取得手
段と、前記第1乃至第2取得手段によって取得されない
部分を検出し、該部分のデータ内容及びデータ長を取得
する第3取得手段と、前記第1乃至第3取得手段によっ
て検出された各部分のデータ長とデータ内容に基づいて
符号化データを生成する生成手段とを備える符号化装置
が提供される。According to one aspect of the present invention, there is provided a first method for detecting a portion which can be replaced by copying of processed data and obtaining a data length of the portion. Acquisition means, a second acquisition means for detecting a part that can be replaced by repetition of data of any one of a plurality of sizes, and acquiring the contents of the data and the data length of the part; A third acquisition unit for detecting a portion not acquired by the second or the second acquisition unit and acquiring the data content and data length of the portion, and a data length and data content of each portion detected by the first or the third acquisition unit Generating means for generating encoded data based on the encoding device.
【0009】また、上記の目的を達成するための本発明
の他の一態様によれば、所定のデータ長の符号列からな
るコマンドを解析する解析手段と、復号化済みのデータ
を記憶する記憶手段と、前記解析手段の解析結果に基づ
いて復号化データを出力する出力手段とを備え、前記出
力手段が、前記記憶手段より前記復号化済みのデータの
対応部分を取得して出力する第1出力手段と、複数種類
のサイズの中より指定されたサイズを有するデータを後
続の符号列より得て、これを指定された繰り返し数だけ
繰り返して出力する第2出力手段と、指定されたデータ
長のデータを後続の符号列より得て出力する第3出力手
段とを備える複合化装置が提供される。According to another aspect of the present invention for achieving the above object, an analyzing means for analyzing a command consisting of a code string having a predetermined data length, and a storage for storing decoded data. Means for outputting decoded data based on an analysis result of the analysis means, wherein the output means obtains and outputs a corresponding part of the decoded data from the storage means, and outputs the first data. An output unit, a second output unit that obtains data having a specified size from a plurality of sizes from a subsequent code string, and repeats and outputs the data by a specified repetition number, and a specified data length And a third output means for obtaining and outputting the following data from a subsequent code string.
【0010】[0010]
【発明の実施の形態】以下、添付の図面を参照して本発
明の好適な実施形態を説明する。Preferred embodiments of the present invention will be described below with reference to the accompanying drawings.
【0011】図1は本発明の第1の実施形態による印刷
システムのハードウエア構成を説明するブロック図であ
る。FIG. 1 is a block diagram illustrating a hardware configuration of a printing system according to a first embodiment of the present invention.
【0012】図1において、1はホストコンピュータで
あり、CPU2、メモリ3、ハードディスク4、フロッ
ピー(登録商標)ドライブ5およびホストパラレルポー
ト6を備える。ホストコンピュータ1とプリンタ7と
は、ホストパラレルポート6を介して接続されている。In FIG. 1, reference numeral 1 denotes a host computer, which comprises a CPU 2, a memory 3, a hard disk 4, a floppy (registered trademark) drive 5, and a host parallel port 6. The host computer 1 and the printer 7 are connected via a host parallel port 6.
【0013】CPU2は、メモリ3に記憶された各種の
制御プログラム、およびアプリケーションプログラムを
実行する。メモリ3は、ハードディスク4またはフロッ
ピードライブ5から読み出されたプログラム、およびそ
のプログラムが必要とするデータを記憶する。The CPU 2 executes various control programs and application programs stored in the memory 3. The memory 3 stores a program read from the hard disk 4 or the floppy drive 5 and data required by the program.
【0014】ハードディスク4は、図2において後述す
るオペレーティングシステム10、アプリケーションプ
ログラム(アプリケーション)11、プリンタドライバ
プログラム12、通信ドライバプログラム15などのプ
ログラムを格納する。The hard disk 4 stores programs such as an operating system 10, an application program (application) 11, a printer driver program 12, and a communication driver program 15, which will be described later with reference to FIG.
【0015】フロッピードライブ5は、インストールデ
ィスク8などのフロッピーディスクを装着することがで
き、装着されたフロッピーディスクに格納されたプログ
ラムを読み取る。ホストパラレルポート6は、プリンタ
7にデータを送ることができる。プリンタ7は、ホスト
パラレルポート6から印刷データを受け取り、印刷を行
う。8はインストールディスクであり、本実施形態で
は、後述する図2に示すプリンタドライバプログラム1
2およびそれをインストールするためのインストールプ
ログラムを格納する。The floppy drive 5 can mount a floppy disk such as an installation disk 8, and reads a program stored in the mounted floppy disk. The host parallel port 6 can send data to the printer 7. The printer 7 receives print data from the host parallel port 6 and performs printing. Reference numeral 8 denotes an installation disk. In this embodiment, a printer driver program 1 shown in FIG.
2 and an installation program for installing it.
【0016】通常のインストール操作は、操作者がイン
ストールディスク8をフロッピードライブ5(あるいは
図示しないCD−ROMドライブ)にセットし、インス
トールプログラムを起動することで行われる。インスト
ールプログラムが起動されると、プリンタドライバプロ
グラム12がインストールディスク8から読み込まれ、
ハードディスク4に書き込まれる。また、インストール
プログラムはオペレーティングシステム10が提供する
機能を用いて、プリンタドライバプログラム12がアプ
リケーション11から使用可能となるように設定する。A normal installation operation is performed when an operator sets the installation disk 8 in the floppy drive 5 (or a CD-ROM drive not shown) and starts an installation program. When the installation program is started, the printer driver program 12 is read from the installation disk 8, and
The data is written to the hard disk 4. The installation program uses a function provided by the operating system 10 to set the printer driver program 12 so that the application 11 can use the printer driver program 12.
【0017】図2は、本実施形態による印刷装置を適用
可能な印刷システムの制御構成を示すブロック図であ
る。FIG. 2 is a block diagram showing a control configuration of a printing system to which the printing apparatus according to the present embodiment can be applied.
【0018】図2において、10はオペレーティングシ
ステム(OS)であり、CPU2、メモリ3、ハードデ
ィスク4、フロッピードライブ5、ホストパラレルポー
ト6などのハードウェア資源の管理、およびアプリケー
ションプログラム11、プリンタドライバプログラム1
2、通信プログラム15などのソフトウェアの管理を行
う。11はアプリケーションプログラムであり、操作者
の指示に従って印刷データを作成するとともに、オペレ
ーティングシステム10を経由してプリンタドライバプ
ログラム12に印刷指令を発行する。In FIG. 2, reference numeral 10 denotes an operating system (OS), which manages hardware resources such as a CPU 2, a memory 3, a hard disk 4, a floppy drive 5, a host parallel port 6, an application program 11, and a printer driver program 1.
2. Manage software such as the communication program 15. Reference numeral 11 denotes an application program which creates print data in accordance with an instruction from an operator and issues a print command to a printer driver program 12 via the operating system 10.
【0019】12はプリンタドライバプログラムであ
り、アプリケーションプログラム11から発行された印
刷指令に基づき、プリンタ7が印刷を行うためのビット
マップデータを作成し、後述する符号化手順によりビッ
トマップデータを符号化し、用紙サイズ、ビットマップ
データのラインの長さとライン数などの印刷制御に必要
なデータとともに符号化したビットマップデータを出力
する。15は通信プログラムであり、ホストパラレルポ
ート6を制御してプリンタ7にデータを送信する。A printer driver program 12 creates bitmap data for the printer 7 to perform printing based on a print command issued from the application program 11, and encodes the bitmap data according to an encoding procedure described later. Then, encoded bitmap data is output together with data necessary for print control such as a paper size, a line length and the number of lines of the bitmap data. A communication program 15 controls the host parallel port 6 to transmit data to the printer 7.
【0020】6はホストパラレルポートであり、IEE
E規格「IEEE Std 1284-1994」に規定される、8ビット
のデータ信号Data1からData8、プリンタ7を制御する4
ビットの制御信号nStorobe、nAutoFd、nSelectIn、nIni
t、プリンタ7の状態を示す5ビットの状態信号nAck、B
usy、PError、Select、nFaultにより、プリンタ7内の
プリンタパラレルポート16に接続される。Reference numeral 6 denotes a host parallel port, which is an IEEE
8-bit data signals Data1 to Data8 specified in the E standard "IEEE Std 1284-1994" and control the printer 7 4.
Bit control signals nStorobe, nAutoFd, nSelectIn, nIni
t, a 5-bit status signal nAck, B indicating the status of the printer 7
It is connected to the printer parallel port 16 in the printer 7 by usy, PError, Select, and nFault.
【0021】次に、プリンタ7の制御構成について説明
する。プリンタパラレルポート16は、前述の信号によ
りホストパラレルポート6に接続される。17は制御回
路であり、例えば1チップCPUで構成され、プリンタ
パラレルポート16、FIFOメモリ19、復号回路2
0、シフトレジスタ21、およびプリンタエンジン22
の制御を行う。Next, a control configuration of the printer 7 will be described. The printer parallel port 16 is connected to the host parallel port 6 by the above-mentioned signal. Reference numeral 17 denotes a control circuit, which is composed of, for example, a one-chip CPU, and includes a printer parallel port 16, a FIFO memory 19,
0, shift register 21, and printer engine 22
Control.
【0022】19はFIFO(ファーストインファース
トアウト)メモリであり、プリンタパラレルポート16
が受信したデータを記憶し、記憶したデータを先入れ先
出しの順に復号回路20に出力する。復号回路20は、
FIFOメモリ19に記憶された符号列データを復号
し、シフトレジスタ21に出力する。21はシフトレジ
スタであり、復号回路20が出力したパラレルデータを
シリアルデータに変換し、プリンタエンジン22に出力
する。22はプリンタエンジンであり、本実施形態では
レーザビームプリンタエンジンを用いる。プリンタエン
ジン22は、制御回路17との間でシリアル信号を用い
てエンジンコマンドの受信およびエンジンステータスの
送信を行い、制御回路17からPRINTコマンドを受
信すると1ページの印刷処理を開始し、用紙が所定の位
置に達するとシフトレジスタ21が出力したシリアルデ
ータに従って用紙への印刷を行う。Reference numeral 19 denotes a FIFO (first in first out) memory, which is a printer parallel port 16.
Stores the received data, and outputs the stored data to the decoding circuit 20 in a first-in first-out order. The decoding circuit 20
The code string data stored in the FIFO memory 19 is decoded and output to the shift register 21. Reference numeral 21 denotes a shift register, which converts the parallel data output from the decoding circuit 20 into serial data and outputs the serial data to the printer engine 22. A printer engine 22 uses a laser beam printer engine in this embodiment. The printer engine 22 receives an engine command and transmits an engine status using a serial signal with the control circuit 17, and starts a one-page printing process when a PRINT command is received from the control circuit 17, and the paper is set to a predetermined value. Is reached, the printing on the paper is performed according to the serial data output from the shift register 21.
【0023】以下、印刷動作について説明する。操作者
がホストコンピュータ1側でアプリケーションプログラ
ム11を操作して印刷データを生成し、その印刷を指示
すると、アプリケーションプログラム11からオペレー
ティングシステム10を経由してプリンタドライバプロ
グラム12に印刷指令が渡される。プリンタドライバプ
ログラム12はアプリケーションプログラム11から発
行された印刷指令に基づき、ビットマップデータを作成
する。そして、プリンタドライバプログラム12は、後
述する符号化手順に基づき、作成したビットマップデー
タから符号化データを生成し、用紙サイズ、ビットマッ
プデータのラインの長さとライン数などの印刷制御に必
要なデータとともに出力する。通信プログラム15は、
プリンタドライバプログラム12が作成した、印刷制御
に必要なデータおよび符号化データを、ホストパラレル
ポート6を経由して送信する。Hereinafter, the printing operation will be described. When the operator operates the application program 11 on the host computer 1 side to generate print data and instructs printing, print instructions are passed from the application program 11 to the printer driver program 12 via the operating system 10. The printer driver program 12 creates bitmap data based on a print command issued from the application program 11. The printer driver program 12 generates encoded data from the created bitmap data based on an encoding procedure described later, and generates data necessary for print control such as a paper size, a line length and the number of lines of the bitmap data. Output with The communication program 15
The data and encoded data necessary for print control created by the printer driver program 12 are transmitted via the host parallel port 6.
【0024】制御回路17はプリンタパラレルポート1
6を経由してこれを受信する。受信したコマンドが印刷
の開始を指示するコマンドであった場合、制御回路17
はプリンタエンジン22にPRINTコマンドを送信す
る。プリンタエンジン22はPRINTコマンドを受信
すると、印刷を開始する。The control circuit 17 is a printer parallel port 1
6 and receives it. If the received command is a command for instructing the start of printing, the control circuit 17
Transmits a PRINT command to the printer engine 22. Upon receiving the PRINT command, the printer engine 22 starts printing.
【0025】復号回路20は、後述する復号手順に基づ
き、FIFOメモリ19に格納された符号化データを復
号してシフトレジスタ21に出力する。シフトレジスタ
21は主走査の長さをカウントするカウンタを持ち、プ
リンタエンジン22から主走査の開始が通知される毎
に、カウンタに所定の値を設定した後、カウンタが
「0」より大である間、所定のタイミングで復号回路2
0が出力したパラレルデータをシリアルデータに変換
し、プリンタエンジン22に出力するとともにカウンタ
を減算する。プリンタエンジン22は用紙が所定の位置
に達すると、主走査開始毎にデータの出力が必要である
ことを通知するとともに、シフトレジスタ21が出力し
たシリアルデータに基づき、印刷を行う。The decoding circuit 20 decodes the encoded data stored in the FIFO memory 19 and outputs the decoded data to the shift register 21 based on a decoding procedure described later. The shift register 21 has a counter for counting the length of the main scan. Each time the start of the main scan is notified from the printer engine 22, the counter is set to a predetermined value and then the counter is larger than "0". And the decoding circuit 2 at a predetermined timing.
The parallel data output by 0 is converted into serial data, output to the printer engine 22, and decremented by a counter. When the paper reaches a predetermined position, the printer engine 22 notifies that data output is required every time the main scanning is started, and performs printing based on the serial data output from the shift register 21.
【0026】次に、図3乃至図5を参照して、本実施形
態のプリンタドライバ12が生成する符号化データにつ
いて説明する。Next, coded data generated by the printer driver 12 of the present embodiment will be described with reference to FIGS.
【0027】図3は、図2に示したプリンタドライバ1
2が符号化データを生成するのに用いるコマンドコード
テーブルの一例を説明する図である。本実施形態で説明
する符号は、同一データバイトの繰り返しを示すバイト
リピート、同一データワードの繰り返しを示すワードリ
ピート、同一データダブルワードの繰り返しを示すダブ
ルワードリピートの各リピート、直前のラインのデータ
を複写するコピー、およびデータ列の内容を直接指定す
る生データの3種類の操作のうち、少なくとも一つを指
定する。ここでワードとは2バイトを、ダブルワードと
は4バイトを、それぞれあらわす。FIG. 3 shows the printer driver 1 shown in FIG.
FIG. 2 is a view for explaining an example of a command code table used for generating encoded data. Symbols described in the present embodiment are byte repeat indicating the repetition of the same data byte, word repeat indicating the repetition of the same data word, double word repeat indicating the repetition of the same data double word, and the data of the immediately preceding line. At least one of three types of operations, copy to copy and raw data for directly specifying the contents of a data string, is specified. Here, a word represents 2 bytes, and a double word represents 4 bytes.
【0028】図3に示すように、コマンドコードのビッ
トが「11000000」の場合はEOLコマンドであり、行末ま
で直前のラインをコピーすることを示す。As shown in FIG. 3, when the bit of the command code is "11000000", it is an EOL command, indicating that the line immediately before the end of the line is copied.
【0029】また、コマンドコードのビットが「111000
00」の場合はEOPコマンドであり、ページの終了を示
す。このコマンドは復号の終了を指示するのみで、画像
データは表現しない。When the bit of the command code is "111000
"00" is an EOP command, indicating the end of the page. This command only indicates the end of decoding, and does not represent image data.
【0030】また、コマンドコードの上位2ビットが
「01」の場合は、Copy thenRepeat Byteコマンドであ
り、直前のラインのデータを、下位3ビット(S0〜S2)
で指定されるバイト数(Sバイト)分複写した後、コマ
ンドコードの直後の1バイトの繰り返しデータを、中位
3ビット(L0〜L2)で指定されるLに2を加えた回数繰
り返すことを示す。If the upper 2 bits of the command code are "01", it is a Copy then Repeat Byte command, and the data of the immediately preceding line is replaced with the lower 3 bits (S0 to S2).
After copying the number of bytes (S bytes) specified by, repeat the 1-byte repetition data immediately after the command code by adding 2 to L specified by the middle three bits (L0 to L2). Show.
【0031】また、コマンドコードの上位3ビットが
「100」の場合は、Copy thenRepeat Wordコマンドであ
り、直前のラインのデータを、下位3ビットで指定され
るSバイト複写後、コマンドコードの直後の2バイトの
繰り返しデータを、中位2ビット(L0,L1)で指定され
るLに2を加えた回数繰り返すことを示す。If the upper three bits of the command code are "100", it is a Copy then Repeat Word command, and the data of the immediately preceding line is copied after the S byte specified by the lower three bits, and then immediately after the command code. This indicates that 2-byte repetition data is to be repeated the number of times obtained by adding 2 to L specified by the middle two bits (L0, L1).
【0032】また、コマンドコードの上位3ビットが
「101」の場合は、Copy thenRepeat Double Wordコマン
ドであり、直前のラインのデータを、下位3ビットで指
定されるSバイト複写後、コマンドコードの直後の4バ
イトの繰り返しデータを、中位2ビット(L0,L1)で指
定されるLに2を加えた回数繰り返すことを示す。If the upper 3 bits of the command code are "101", it is a Copy then Repeat Double Word command, and after copying the data of the immediately preceding line by the S byte specified by the lower 3 bits, immediately after the command code This means that the 4-byte repetition data is repeated by adding 2 to L specified by the middle two bits (L0, L1).
【0033】また、コマンドコードの上位2ビットが
「00」の場合は、Copy then Rawコマンドであり、直前
のラインのデータを、下位3ビットで指定されるSバイ
ト複写後、コマンドコードの直後に続く、中位3ビット
で指定されるR(R0〜R2)に、1を加えたバイト数のデ
ータをそのままデータとすることを示す。If the upper 2 bits of the command code are "00", it is a Copy then Raw command, and the data of the immediately preceding line is copied immediately after the command code after copying the S byte specified by the lower 3 bits. Subsequently, it indicates that data of the number of bytes obtained by adding 1 to R (R0 to R2) specified by the middle three bits is used as it is.
【0034】また、コマンドコードの上位3ビットが
「110」で、残りのビットのいずれかが1の場合は、Cop
yLongコマンドであり、直前のラインのデータを、下位
5ビット(S0〜S4)で指定されるSの8倍のバイトを複
写することを示す。If the upper 3 bits of the command code are "110" and any of the remaining bits is 1, Cop
This is a yLong command, which indicates that data of the immediately preceding line is to be copied eight times as many bytes as S specified by the lower 5 bits (S0 to S4).
【0035】また、コマンドコードの上位3ビットが
「111」で、残りのビットのいずれかが1の場合は、Ext
endコマンドであり、Extendコマンドコードに続く第2
のコマンドコードと組み合わされて一つのコマンドとな
り、下位5ビット(E0〜E4)で指定される数値Eに応じ
たカウントを、第2のコマンドコードが示すカウントに
加算されることを示す。When the upper 3 bits of the command code are "111" and any of the remaining bits are 1, the Ext
End command, the second following the Extend command code
And the command code is combined into one command, and the count corresponding to the numerical value E specified by the lower 5 bits (E0 to E4) is added to the count indicated by the second command code.
【0036】図4は、図3に示したExtendコマンドに後
続する第2のコマンドコードの一例を示す図である。FIG. 4 is a diagram showing an example of a second command code following the Extend command shown in FIG.
【0037】図4に示すように、第2のコマンドコード
の上位2ビットが「01」の場合は、Copythen Repeat By
te Longコマンドであり、直前のラインのデータを、下
位3ビット(S0〜S1)で指定されるSバイト複写後、第
2のコマンドコードの直後の1バイトの繰り返しデータ
を、中位3ビット(L0〜L2)で指定されるLに、Extend
コマンドで指定された数値Eの8倍を加え、さらに2を
加えた回数繰り返すことを示す。As shown in FIG. 4, when the upper two bits of the second command code are “01”, the Copythen Repeat By
This is a te Long command, and after copying the data of the immediately preceding line by S bytes specified by the lower 3 bits (S0 to S1), repeats the 1-byte repeated data immediately after the second command code by the middle 3 bits ( Extend to L specified by L0-L2)
8 times the numerical value E specified by the command is added, and 2 is added.
【0038】また、第2のコマンドコードの上位2ビッ
トが「10」の場合は、Copy thenRepeat Word Longコマ
ンドであり、直前のラインのデータを、下位3ビットで
指定されるSバイト複写後、第2のコマンドコードの直
後の2バイトの繰り返しデータを、中位3ビット(L0〜
L2)で指定されるLに、Extendコマンドで指定された数
値Eの8倍を加え、さらに2を減算した回数繰り返すこ
とを示す。If the upper 2 bits of the second command code are "10", it is a Copy then Repeat Word Long command, and the data of the immediately preceding line is copied after the S byte specified by the lower 3 bits. The 2-byte repeated data immediately after the command code of No. 2 is the middle 3 bits (L0 ~
It indicates that eight times the numerical value E specified by the Extend command is added to L specified by L2), and 2 is subtracted therefrom.
【0039】また、第2のコマンドコードの上位2ビッ
トが「11」の場合は、Copy thenRepeat Double Word Lo
ngコマンドであり、直前のラインのデータを、下位3ビ
ットで指定されるSバイト複写後、第2のコマンドコー
ドの直後の4バイトの繰り返しデータを、中位3ビット
で指定されるLに、Extendコマンドで指定された数値E
の8倍を加え、さらに2を減算した回数繰り返すことを
示す。When the upper two bits of the second command code are "11", Copy then Repeat Double Word Lo
ng command, after copying the data of the immediately preceding line by S bytes specified by the lower 3 bits, the 4 bytes of repeated data immediately after the second command code to L specified by the middle 3 bits, Numeric value E specified by Extend command
Is repeated 8 times, and 2 is subtracted.
【0040】また、第2のコマンドコードの上位2ビッ
トが「00」の場合は、Copy thenRawLongコマンドであ
り、直前のラインのデータを、下位3ビットで指定され
るSバイト複写後、第2のコマンドコードの直後に続
く、中位3ビット(R0〜R2)で指定されるRに、Extend
コマンドで指定された数値Eの8倍を加え、さらに1を
加えたバイト数のデータをそのままデータとすることを
示す。When the upper two bits of the second command code are “00”, it is a Copy then RawLong command, and after copying the data of the immediately preceding line by the S byte specified by the lower three bits, Extend to R specified by the middle 3 bits (R0 to R2) immediately following the command code
It indicates that data of the number of bytes obtained by adding eight times the numerical value E specified by the command and further adding 1 is used as it is.
【0041】次に図5を参照し、図3および図4に示さ
れる符号の実例を説明する。図5は、本実施形態による
コマンドの動作の一例を示す図である。Next, with reference to FIG. 5, an example of reference numerals shown in FIGS. 3 and 4 will be described. FIG. 5 is a diagram illustrating an example of a command operation according to the present embodiment.
【0042】図5に示す「0x01、0x01、0x48、0xFF、0x
E1、0x81、0x55、0x00、0xC0」は符号列の一部を示し、
一つのラインを表現している。また、ラインの長さは2
0バイトで、直前のラインは図に示すように、「(1)、
(2)、(3)、…(20)」となっている。As shown in FIG. 5, "0x01, 0x01, 0x48, 0xFF, 0x
`` E1, 0x81, 0x55, 0x00, 0xC0 '' indicates a part of the code string,
It represents one line. The line length is 2
0 bytes, and the previous line is “(1),
(2), (3), ... (20) ".
【0043】ここで図示の符号が与えられると、先頭の
コマンド「0x01」はビット列「00000001」であるので、
Copythen Rawコマンドであり、コピー数Sは1、生デー
タサイズ(R+1)は1である。したがって、1バイト
のデータ「(1)」が直前のラインからコピーされた後
に、コマンドコードに続く1バイトのデータ「0x01」が
そのままデータとなる(参照番号51を参照)。If the code shown in the figure is given, the first command "0x01" is a bit string "00000001".
This is a Copythen Raw command, the number of copies S is 1, and the raw data size (R + 1) is 1. Therefore, after the 1-byte data "(1)" is copied from the immediately preceding line, the 1-byte data "0x01" following the command code becomes the data as it is (see reference numeral 51).
【0044】次のコマンド「0x48」はビット列「010010
00」であるので、Copy thenRepeatByteコマンドであ
り、コピー数Sは0、リピート数(L+2)は3であ
る。したがって、当該コマンドコードに続く1バイトの
繰り返しデータ「0xFF」が3回繰り返されることになる
(参照番号52を参照)。The next command "0x48" is a bit string "010010".
00 ”, it is a Copy thenRepeatByte command, the number of copies S is 0, and the number of repeats (L + 2) is 3. Therefore, the one-byte repeated data “0xFF” following the command code is repeated three times (see reference numeral 52).
【0045】次のコマンド「0xE1」はビット列「111000
01」であるので、Extendコマンドであり、Eは1であ
る。第2のコマンドコード「0x81」はビット列「100000
01」であるので、Copythen Repeat Word Longコマンド
であり、コピー数Sは0、またLは0、したがってリピ
ート数「L+8×E−2」は6である。したがって、1
バイトのデータ「(6)」が直前のラインからコピーされ
た後に、第2のコマンドコードに続く2バイトの繰り返
しデータ「0x55、0x00」が6回繰り返される(参照番号
53を参照)。The next command "0xE1" is a bit string "111000
01 ”, it is an Extend command, and E is 1. The second command code “0x81” corresponds to the bit string “100000
01 ", it is a Copythen Repeat Word Long command, the copy number S is 0, and L is 0, so the repeat number" L + 8 * E-2 "is 6. Therefore, 1
After the byte data "(6)" is copied from the immediately preceding line, the 2-byte repeated data "0x55, 0x00" following the second command code is repeated six times (see reference numeral 53).
【0046】次のコマンド「0xC0」はビット列「110000
00」であるので、EOLコマンドであり、行末までの2バ
イト「(19)、(20)」が直前のラインからコピーされる
(参照番号54を参照)。The next command "0xC0" is a bit string "110000".
00 ”, it is an EOL command, and two bytes“ (19), (20) ”up to the end of the line are copied from the immediately preceding line (see reference numeral 54).
【0047】次に、複数の操作を同時に符号化すること
による効果について説明する。複写・繰り返し・生デー
タの操作を用いて符号化を行った場合、複数の操作を同
時に符号化しなければ、複写・繰り返し・生データのそ
れぞれについて1バイトのコマンドにしなければならな
い。複写と繰り返し、複写と生データ、または繰り返し
と生データを同時に符号化すれば、2つの操作を1バイ
トのコマンドにすることができ、圧縮率が向上する。Next, the effect of simultaneously encoding a plurality of operations will be described. When encoding is performed using copy / repetition / raw data operation, unless a plurality of operations are simultaneously encoded, each of the copy / repetition / raw data must be a one-byte command. If the copying and repetition, the copying and the raw data, or the repetition and the raw data are encoded at the same time, the two operations can be converted into one-byte commands, and the compression ratio is improved.
【0048】一方、複数の操作を同時に符号化すること
により、1バイトのコマンドで表現することができる長
さは短くなる。例えば、複写・繰り返し・生データのそ
れぞれについて1バイトのコマンドにした場合は、2ビ
ットを操作の区別に使ったとして、長さを表現するのに
6ビット使用することができ、63程度までの長さが表
現できる。これに対して、複数の操作を同時に符号化し
た場合、上述の例では長さを表現するのに3ビットしか
使用できず、7程度までの長さしか使用できない。On the other hand, by encoding a plurality of operations at the same time, the length that can be expressed by a 1-byte command is reduced. For example, in the case of a 1-byte command for each of copy, repetition, and raw data, assuming that 2 bits are used for distinguishing operations, 6 bits can be used to represent the length, and up to about 63 Length can be expressed. On the other hand, if a plurality of operations are encoded simultaneously, only three bits can be used to represent the length in the above example, and only a length up to about seven can be used.
【0049】プリンタで印刷されるビットマップでは、
直前のラインと類似しているが、少しずつ違うのが一般
的である。このため、長さの短い複写と長さの短い繰り
返し、あるいは長さの短い複写と長さの短い生データの
組み合わせが非常に多くなることが多い。特にテキス
ト、すなわち文字フォントを印刷する場合にこの傾向が
顕著である。このため、長さを制限して複数の操作を同
時に符号化したほうが圧縮率が向上することが多い。従
って、プリンタ用のデータに適用する場合、本実施形態
のように複数の操作を同時に符号化するほうが、圧縮率
が向上する。In a bitmap printed by a printer,
It is similar to the previous line, but generally slightly different. For this reason, the combination of short-length copying and short-length repetition, or short-length copying and short-length raw data is often very large. This tendency is particularly remarkable when printing text, that is, character fonts. For this reason, it is often the case that the compression rate is improved by simultaneously encoding a plurality of operations while limiting the length. Therefore, when the present invention is applied to data for a printer, the compression rate is improved by encoding a plurality of operations at the same time as in the present embodiment.
【0050】次に、EOLコマンドの効果について説明す
る。EOLコマンドは行末まで複写を行うものなので、あ
る長さの複写コマンドに置き換え可能である。プリンタ
が印刷するビットマップは、右側にある程度の余白があ
るのが一般的である。例えば右余白の長さが2.54セ
ンチメートルで、プリンタが600dpiのレーザービ
ームプリンタであり、1画素が4ビットの場合、240
0ビットの余白となり、300バイトに相当する。長さ
300の複写を表現するためには、長さ256および4
0のCopy Longコマンドと、図3では定義され
ていない長さ4のCopyコマンドが必要で合わせて3
バイトとなる。EOLコマンドは長さを含まないため、作
用するバイト数に関わらず1バイトで表現することが可
能であり、符号の圧縮率が向上するとともに、長さ1か
ら7までのCopyコマンドが不要になる。Next, the effect of the EOL command will be described. Since the EOL command is used to copy until the end of the line, it can be replaced with a copy command of a certain length. Generally, a bitmap printed by a printer has a certain amount of blank space on the right side. For example, if the length of the right margin is 2.54 cm, the printer is a laser beam printer of 600 dpi, and one pixel is 4 bits,
It becomes a blank of 0 bits, which is equivalent to 300 bytes. To represent a copy of length 300, lengths 256 and 4
A Copy Long command of length 0 and a Copy command of length 4 not defined in FIG.
It becomes bytes. Since the EOL command does not include a length, it can be represented by 1 byte regardless of the number of bytes that act, improving the code compression rate and eliminating the need for Copy commands of lengths 1 to 7. .
【0051】つぎに、プリンタドライバ12による符号
化処理について説明する。図6A及び図6Bは、本実施
形態によるプリンタドライバの符号化処理を説明するフ
ローチャートである。図6Aにおいて、まず、ステップ
S11において、処理対象の行と直前の行のデータとが
連続して一致するバイトの数を取得し、これを変数copy
に格納する。ステップS12では、直前の行と行末まで
一致していたかどうかを判断する。行末まで一致してい
ればステップS13へ進み、EOLコマンドを出力し、ス
テップS31へ進む。一方、行末に到達していなけれ
ば、ステップS14へ進み、変数copyの内容が8以上で
あるかどうかを判断する。ここで、copy≧8の場合はス
テップS15でCopyLongコマンドを生成視、ステップS
16へ進む。なお、copyの大きさによっては、Copy Lon
gコマンドが複数生成されることになる。また、ステッ
プS14において、copy≦7の場合は、ステップS15
をスキップして、ステップS16へ進む。Next, the encoding process performed by the printer driver 12 will be described. FIG. 6A and FIG. 6B are flowcharts illustrating the encoding process of the printer driver according to the present embodiment. In FIG. 6A, first, in step S11, the number of bytes in which the row to be processed and the data in the immediately preceding row continuously match is obtained, and this is set as a variable copy.
To be stored. In step S12, it is determined whether or not the previous line matches the end of the line. If they match up to the end of the line, the process proceeds to step S13, outputs an EOL command, and proceeds to step S31. On the other hand, if the end of the line has not been reached, the process proceeds to step S14, and it is determined whether or not the content of the variable copy is 8 or more. Here, if copy ≧ 8, a CopyLong command is generated and viewed in step S15.
Proceed to 16. Depending on the size of the copy, Copy Lon
Multiple g commands will be generated. Also, in step S14, if copy ≦ 7, step S15
Skip to step S16.
【0052】ステップS16では、同一バイトの繰返し
数を調べ、変数lenに格納する。この処理は、Copythen
Repeat Byte Longが最大257回の繰り返しまでしか指
定できないため、lenが257以下で、かつ、処理が行
末に到達するまでの間において行われることになる。ス
テップS16の処理の結果、lenに0以外の数値が入っ
ていればステップS17からステップS18へ進み、co
py内の数値とlen内の数値に従って(copyの値でS0〜S3
を生成し、lenの値に基づいてL0〜L2或いはE0〜E4を生
成する)Copythen Repeat Byte或いはCopy then Repeat
Byte Longを生成する。In step S16, the number of repetitions of the same byte is checked and stored in a variable len. This process is called Copythen
Since Repeat Byte Long can be specified only up to 257 repetitions, it is performed until len is 257 or less and processing reaches the end of the line. If the result of the processing in step S16 is that len contains a numerical value other than 0, the process proceeds from step S17 to step S18, where co
According to the numerical value in py and the numerical value in len (S0 ~ S3
And then generates L0-L2 or E0-E4 based on the value of len) Copythen Repeat Byte or Copy then Repeat
Generate Byte Long.
【0053】ステップS17においてlenが0であった
場合は、ステップS20において、同一ワードの繰返し
数(同一の、連続する2バイトが繰り返される数)を調
べ、変数lenに格納する。この処理は、Copythen Repeat
Word Longが最大253回の繰り返しまでしか指定でき
ないため、lenが253以下で、かつ、処理が行末に到
達するまでの間において行われることになる。ステップ
S20の処理の結果、lenに0以外の数値が入っていれ
ばステップS21からステップS22へ進み、copy内の
数値とlen内の数値に従って(copyの値でS0〜S3を生成
し、lenの値に基づいてL0〜L2或いはE0〜E4を生成す
る)、Copythen Repeat Word或いはCopy then Repeat W
ord Longを生成する。If len is 0 in step S17, the number of repetitions of the same word (the number of repetitions of the same two consecutive bytes) is checked in step S20 and stored in the variable len. This process is called Copythen Repeat
Since Word Long can be specified only up to 253 repetitions, it is performed until len is less than 253 and the processing reaches the end of the line. As a result of the processing in step S20, if len contains a numerical value other than 0, the process proceeds from step S21 to step S22, and according to the numerical value in copy and the numerical value in len (S0 to S3 are generated by the value of copy, and Generate L0-L2 or E0-E4 based on the value), Copythen Repeat Word or Copy then Repeat W
Generates ord Long.
【0054】ステップS21においてlenが0であった
場合は、ステップS24において、同一ダブルワードの
繰返し数(同一の、連続する4バイトが繰り返される
数)を調べ、変数lenに格納する。この処理は、Copythe
n Repeat Double Word Longが最大253回の繰り返し
までしか指定できないため、lenが253以下で、か
つ、処理が行末に到達するまでの間において行われるこ
とになる。ステップS24の処理の結果、lenに0以外
の数値が入っていればステップS25からステップS2
6へ進み、copy内の数値とlen内の数値に従って(copy
の値でS0〜S3を生成し、lenの値に基づいてL0〜L2或い
はE0〜E4を生成する)、Copythen Repeat Double Word
或いはCopy then Repeat Double Word Longを生成す
る。If len is 0 in step S21, the number of repetitions of the same double word (the number of repetitions of the same four consecutive bytes) is checked in step S24 and stored in the variable len. This process is called Copythe
Since n Repeat Double Word Long can be specified only up to 253 repetitions, it is performed until len is 253 or less and processing reaches the end of the line. If the result of the processing in step S24 is that len contains a numerical value other than 0, the processing proceeds from step S25 to step S2.
6 and follow the values in copy and len (copy
Generate S0-S3 with the value of len and generate L0-L2 or E0-E4 based on the value of len), Copythen Repeat Double Word
Or, generate Copy then Repeat Double Word Long.
【0055】更に、ステップ25においてlenが0であ
った場合は、前の行とのバイトの一致、バイト単位の繰
り返し、ワード単位の繰り返し、ダブルワード単位の繰
り返しが見出せない場合である。この場合、ステップS
28において、前の行とのバイトの一致、バイト単位の
繰り返し、ワード単位の繰り返し、ダブルワード単位の
繰り返しが見出せない間のバイト数をカウントし、これ
をlenに格納する(この処理においてlenは必ず1以上と
なる)。そして、ステップS29において、copy内の数
値とlen内の数値に従って(copyの値でS0〜S3を生成
し、lenの値に基づいてR0〜R2或いはE0〜E4を生成す
る)、Copythen Rawを生成する。Further, if len is 0 in step 25, it means that no byte match with the previous line, no repetition in byte units, no repetition in word units, and no repetition in double word units can be found. In this case, step S
At 28, count the number of bytes during which no byte match with previous row, repeat by byte, repeat by word, repeat by doubleword is found and store this in len (in this process len is Be sure to be 1 or more). Then, in step S29, Copythen Raw is generated according to the numerical value in copy and the numerical value in len (S0 to S3 are generated by the value of copy, and R0 to R2 or E0 to E4 are generated based on the value of len). I do.
【0056】以上のようにして、ステップS18、S2
2、S26、S29のいずれかでコマンドが生成される
と、処理はステップS30へ進み、処理が当該行の行末
に到達したかどうかを判断し、まだ到達していなければ
処理をステップS11へ戻し、当該行について上述の処
理を繰り返す。一方、ステップS30において行末に到
達したと判断された場合は、ステップS31へ進み、次
に処理するべき行が存在するかどうか、すなわち、ペー
ジの終了を判断する。ページの終了である(当該印刷ペ
ージにおいて次に処理すべき行が無いと判断された場合
は、ステップS32へ進みEOPコマンドを生成して本処
理を終了する。一方、まだ処理すべき行があると判断さ
れた場合は、ステップS33へ進み、次の行を処理対象
としてステップS11へ処理を戻す。次に、図7および
図8に示すプログラムリストを参照し、プリンタドライ
バ12の符号化手順の詳細を説明する。As described above, steps S18 and S2
If a command is generated in any of 2, S26, and S29, the process proceeds to step S30, determines whether the process has reached the end of the line, and if not, returns the process to step S11. The above process is repeated for the row. On the other hand, when it is determined in step S30 that the end of the line has been reached, the process proceeds to step S31, and it is determined whether there is a line to be processed next, that is, the end of the page. This is the end of the page (if it is determined that there is no line to be processed next in the print page, the process proceeds to step S32 to generate an EOP command and end this processing. On the other hand, there is still a line to be processed If it is determined, the process proceeds to step S33, and the process returns to step S11 with the next line as a processing target.Then, referring to the program list shown in FIGS. Details will be described.
【0057】図7は、図6A及び図6Bで説明したプリ
ンタドライバ12の符号化手順を実現するためのプログ
ラムリスト例を示す図である。図7のプログラムは、C
言語で記述された関数で構成される。FIG. 7 is a diagram showing an example of a program list for realizing the encoding procedure of the printer driver 12 described with reference to FIGS. 6A and 6B. The program in FIG.
Consists of functions written in a language.
【0058】図7において、行1は関数名、引数、およ
び戻り値の型を定義する。この関数の関数名はencodeで
あり、呼び元からビットマップデータの先頭アドレスsr
c、符号化データを格納するバッファの先頭アドレスds
t、1ラインのバイト数widthおよびライン数heightを受
け取り、ビットマップデータを符号化して符号化データ
をバッファに格納し、戻り値としてバッファに格納した
バイト数を返す。In FIG. 7, line 1 defines the function name, arguments, and return type. The function name of this function is encode, and the start address sr of the bitmap data is
c, start address ds of buffer for storing encoded data
t, the byte number width and the line number height of one line are received, the bitmap data is encoded, the encoded data is stored in the buffer, and the number of bytes stored in the buffer is returned as a return value.
【0059】符号化処理の過程で先頭アドレスsrc、先
頭アドレスdstは各々ビットマップデータの未処理のラ
インの先頭アドレス、未処理のバッファの先頭アドレス
を示すように更新される。During the encoding process, the start address src and the start address dst are updated to indicate the start address of the unprocessed line of the bitmap data and the start address of the unprocessed buffer, respectively.
【0060】行3、行4、行5および行6は一時変数
x、y、len、copy、copy2、data、dsttop、dataw、p
w、datad、pdwを定義する。xはビットマップデータ
の、処理中のラインの先頭からのオフセットを格納す
る。yは処理中のライン番号を格納する。lenは処理中
の生データの長さ、または繰り返しの長さを格納する。
copyおよびcopy2は処理中の繰り返し数を格納する。dat
aは繰り返しデータを格納する。また、dsttopは関数enc
odeが呼び出されたときの符号化データを格納するバッ
ファの先頭アドレスdstを記憶する。datawはワードデー
タを一時的に格納する領域であり、pwはワードデータを
指すポインタを一時的に格納する領域である。また、da
tadはダブルワードデータを一時的に格納する領域であ
り、pdはダブルワードデータを指すポインタを一時的に
格納する領域である。Lines 3, 4, 5, and 6 are temporary variables x, y, len, copy, copy2, data, dsttop, dataw, p
Define w, datad, pdw. x stores the offset of the bitmap data from the head of the line being processed. y stores the number of the line being processed. len stores the length of the raw data being processed or the length of repetition.
copy and copy2 store the number of repetitions being processed. dat
a stores repeated data. Also, dsttop is a function enc
The start address dst of the buffer that stores the encoded data when ode is called is stored. dataw is an area for temporarily storing word data, and pw is an area for temporarily storing a pointer to the word data. Also, da
tad is an area for temporarily storing double word data, and pd is an area for temporarily storing a pointer pointing to double word data.
【0061】関数encodeが呼び出されると、行4でバッ
ファの先頭アドレスdstの値をdsttopに格納する。When the function encode is called, the value of the buffer start address dst is stored in dsttop in line 4.
【0062】次に行7から行74までの第1のforルー
プで、yを0に初期化し、yがheightに等しくなるまで
ループを繰り返す。各ループの最後では、yに1が加算
され、srcにwidthすなわち1ラインの長さが加算される
(S31、S33)。Next, in the first for loop from row 7 to row 74, y is initialized to 0, and the loop is repeated until y becomes equal to height. At the end of each loop, 1 is added to y, and width, that is, the length of one line is added to src (S31, S33).
【0063】第1のforループの中では行8から行73
までの第2のforループが実行される。第2のforループ
では、xを0に初期化し、xがwidthに等しくなるまで
ループを繰り返す(S30)。In the first for loop, lines 8 to 73
The second for loop up to is executed. In the second for loop, x is initialized to 0, and the loop is repeated until x becomes equal to width (S30).
【0064】[ステップS11〜S15に相当する処
理]第2のforループの中では、まず行9にてcopyに0
を設定する。次に行10にてyが0であるか判定し、y
が0であれば先頭ラインなので行24に進む。yが0で
ない場合は、直前のラインのデータと比較するため、ま
ず行11から行13までのwhileループを実行する。whi
leループでは、xがwidthより小さく、かつsrc[x]す
なわち現在のラインのx番目のバイト(現在のバイト)
と、src[x−width]すなわち直前のラインのx番目の
バイト(現在のバイトの直上のバイト)が等しい間、行
12にてxとcopyに1を加算する。whileループを抜け
た時点で、copyには直前のラインとデータが連続して一
致する長さ、すなわちコピーカウントが格納され、xは
その長さに応じて更新される。次に行14にてxとwidt
hが等しいか判定する。xとwidthが等しい場合は、行末
まで連続して直前のラインとデータが一致しており、EO
Lコマンドに符号化することができるので、行15にて
出力バッファに0xC0すなわちEOLコマンドを格納し、dst
を更新し、行16のbreakにより第2のforループを終了
する。[Processes Corresponding to Steps S11 to S15] In the second for loop, the copy
Set. Next, it is determined whether or not y is 0 in row 10, and y is determined.
If it is 0, it goes to row 24 because it is the top line. If y is not 0, a while loop from line 11 to line 13 is first executed to compare with the data of the immediately preceding line. whi
In the le loop, x is less than width and src [x], the xth byte of the current line (current byte)
While src [x-width], the xth byte of the previous line (the byte immediately above the current byte), is equal to 1 in x and copy in row 12. At the point of exit from the while loop, copy stores the length at which the immediately preceding line and the data continuously match, that is, the copy count, and x is updated according to the length. Next, at line 14, x and widt
Determine whether h is equal. If x and width are equal, data matches the previous line continuously until the end of the line, and EO
Since it can be encoded into an L command, 0xC0, that is, the EOL command is stored in the output buffer in row 15, and dst
Is updated, and the break in line 16 terminates the second for loop.
【0065】xとwidthが等しくない場合は、行18か
ら行22までのwhileループを実行する。whileループで
は、copyが7より大である間、行19から行21までの
処理を繰り返す。まず、行19にてcopy2にcopy/8と
31の大きくないほうを格納する。ここでminは2つの
引数のうち大きくない引数を返すマクロである。次に、
行20にてCopyLongコマンドを出力バッファに格納し、
dstを更新する。次に行21にてcopyから、行20で出
力したCopy Longコマンドに応じたコピーカウントを減
算する。このようにしてCopyLongコマンドが出力され、
whileループを抜けた時点では、copyは7以下になって
いる。If x and width are not equal, the while loop from line 18 to line 22 is executed. In the while loop, while copy is greater than 7, the processing from line 19 to line 21 is repeated. First, in line 19, copy2, which is not larger, is stored in copy2. Here, min is a macro that returns an argument that is not large among the two arguments. next,
In line 20, the CopyLong command is stored in the output buffer,
Update dst. Next, a copy count corresponding to the Copy Long command output in line 20 is subtracted from copy in line 21. The CopyLong command is output in this way,
At the time of exiting the while loop, copy is 7 or less.
【0066】[ステップS16〜S18に相当する処
理]次に行24にて、現在のバイトの次のバイトが現在
のラインに残されており、かつsrc[x]すなわち現在
のバイトとsrc[x+1]すなわちその次のバイトが一
致するか判定する。現在のバイトの次のバイトが現在の
ラインに残されていない場合、あるいは現在のバイトと
その次のバイトが一致しない場合はバイトの繰り返しが
ない場合なので行34に進む。現在のバイトの次のバイ
トが現在のラインに残されており、かつsrc[x]すな
わち現在のバイトとsrc[x+1]すなわちその次のバ
イトが一致する場合は繰り返し数を求めるため、まず行
25にてdataにsrc[x]すなわち繰り返しデータを格
納する。次に行26から行28までのforループを実行
する。forループでは、初期化処理として一致した2つ
のデータを飛ばすためにxに2を加算するとともに、le
nに2を格納し、xがwidthより小さくかつlenが257
より小さい間ループを実行する。各ループの最後では、
xとlenに1を加算する。ループ中、行27にて、src
[x]すなわち現在のデータがdataすなわち繰り返しデ
ータと等しくない場合には、breakによりこのforループ
を終了する。このようにして、ループを抜けた時点で
は、lenに連続する繰り返しデータの数が格納され、x
はlenの値に応じて更新されている。[Processes Corresponding to Steps S16 to S18] Next, in line 24, the byte next to the current byte is left in the current line, and src [x], that is, the current byte and src [x + 1] ] That is, it is determined whether the next byte matches. If the next byte of the current byte is not left on the current line, or if the current byte and the next byte do not match, there is no repetition of the byte, so go to line 34. If the byte next to the current byte is left on the current line and src [x], the current byte, and src [x + 1], the next byte, match, the line number is first determined in line 25. Then, src [x], that is, repeated data is stored in data. Next, a for loop from line 26 to line 28 is executed. In the for loop, 2 is added to x in order to skip two matched data as initialization processing, and le
Store 2 in n, x is smaller than width and len is 257
Execute loop while smaller. At the end of each loop,
Add 1 to x and len. In the loop, at line 27, src
If [x], that is, the current data is not equal to data, that is, the repeated data, break terminates the for loop. In this way, at the time of exiting the loop, the number of repeated data consecutive to len is stored, and x
Has been updated according to the value of len.
【0067】行29にてlenが7より大である場合にはE
xtendコマンドを出力バッファに格納してdstを更新し、
行30にてCopythen Repeatコマンドを出力バッファに
格納してdstを更新し、行31にてdataすなわち繰り返
しデータを出力バッファに格納してdstを更新し、行3
2のcontinueで第2のforループに戻る。If len is greater than 7 in line 29, E
Store the xtend command in the output buffer and update dst,
In line 30, the Copythen Repeat command is stored in the output buffer and dst is updated. In line 31, data, that is, the repeated data is stored in the output buffer and dst is updated.
Return to the second for loop with continue of 2.
【0068】[ステップS20〜S22に相当する処理]
行24にて、現在のバイトの次のバイトが現在のライン
に残されていない場合、あるいは現在のバイトとその次
のバイトが一致しない場合は行34にてワードデータへ
のポインタpwに&src[x]、すなわち現在のバイトの
アドレスを格納する。[Processes Corresponding to Steps S20 to S22]
At line 24, if the byte next to the current byte is not left on the current line, or if the current byte and the next byte do not match, at line 34 the pointer pw to the word data is set to & src [ x], that is, the address of the current byte.
【0069】次に行35にて、現在のバイトの次の3バ
イトが現在のラインに残されており、かつpw[0]すな
わち現在のワードとpw[1]すなわちその次のワードが
一致するか判定する。現在のバイトの次の3バイトが現
在のラインに残されていない場合、あるいは現在のワー
ドとその次のワードが一致しない場合はワードの繰り返
しがない場合なので行51に進む。現在のバイトの次の
3バイトが現在のラインに残されており、かつpw[0]
すなわち現在のワードとpw[1]すなわちその次のワー
ドが一致する場合は繰り返し数を求めるため、まず行3
6にてdatawにpw[0]すなわち繰り返しデータを格納
する。次に行37から行39までのforループを実行す
る。forループでは、初期化処理として一致した2つの
データを飛ばすためにxに4を加算するとともに、len
に2を格納し、x+1がwidthより小さくかつlenが25
3より小さい間ループを実行する。各ループの最後で
は、xに2を、lenに1をそれぞれ加算する。ループ
中、行38にて、pw[len]すなわち現在のデータがdat
awすなわち繰り返しデータと等しくない場合には、brea
kによりこのforループを終了する。このようにして、ル
ープを抜けた時点では、lenに連続する繰り返しデータ
の数が格納され、xはlenの値に応じて更新されてい
る。Next, at line 35, the next three bytes of the current byte are left on the current line, and pw [0], the current word, matches pw [1], the next word. Is determined. If the next three bytes of the current byte are not left on the current line, or if the current word and the next word do not match, then there is no word repetition, so go to line 51. The next three bytes of the current byte are left on the current line and pw [0]
That is, if the current word and pw [1], that is, the next word match, the number of repetitions is calculated.
In step 6, pw [0], that is, repeated data is stored in dataw. Next, a for loop from line 37 to line 39 is executed. In the for loop, 4 is added to x in order to skip two matched data as initialization processing, and len
Is stored in x, and x + 1 is smaller than width and len is 25
Run the loop for less than three. At the end of each loop, 2 is added to x and 1 is added to len. During the loop, at line 38, pw [len], that is, the current data is dat
aw, if not equal to the repetition data, brea
This for loop is ended by k. In this way, at the time of exiting the loop, the number of repeated data consecutive to len is stored, and x is updated according to the value of len.
【0070】行40にてlenが5より大でない場合には
行41にてCopy then RepeatWordコマンドを出力バッフ
ァに格納してdstを更新する。行40にてlenが5より大
である場合には、行43にてExtendコマンドを出力バッ
ファに格納してdstを更新し、行44にてCopythen Repe
at Word Longコマンドを出力バッファに格納してdstを
更新する。If len is not greater than 5 in line 40, a Copy then RepeatWord command is stored in the output buffer in line 41 to update dst. If len is greater than 5 in line 40, the Extend command is stored in the output buffer in line 43 to update dst, and in line 44 Copythen Repe
Stores the at Word Long command in the output buffer and updates dst.
【0071】[ステップS24〜S26に相当する処
理]次に行46にてワードデータへのポインタpwにds
t、すなわち現在の出力アドレスを格納する。次に行4
7にて、*pw、すなわち現在の出力アドレスが指すワー
ド領域にdatawすなわち繰り返しデータを格納する。次
に行48にてdstを更新し、行49のcontinueで第2のf
orループに戻る。[Processes Corresponding to Steps S24 to S26] Next, in the row 46, the pointer pw to the word data is set to ds
t, that is, the current output address is stored. Then row 4
At 7, dataw, that is, repeated data, is stored in * pw, that is, the word area indicated by the current output address. Next, dst is updated in line 48, and the second f
or loop back.
【0072】行35にて、現在のバイトの次の3バイト
が現在のラインに残されていない場合、あるいは現在の
ワードとその次のワードが一致しない場合は行51にて
ダブルワードデータへのポインタpdに&src[x]、す
なわち現在のバイトのアドレスを格納する。At line 35, if the next three bytes of the current byte are not left on the current line, or if the current word and the next word do not match, at line 51 the double-word data is Store & src [x], that is, the address of the current byte, in the pointer pd.
【0073】次に行52にて、現在のバイトの次の7バ
イトが現在のラインに残されており、かつpd[0]すな
わち現在のダブルワードとpd[1]すなわちその次のダ
ブルワードが一致するか判定する。現在のバイトの次の
7バイトが現在のラインに残されていない場合、あるい
は現在のダブルワードとその次のダブルワードが一致し
ない場合はダブルワードの繰り返しがない場合なので行
68に進む。現在のバイトの次の7バイトが現在のライ
ンに残されており、かつpd[0]すなわち現在のダブル
ワードとpd[1]すなわちその次のダブルワードが一致
する場合は繰り返し数を求めるため、まず行53にてda
tadにpd[0]すなわち繰り返しデータを格納する。次
に行54から行56までのforループを実行する。forル
ープでは、初期化処理として一致した2つのデータを飛
ばすためにxに8を加算するとともに、lenに2を格納
し、x+3がwidthより小さくかつlenが253より小さ
い間ループを実行する。各ループの最後では、xに4
を、lenに1をそれぞれ加算する。ループ中、行55に
て、pd[len]すなわち現在のデータがdatadすなわち繰
り返しデータと等しくない場合には、breakによりこのf
orループを終了する。このようにして、ループを抜けた
時点では、lenに連続する繰り返しデータの数が格納さ
れ、xはlenの値に応じて更新されている。Next, at line 52, the next seven bytes of the current byte are left on the current line, and pd [0], the current doubleword, and pd [1], the next doubleword, Determine whether they match. If the next 7 bytes of the current byte are not left on the current line, or if the current doubleword and the next doubleword do not match, there is no doubleword repetition, so go to line 68. If the next 7 bytes of the current byte are left on the current line and pd [0], the current doubleword, and pd [1], the next doubleword, match, find the number of repetitions, First at line 53, da
pd [0], that is, repeated data is stored in tad. Next, a for loop from line 54 to line 56 is executed. In the for loop, 8 is added to x and 2 is stored in len in order to skip two matched data as initialization processing, and the loop is executed while x + 3 is smaller than width and len is smaller than 253. At the end of each loop, x is 4
Is added to len. During the loop, at line 55, if pd [len], ie, the current data is not equal to datad, ie, the repeated data, break causes this f
or end loop. In this way, at the time of exiting the loop, the number of repeated data consecutive to len is stored, and x is updated according to the value of len.
【0074】行57にてlenが5より大でない場合には
行58にてCopy then RepeatDoubleWordコマンドを出力
バッファに格納してdstを更新する。行57にてlenが5
より大である場合には、行60にてExtendコマンドを出
力バッファに格納してdstを更新し、行61にてCopythe
n Repeat Double Word Longコマンドを出力バッファに
格納してdstを更新する。If len is not larger than 5 in the line 57, a Copy then RepeatDoubleWord command is stored in the output buffer in a line 58 to update dst. In line 57, len is 5
If it is larger, the Extend command is stored in the output buffer at line 60 and dst is updated.
n Stores the Repeat Double Word Long command in the output buffer and updates dst.
【0075】次に行63にてダブルワードデータへのポ
インタpdにdst、すなわち現在の出力アドレスを格納す
る。次に行64にて、*pd、すなわち現在の出力アドレ
スが指すダブルワード領域にdatadすなわち繰り返しデ
ータを格納する。次に行65にてdstを更新し、行66
のcontinueで第2のforループに戻る。Next, at line 63, dst, that is, the current output address is stored in the pointer pd to the double word data. Next, in line 64, datad, that is, repeated data is stored in * pd, that is, the double word area indicated by the current output address. Next, dst is updated in line 65, and line 66 is updated.
Returns to the second for loop with continue.
【0076】[ステップS28〜S29に相当する処
理]行52にて、現在のバイトの次の7バイトが現在の
ラインに残されていない場合、あるいは現在のダブルワ
ードとその次のダブルワードが一致しない場合は行68
にて、後述する関数count_rawを呼び出すことにより、
生データとして格納すべき長さをlenに格納する。次に
行69にてlenが7より大である場合にはExtendコマン
ドを出力バッファに格納してdstを更新し、行70にてC
opythen Rawコマンドを出力バッファに格納してdstを更
新し、行71にてライブラリ関数memcpyにより出力バッ
ファに生データをコピーし、行72にて行71でコピー
した生データの長さに応じてxとdstを更新し、第2のf
orループに戻る。[Processes Corresponding to Steps S28 to S29] In the row 52, if the next 7 bytes of the current byte are not left in the current line, or the current double word and the next double word match. Line 68 if not
By calling the function count_raw described below,
The length to be stored as raw data is stored in len. Next, if len is greater than 7 in line 69, the Extend command is stored in the output buffer and dst is updated.
The opythen Raw command is stored in the output buffer to update dst, the raw data is copied to the output buffer by the library function memcpy in line 71, and x is set according to the length of the raw data copied in line 71 in line 72. And dst and update the second f
or loop back.
【0077】このようにして現在のラインが全て処理さ
れてxがwidthと等しくなると、第2のforループを終了
し、第1のforループに戻る。各ループの最後では、y
に1が加算され、srcにwidthすなわち1ラインの長さが
加算されるので、次のラインの処理が開始される。この
ようにして全てのラインの処理が終了してyがheightと
等しくなると、第1のforループを終了し、行75にて0
xE0、すなわちEOPコマンドを出力バッファに格納
し、dstを更新する。次に行76にてdst即ちバッファの
終了アドレスからdsttop即ちバッファの先頭アドレスを
引くことによりバッファに格納したバイト数を求め、そ
れを戻り値として関数を終了する。When all the current lines have been processed in this way and x becomes equal to the width, the second for loop is terminated, and the process returns to the first for loop. At the end of each loop, y
, And the width, that is, the length of one line, is added to src, so that the processing of the next line is started. When the processing of all the lines is completed in this way and y becomes equal to the height, the first for loop is ended, and 0
xE0, that is, the EOP command is stored in the output buffer, and dst is updated. Next, in line 76, the number of bytes stored in the buffer is obtained by subtracting dsttop, ie, the start address of the buffer, from dst, ie, the end address of the buffer, and the function is terminated using that as the return value.
【0078】次に、図7に示すプログラムリストを参照
し、関数count_rawの処理手順の詳細を説明する。Next, the processing procedure of the function count_raw will be described in detail with reference to the program list shown in FIG.
【0079】図8は、図7に示した関数count_rawを実
現するためのプログラムリスト例を示す図である。図8
は、プログラム言語としてC言語を用いて記述された例
を示している。FIG. 8 is a diagram showing an example of a program list for realizing the function count_raw shown in FIG. FIG.
Shows an example described using C language as a programming language.
【0080】図8において、行1は関数名、引数、およ
び戻り値の型を定義する。この関数の関数名はcount_ra
wであり、呼び元からビットマップデータの現在のライ
ンの先頭アドレスsrc、現在位置のラインの先頭からの
オフセットx、ライン番号y、1ラインのバイト数widt
h、生データの長さの上限limitを受け取り、戻り値とし
て生データとして格納すべき長さを返す。In FIG. 8, line 1 defines a function name, an argument, and a return value type. The function name of this function is count_ra
w, the head address src of the current line of the bitmap data from the caller, the offset x from the head of the line at the current position, the line number y, the number of bytes of one line widt
h, receives the upper limit of the raw data length limit, and returns the length to be stored as raw data as a return value.
【0081】処理の過程で現在位置のラインの先頭から
のオフセットxは現在位置を示すように更新されるが、
C言語の規約により引数は値で渡されるため、更新され
た値は呼びもとの引数には反映されない。During the process, the offset x from the head of the line at the current position is updated to indicate the current position.
The argument is passed by value according to the C language convention, so the updated value is not reflected in the calling argument.
【0082】行3、行4および行5は一時変数len、p
w、pdを定義する。lenは生データとして格納すべき長さ
を格納する。pwはワードデータを指すポインタを一時的
に格納する領域である。 また、pdはダブルワードデー
タを指すポインタを一時的に格納する領域である。Lines 3, 4 and 5 are temporary variables len, p
Define w and pd. len stores the length to be stored as raw data. pw is an area for temporarily storing a pointer to word data. Further, pd is an area for temporarily storing a pointer indicating double word data.
【0083】関数count_rawが呼び出されると、行7か
ら行22までのforループで、lenを0に初期化し、xが
widthより小でありかつlenがlimitより小である間ルー
プを繰り返す。各ループの最後では、xとlenに1が加
算される。When the function count_raw is called, len is initialized to 0 in a for loop from line 7 to line 22, and x is
Repeat the loop as long as it is less than width and len is less than limit. At the end of each loop, 1 is added to x and len.
【0084】ループ中、まず行8にて、lenが0、すな
わち生データの先頭で、かつ現在のデータの次のデータ
が現在のラインに残されており、かつ現在のデータとそ
の次のデータが等しい場合は、データの先頭でバイトの
繰り返し数が2以上であり、バイトの繰り返しとして符
号化するべきなので、breakによりforループを終了す
る。In the loop, first, in line 8, len is 0, that is, the first data of the raw data and the data next to the current data are left in the current line, and the current data and the next data Are equal to each other, the number of repeated bytes at the beginning of the data is 2 or more, and the data should be encoded as repeated bytes. Therefore, the for loop is terminated by a break.
【0085】次に行9にて、現在のデータの次の次のデ
ータが現在のラインに残されており、かつ現在のデー
タ、その次のデータおよびさらにその次のデータがみな
等しい場合は、バイトの繰り返し数が3以上であり、バ
イトの繰り返しデータとして符号化するべきなので、br
eakによりforループを終了する。Next, at line 9, if the next data following the current data is left in the current line, and the current data, the next data, and the next data are all equal, Since the number of repeated bytes is 3 or more and should be encoded as repeated data of bytes, br
The for loop is terminated by eak.
【0086】次に行10にて、ワードデータへのポイン
タpw、およびダブルワードデータへのポインタpdに&sr
c[x]、すなわち現在のバイトのアドレスを格納す
る。Next, at line 10, & sr is added to the pointer pw to the word data and the pointer pd to the double word data.
c [x], that is, the address of the current byte is stored.
【0087】次に行11にて、現在のバイトの次に3バ
イトのデータが現在のラインに残されており、かつpw
[0]すなわち現在のワードがpw[1]すなわち現在の
ワードの次のワードと等しい場合は、ワードの繰り返し
数が2以上であり、ワードの繰り返しデータとして符号
化するべきなので、breakによりforループを終了する。
次に行12にて、現在のバイトの次に7バイトのデータ
が現在のラインに残されており、かつpd[0]すなわち
現在のダブルワードがpd[1]すなわち現在のダブルワ
ードの次のダブルワードと等しい場合は、ダブルワード
の繰り返し数が2以上であり、ダブルワードの繰り返し
データとして符号化するべきなので、breakによりforル
ープを終了する。Next, in row 11, three bytes of data are left in the current line after the current byte, and pw
If [0], that is, the current word is equal to pw [1], that is, the word next to the current word, the number of word repetitions is 2 or more and should be encoded as word repetition data. To end.
Next, at row 12, seven bytes of data are left on the current line following the current byte, and pd [0], the current doubleword, is the next to pd [1], the current doubleword. If it is equal to the double word, the number of repetitions of the double word is 2 or more, and it should be encoded as double word repetition data. Therefore, the for loop is terminated by a break.
【0088】次に行13にて、yが0でない、すなわち
先頭のラインでなく、かつ現在のデータと直上のデータ
が等しい場合は、行14から行19までを実行する。ま
ず、行14にて、lenが7以下である場合には、コピー
として符号化することにより、生データの長さが7を超
えてExtendコマンドが必要になるために符号が1バイト
余計に長くなることを避けることができるため、break
によりforループを終了する。Next, in line 13, if y is not 0, that is, if it is not the first line and the data immediately above is equal to the current data, lines 14 to 19 are executed. First, in line 14, if len is 7 or less, the length of the raw data exceeds 7 by encoding as a copy and the Extend command is required, so that the code is extended by 1 byte. Break because you can avoid becoming
Ends the for loop.
【0089】次に行15にて、次のデータが現在のライ
ンに残されていて、かつ次のデータとその直上のデータ
が等しい場合は、コピー数が2以上なので、コピーとし
て符号化するべきなので、breakによりforループを終了
する。次に行16にて、次の次のデータが現在のライン
に残されていて、かつ次のデータとその次のデータが等
しい場合は、コピー数が1でバイトの繰り返し数が2以
上なので、コピー+バイトの繰り返しとして符号化する
べきなので、breakによりforループを終了する。Next, in line 15, if the next data is left on the current line and the next data and the data immediately above it are equal, the number of copies is 2 or more, so that the data should be encoded as a copy. So the break ends the for loop. Next, in line 16, if the next data is left on the current line and the next data is equal to the next data, the number of copies is 1 and the number of repeated bytes is 2 or more. Since the encoding should be performed as a copy + byte repetition, the for loop is terminated by a break.
【0090】次に行17にて、ワードデータへのポイン
タpw、およびダブルワードデータへのポインタpdに&sr
c[x+1]、すなわち現在のバイトの次のアドレスを
格納する。Next, in line 17, & sr is added to the pointer pw to the word data and the pointer pd to the double word data.
c [x + 1], that is, the address next to the current byte is stored.
【0091】次に行18にて、現在のバイトの次に4バ
イトのデータが現在のラインに残されており、かつpw
[0]すなわち現在のバイトの次のワードがpw[1]す
なわちその次のワードと等しい場合は、コピー数が1で
ワードの繰り返し数が2以上なので、コピー+ワードの
繰り返しとして符号化するべきなので、breakによりfor
ループを終了する。Next, at line 18, four bytes of data are left in the current line after the current byte, and pw
If [0], the next word of the current byte, is equal to pw [1], the next word, then the copy number is 1 and the word repeat count is 2 or more, so it should be encoded as a copy + word repeat So, for break
End the loop.
【0092】次に行19にて、現在のバイトの次に8バ
イトのデータが現在のラインに残されており、かつpd
[0]すなわち現在のバイトの次のダブルワードがpd
[1]すなわちその次のダブルワードと等しい場合は、
コピー数が1でダブルワードの繰り返し数が2以上なの
で、コピー+ダブルワードの繰り返しとして符号化する
べきなので、breakによりforループを終了する。Next, at line 19, 8 bytes of data are left on the current line after the current byte, and pd
[0], that is, the next doubleword of the current byte is pd
[1] That is, if it is equal to the next double word,
Since the number of copies is 1 and the number of repetitions of the double word is 2 or more, it should be encoded as the repetition of copy + double word.
【0093】forループを終了する条件が成立しなかっ
た場合は、forループに戻り、xとlenに1が加算され、
ループを続ける。このようにして、生データに符号化す
るべきでないデータに遭遇するか、1ラインのデータを
全て処理するか、生データの長さの上限limitに達
するまでループが続けられる。ループが終了した時点で
は、lenに生データとして符号化されるべき長さが格納
されているので、行22にてlenの値を戻り値として関
数を終了する。If the condition for terminating the for loop is not satisfied, the process returns to the for loop, and 1 is added to x and len.
Continue the loop. In this way, the loop continues until it encounters data that should not be encoded in the raw data, processes all of the data in one line, or reaches the upper limit of the raw data length limit. When the loop ends, the length to be encoded as raw data is stored in len, and the function ends with the value of len as the return value in line 22.
【0094】以上のようにして、本実施形態のプリンタ
ドライバプログラム12による符号化が実現される。As described above, encoding by the printer driver program 12 of the present embodiment is realized.
【0095】次に、図9を参照し、図2に示した復号回
路20の詳細について説明する。Next, the details of the decoding circuit 20 shown in FIG. 2 will be described with reference to FIG.
【0096】図9は、図2に示した復号回路20の詳細
を示すブロック図である。図9において、コマンドデコ
ード回路31は、コピーカウンタ32、リピートカウン
タ33、生データカウンタ35の全てが0である場合
に、FIFO19から図3および図4に示した符号によ
って構成された符号化データを受け取り、符号化データ
をデコードしてコピーカウンタ32、リピートカウンタ
33、生データカウンタ35にそれぞれ複写数、繰り返
し数および生データ数を出力し、セットする。コマンド
デコード回路31は、デコードしたコマンドがバイト、
ワード或いはダブルワードの繰り返し操作を含むもので
あれば、繰り返しデータをFIFO19から受け取り、
リピートデータレジスタ34に設定するとともに、デー
タサイズレジスタ43に繰り返すべきデータのサイズ
(バイト数(例えば、コマンドがCopythen Word Repeat
なら2バイトとなる))を格納する。FIG. 9 is a block diagram showing details of the decoding circuit 20 shown in FIG. In FIG. 9, when all of the copy counter 32, the repeat counter 33, and the raw data counter 35 are 0, the command decode circuit 31 converts the coded data constituted by the codes shown in FIGS. It receives and decodes the encoded data, and outputs and sets the number of copies, the number of repetitions, and the number of raw data to a copy counter 32, a repeat counter 33, and a raw data counter 35, respectively. The command decode circuit 31 outputs the decoded command as a byte,
If the data includes a word or double word repetition operation, the repetition data is received from the FIFO 19,
The size of the data to be repeated (eg, the number of bytes (for example, if the command is Copythen Word Repeat
Then 2 bytes))).
【0097】コマンドデコード回路31はまた、EOLコ
マンドをデコードした場合には、コピーカウンタ32に
複写数を出力するかわりに、減算回路36にEOL信号を
出力する。また、コマンドデコード回路31がExtendコ
マンドをデコードした場合は、Extendコマンドに含まれ
るカウント値を内部的に保持した後に、次のコマンドを
FIFO19から受け取り、デコードを行い、内部的に
保持したカウント値、および第2のコマンドコードに応
じたカウント値を計算し、複写数、繰り返し数または生
データ数として出力する。When the EOL command is decoded, the command decode circuit 31 outputs an EOL signal to the subtraction circuit 36 instead of outputting the number of copies to the copy counter 32. When the command decode circuit 31 decodes the Extend command, after internally storing the count value included in the Extend command, the command decode circuit 31 receives the next command from the FIFO 19, performs decoding, and executes the internally stored count value. And a count value corresponding to the second command code is calculated and output as the number of copies, the number of repetitions, or the number of raw data.
【0098】コピーカウンタ32は、コマンドデコード
回路31または減算回路36が出力した複写数を保持す
る。リピートカウンタ33は、コマンドデコード回路3
1が出力した繰り返し数を保持する。リピートデータレ
ジスタ34は、コマンドデコード回路31が出力した、
繰り返すべきデータを保持する。データサイズレジスタ
43は、コマンドデコード回路31が出力した繰り返す
べきデータのサイズを保持する。生データカウンタ35
は、コマンドデコード回路31が出力した生データ数を
保持する。減算回路36は、コマンドデコード回路31
がEOL信号を出力したときに、ラインレングスレジスタ
37とアドレスカウンタ38の差を計算し、コピーカウ
ンタ32に出力する。ラインレングスレジスタ37は、
制御回路17があらかじめ出力した、1ラインのバイト
数を保持する。The copy counter 32 holds the number of copies output from the command decode circuit 31 or the subtraction circuit 36. The repeat counter 33 includes the command decode circuit 3
1 holds the number of repetitions output. The repeat data register 34 outputs the
Holds data to be repeated. The data size register 43 holds the size of the data to be repeated output from the command decode circuit 31. Raw data counter 35
Holds the number of raw data output from the command decode circuit 31. The subtraction circuit 36 is a command decoding circuit 31
Outputs the EOL signal, calculates the difference between the line length register 37 and the address counter 38, and outputs the difference to the copy counter 32. The line length register 37 is
The number of bytes of one line previously output by the control circuit 17 is held.
【0099】アドレスカウンタ38は、ラインバッファ
39の、現在のアドレスを保持し、コピー出力回路4
0、リピート出力回路41、または生データ出力回路4
2がラインバッファをアクセスする毎にカウントアップ
し、またその結果、ラインレングスレジスタ37が保持
している1ラインのバイト数に達した場合は0に復帰す
る。ラインバッファ39は、少なくとも1ラインの復号
データを保持し、アドレスカウンタ38が保持する現在
のアドレスに従って、復号データの入力または出力を行
う。The address counter 38 holds the current address of the line buffer 39, and
0, repeat output circuit 41, or raw data output circuit 4
Each time 2 accesses the line buffer, the count is incremented. When the number of bytes reaches the number of bytes of one line held by the line length register 37, the count returns to 0. The line buffer 39 holds at least one line of decoded data, and inputs or outputs decoded data according to the current address held by the address counter 38.
【0100】コピー出力回路40は、コピーカウンタ3
2が保持する値が0でない場合に、アドレスカウンタ3
8が示し、ラインバッファ39が保持する直前のライン
のデータを復号データとして出力するとともに、1バイ
ト出力する毎にコピーカウンタ32から1を減算する。The copy output circuit 40 includes a copy counter 3
If the value held by 2 is not 0, the address counter 3
8, the data of the line immediately before held by the line buffer 39 is output as decoded data, and 1 is subtracted from the copy counter 32 every time one byte is output.
【0101】リピート出力回路41は、コピーカウンタ
32が保持する値が0で、かつリピートカウンタ33が
保持する値が0でない場合に、データサイズレジスタ4
3が保持する繰り返すべきデータのサイズによって指定
されるサイズの、リピートデータレジスタ34が保持す
る繰り返しデータを復号データとして出力するととも
に、アドレスカウンタ38が示すラインバッファ39の
位置に、出力した復号データを格納し、また1バイト出
力する毎にリピートカウンタ33から1を減算する。When the value held by the copy counter 32 is 0 and the value held by the repeat counter 33 is not 0, the repeat output circuit 41
3 outputs, as decoded data, the repeated data held in the repeat data register 34 having the size specified by the size of the data to be held held in the buffer 3, and outputs the decoded data to the position of the line buffer 39 indicated by the address counter 38. Each time the data is stored and one byte is output, 1 is subtracted from the repeat counter 33.
【0102】生データ出力回路42は、コピーカウンタ
32が保持する値およびリピートカウンタ33が保持す
る値がともに0で、かつ生データカウンタ34が保持す
る値が0でない場合に、FIFO19に格納された生デ
ータを復号データとして出力するとともに、アドレスカ
ウンタ38が示すラインバッファ39の位置に、出力し
た復号データを格納し、また1バイト出力する毎に生デ
ータカウンタ34から1を減算する。The raw data output circuit 42 stores the data in the FIFO 19 when the value held by the copy counter 32 and the value held by the repeat counter 33 are both 0 and the value held by the raw data counter 34 is not 0. The raw data is output as decoded data, the output decoded data is stored at the position of the line buffer 39 indicated by the address counter 38, and 1 is subtracted from the raw data counter 34 every time one byte is output.
【0103】以上説明した復号回路の動作について以
下、説明する。コマンドデコード回路31が、Copy Lon
gコマンドをデコードすると、コピーカウンタ32には
複写数が、リピートカウンタ33および生データカウン
タ35には0がそれぞれ設定される。コピーカウンタ3
2に複写数が設定されると、コピー出力回路40はライ
ンバッファ39のアドレスカウンタ38が示す位置のデ
ータを読み取り、復号データとして出力する。アドレス
カウンタ38には1が加算され、コピーカウンタ32か
らは1が減算される。コピーカウンタ32が0になるま
でこれが繰り返され、0になるとコマンドデコード回路
は次のコマンドのデコードを行う。The operation of the decoding circuit described above will be described below. The command decode circuit 31
When the g command is decoded, the number of copies is set in the copy counter 32, and 0 is set in the repeat counter 33 and the raw data counter 35, respectively. Copy counter 3
When the number of copies is set to 2, the copy output circuit 40 reads the data at the position indicated by the address counter 38 of the line buffer 39 and outputs it as decoded data. One is added to the address counter 38 and one is subtracted from the copy counter 32. This is repeated until the copy counter 32 becomes 0, and when it becomes 0, the command decode circuit decodes the next command.
【0104】コマンドデコード回路31が、EOLコマン
ドをデコードすると、リピートカウンタ33および生デ
ータカウンタ35には0がそれぞれ設定される。また、
EOL信号が出力され、減算回路36はラインレングスレ
ジスタ37とアドレスカウンタ38の差を計算し、コピ
ーカウンタ32に設定する。コピーカウンタ32に複写
数が設定されると、以下CopyLongコマンドの場合と同様
に処理が行われる。When command decode circuit 31 decodes the EOL command, 0 is set in repeat counter 33 and raw data counter 35, respectively. Also,
The EOL signal is output, and the subtraction circuit 36 calculates the difference between the line length register 37 and the address counter 38 and sets the difference in the copy counter 32. When the number of copies is set in the copy counter 32, processing is performed in the same manner as in the case of the CopyLong command.
【0105】コマンドデコード回路31が、Copy then
Repeat ByteコマンドまたはCopythen Repeat Byte Long
コマンドをデコードすると、コピーカウンタ32には複
写数が、リピートカウンタ33には繰り返し数が、リピ
ートデータレジスタ34には1バイトの繰り返しデータ
が、データサイズレジスタ43には1が、生データカウ
ンタ35には0がそれぞれ設定される。コピーカウンタ
32に複写数が設定されると、まずCopyLongコマンドの
場合と同様に処理が行われてやがてコピーカウンタ32
は0となる。次に、リピートカウンタ33に繰り返し数
が設定されているので、リピート出力回路41はリピー
トデータレジスタ34に格納されている1バイトの繰り
返しデータを復号データとして出力するとともに、ライ
ンバッファ39のアドレスカウンタ38が示す位置に書
き込む。アドレスカウンタ38には1が加算され、リピ
ートカウンタ33からは1が減算される。リピートカウ
ンタ33が0になるまでこれが繰り返され、0になると
コマンドデコード回路は次のコマンドのデコードを行
う。The command decode circuit 31 sets Copy then
Repeat Byte command or Copythen Repeat Byte Long
When the command is decoded, the copy counter 32 indicates the number of copies, the repeat counter 33 indicates the number of repetitions, the repeat data register 34 indicates 1-byte repeat data, the data size register 43 indicates 1, and the raw data counter 35 indicates. Is set to 0. When the number of copies is set in the copy counter 32, the same processing as that of the CopyLong command is performed, and then the copy counter 32 is set.
Becomes 0. Next, since the number of repetitions is set in the repeat counter 33, the repeat output circuit 41 outputs the 1-byte repetition data stored in the repeat data register 34 as decoded data, and outputs the address counter 38 of the line buffer 39. Write to the position indicated by. One is added to the address counter 38 and one is subtracted from the repeat counter 33. This is repeated until the repeat counter 33 becomes 0, and when it becomes 0, the command decode circuit decodes the next command.
【0106】コマンドデコード回路31が、Copy then
Repeat WordコマンドまたはCopythen Word Byte Longコ
マンドをデコードすると、コピーカウンタ32には複写
数が、リピートカウンタ33には繰り返し数が、リピー
トデータレジスタ34には2バイトの繰り返しデータ
が、データサイズレジスタ43には2が、生データカウ
ンタ35には0がそれぞれ設定される。コピーカウンタ
32に複写数が設定されると、まずCopyLongコマンドの
場合と同様に処理が行われてやがてコピーカウンタ32
は0となる。次に、リピートカウンタ33に繰り返し数
が設定されているので、リピート出力回路41はリピー
トデータレジスタ34に格納されている2バイトの繰り
返しデータを復号データとして出力するとともに、ライ
ンバッファ39のアドレスカウンタ38が示す位置に1
バイトずつ2回書き込む。アドレスカウンタ38には1
が2回加算され、リピートカウンタ33からは1が減算
される。リピートカウンタ33が0になるまでこれが繰
り返され、0になるとコマンドデコード回路は次のコマ
ンドのデコードを行う。The command decode circuit 31 sets Copy then
When the Repeat Word command or the Copythen Word Byte Long command is decoded, the copy counter 32 indicates the number of copies, the repeat counter 33 indicates the number of repeats, the repeat data register 34 indicates the 2-byte repeat data, and the data size register 43 indicates the number of copies. 2 is set in the raw data counter 35, and 0 is set in the raw data counter 35. When the number of copies is set in the copy counter 32, the same processing as that of the CopyLong command is performed, and then the copy counter 32 is set.
Becomes 0. Next, since the number of repetitions is set in the repeat counter 33, the repeat output circuit 41 outputs the 2-byte repetition data stored in the repeat data register 34 as decoded data, and the address counter 38 of the line buffer 39. 1 at the position indicated by
Write twice byte by byte. The address counter 38 has 1
Is added twice, and 1 is subtracted from the repeat counter 33. This is repeated until the repeat counter 33 becomes 0, and when it becomes 0, the command decode circuit decodes the next command.
【0107】コマンドデコード回路31が、Copy then
Repeat Double WordコマンドまたはCopythen Repeat Do
uble Word Longコマンドをデコードすると、コピーカウ
ンタ32には複写数が、リピートカウンタ33には繰り
返し数が、リピートデータレジスタ34には4バイトの
繰り返しデータが、データサイズレジスタ43には4
が、生データカウンタ35には0がそれぞれ設定され
る。コピーカウンタ32に複写数が設定されると、まず
CopyLongコマンドの場合と同様に処理が行われてやがて
コピーカウンタ32は0となる。次に、リピートカウン
タ33に繰り返し数が設定されているので、リピート出
力回路41はリピートデータレジスタ34に格納されて
いる4バイトの繰り返しデータを復号データとして出力
するとともに、ラインバッファ39のアドレスカウンタ
38が示す位置に1バイトずつ4回書き込む。アドレス
カウンタ38には1が4回加算され、リピートカウンタ
33からは1が減算される。リピートカウンタ33が0
になるまでこれが繰り返され、0になるとコマンドデコ
ード回路は次のコマンドのデコードを行う。The command decode circuit 31 determines that Copy then
Repeat Double Word command or Copythen Repeat Do
When the uble Word Long command is decoded, the copy counter 32 indicates the number of copies, the repeat counter 33 indicates the number of repetitions, the repeat data register 34 indicates 4 bytes of repeated data, and the data size register 43 indicates 4 bytes.
However, 0 is set in the raw data counter 35, respectively. When the number of copies is set in the copy counter 32, first,
Processing is performed in the same manner as in the case of the CopyLong command, and the copy counter 32 eventually becomes zero. Next, since the number of repetitions is set in the repeat counter 33, the repeat output circuit 41 outputs the 4-byte repetition data stored in the repeat data register 34 as decoded data, and the address counter 38 of the line buffer 39. Is written four times, one byte at a time, indicated by. 1 is added to the address counter 38 four times, and 1 is subtracted from the repeat counter 33. Repeat counter 33 is 0
This is repeated until the value becomes 0. When the value becomes 0, the command decode circuit decodes the next command.
【0108】コマンドデコード回路31が、Copy then
RawコマンドまたはCopythen Raw Longコマンドをデコー
ドすると、コピーカウンタ32には複写数が、リピート
カウンタ33には0が、生データカウンタ35には生デ
ータ数がそれぞれ設定される。コピーカウンタ32に複
写数が設定されると、まずCopyLongコマンドの場合と同
様に処理が行われてやがてコピーカウンタ32は0とな
る。次に、生データカウンタ35に生データ数が設定さ
れているので、生データ出力回路42はFIFO19か
ら1バイトの生データを読み取り、復号データとして出
力するとともに、ラインバッファ39のアドレスカウン
タ38が示す位置に書き込む。アドレスカウンタ38に
は1が加算され、生データカウンタ35からは1が減算
される。生データカウンタ35が0になるまでこれが繰
り返され、0になるとコマンドデコード回路は次のコマ
ンドのデコードを行う。The command decode circuit 31 sets Copy then
When the Raw command or the Copythen Raw Long command is decoded, the copy number is set in the copy counter 32, 0 is set in the repeat counter 33, and the raw data number is set in the raw data counter 35. When the number of copies is set in the copy counter 32, the process is performed in the same manner as in the case of the CopyLong command, and the copy counter 32 eventually becomes zero. Next, since the number of raw data is set in the raw data counter 35, the raw data output circuit 42 reads the raw data of 1 byte from the FIFO 19 and outputs it as decoded data, while the address counter 38 of the line buffer 39 indicates. Write to position. One is added to the address counter 38 and one is subtracted from the raw data counter 35. This is repeated until the raw data counter 35 becomes 0. When the raw data counter 35 becomes 0, the command decode circuit decodes the next command.
【0109】コマンドデコード回路31が、EOPコマ
ンドをデコードすると、コピーカウンタ32には0が、
リピートカウンタ33には0が、生データカウンタ35
には0がそれぞれ設定され、デコードは次に制御回路1
7によって起動されるまで停止する。When the command decode circuit 31 decodes the EOP command, 0 is stored in the copy counter 32,
0 is set in the repeat counter 33 and the raw data counter 35
Is set to 0, and decoding is performed by the control circuit 1 next.
7 until started.
【0110】以上説明したように、本実施形態によれ
ば、符号化にあたって直左および直上のデータを参照す
るので、画像データのような水平・垂直両方向に相関が
あるデータを高い圧縮率で符号化することができるとと
もに、直左および直上のデータ以外のデータを参照しな
いため、符号化における計算量も小さく、ソフトウェア
により符号化を行った場合でも高速に符号化を行うこと
ができる。また、本実施形態によれば、複数の操作(コ
ピーと繰り返し、コピーと生データ)を同時に符号化
し、あるいは復号するため、画像データを高い圧縮率で
符号化することができる。また、本実施形態によれば、
複数のサイズの繰り返しデータ(バイト、ワード、ダブ
るワード)に符号化できるため、多値データの画像デー
タを高い圧縮率で符号化することができる。As described above, according to the present embodiment, the data immediately to the left and immediately above are referred to at the time of encoding. Therefore, data having a correlation in both the horizontal and vertical directions, such as image data, is encoded at a high compression rate. In addition, since data other than the data immediately to the left and right above is not referred to, the amount of calculation in encoding is small, and even when encoding is performed by software, high-speed encoding can be performed. Further, according to the present embodiment, since a plurality of operations (copy and repeat, copy and raw data) are simultaneously encoded or decoded, image data can be encoded at a high compression rate. According to the present embodiment,
Since encoding can be performed on repeated data of a plurality of sizes (byte, word, double word), image data of multivalued data can be encoded at a high compression rate.
【0111】なお、上述の実施形態では、復号回路20
はハードウェアにより構成されていたが、これに替えて
ソフトウェアで復号するようにしてもよい。図9に示し
た復号回路20による処理をソフトウエアによって実現す
る手順は種々考えられるが、その一例を示せば図10の
ようになる。In the above embodiment, the decoding circuit 20
Is configured by hardware, but may be decrypted by software instead. Various procedures for realizing the processing by the decoding circuit 20 shown in FIG. 9 by software can be considered, and an example of the procedure is shown in FIG.
【0112】図10は本実施形態による復号処理の手順
を説明するフローチャートである。図10において、ま
ずステップS101で次のコマンドを取り込み、コマン
ドをと取り込み、これをデコードする。このデコードの
結果、当該ページの終了を示すEOPコードが検出された
場合は、ステップS102から本処理を終了する。FIG. 10 is a flowchart for explaining the procedure of the decoding process according to the present embodiment. In FIG. 10, first, in step S101, the next command is fetched, the command is fetched, and the command is decoded. As a result of this decoding, if an EOP code indicating the end of the page is detected, the process ends from step S102.
【0113】ステップS103では、各カウンタ、レジ
スタを初期化し、ステップS104において、デコード
の結果EOLコードが検出されたか否かを判断する。EOLコ
ードが検出された場合は、ステップS105へ進み、当
該行の残りのバイト数をコピーカウンタにセットして、
ステップS108へ進む。In step S103, each counter and register are initialized, and in step S104, it is determined whether or not an EOL code is detected as a result of decoding. If an EOL code is detected, the process proceeds to step S105, where the number of remaining bytes of the line is set in a copy counter,
Proceed to step S108.
【0114】一方、EOLコードでない場合は、ステップ
S104からステップS106へ進み、デコードの結果
に従ってコピーカウンタ、リピートカウンタ、生データ
カウンタをそれぞれセットし、更に、ステップS107
でリピートデータレジスタとデータサイズレジスタをセ
ットする。例えば、Copythen Repeat Byteコマンドであ
った場合は、コピーカウンタとリピートカウンタに当該
コマンドを解析してえられた値をセットし、生データカ
ウンタを0にセットする。更に、リピートデータレジス
タに当該コマンドに続く1バイトのデータをセットし、
データサイズレジスタに1をセットする。On the other hand, if it is not an EOL code, the process proceeds from step S104 to step S106, where a copy counter, a repeat counter, and a raw data counter are respectively set according to the result of decoding.
To set the repeat data register and data size register. For example, in the case of a Copythen Repeat Byte command, a value obtained by analyzing the command is set in a copy counter and a repeat counter, and the raw data counter is set to 0. Further, one byte of data following the command is set in the repeat data register,
Set 1 to the data size register.
【0115】ステップS108では、コピーカウンタの
内容が0かどうかを判断し、コピーカウンタの内容が0
でなければステップS109へ進み、コピーカウンタの
バイト数分を直前のラインのデータから抽出して復号デ
ータとして出力する。In step S108, it is determined whether or not the content of the copy counter is 0.
If not, the flow advances to step S109 to extract the number of bytes of the copy counter from the data of the immediately preceding line and output the decoded data.
【0116】ステップS110では、リピートカウンタ
の内容が0かどうかを判断する。リピートカウンタの内
容が0でない場合は、ステップS111に進み、リピー
トデータレジスタの内容(データサイズをデータサイズ
レジスタから得て、繰り返すべきデータを取得する)を
リピートカウンタで示される数だけ繰り返し出力する。In step S110, it is determined whether the content of the repeat counter is 0. If the content of the repeat counter is not 0, the flow advances to step S111 to repeatedly output the content of the repeat data register (obtain the data size from the data size register and obtain the data to be repeated) by the number indicated by the repeat counter.
【0117】また、ステップS112において、生デー
タカウンタの内容が0可動かを判断し、0でなければス
テップS113へ進む。ステップS113では、当該コ
マンドに続く生データカウンタで示されるバイト数分の
データを取得して、復号データとして出力する。In step S112, it is determined whether the content of the raw data counter is 0. If not, the process proceeds to step S113. In step S113, data for the number of bytes indicated by the raw data counter following the command is obtained and output as decoded data.
【0118】その後、処理をステップS101へ戻し、
当該ページの処理を終えるまで上述の処理を繰り返す。Thereafter, the process returns to step S101,
The above processing is repeated until the processing of the page is completed.
【0119】以上の処理をコンピュータによって実現す
ることで、本実施形態の復号処理をソフトウエアによっ
て実現することが可能となる。By realizing the above processing by a computer, the decoding processing of the present embodiment can be realized by software.
【0120】また、上述の実施形態では符号化にあたっ
て行末で処理を区切っているが、これにかえて行末で処
理を区切らず、あるラインの最右のデータに次のライン
の最左のデータが続いているものとして処理を行っても
よい。In the above embodiment, the encoding is performed by dividing the processing at the end of the line. Instead, the processing is not divided by the end of the line, and the rightmost data of one line is replaced by the leftmost data of the next line. The processing may be performed assuming that the processing is continued.
【0121】また、上述の実施例では1バイト、2バイ
ト、4バイトの3種類のサイズの繰り返しを処理してい
たが、これに替えて、8バイト、16バイト、あるいは
3バイト、6バイト等の任意のサイズのデータを繰り返
すようにしてもよい。In the above-described embodiment, three types of repetitions of 1 byte, 2 bytes, and 4 bytes are processed. Instead, 8 bytes, 16 bytes, 3 bytes, 6 bytes, etc. May be repeated.
【0122】また、上述の実施例では例えば1バイトの
長い繰り返しの場合に、Copy thenRepeat Byte Longコ
マンドに符号化しているが、これにかえてデータを2バ
イトあるいはそれ以上の繰り返しとみなして、Copy the
n RepeatWord、Copy then Repeat Double Word、Copy t
hen Repeat Word Longコマンド等に符号化するようにし
てもよい。Further, in the above-described embodiment, for example, in the case of a long repetition of 1 byte, the data is encoded into a Copy then Repeat Byte Long command. the
n RepeatWord, Copy then Repeat Double Word, Copy t
It may be encoded as a hen Repeat Word Long command or the like.
【0123】なお、本発明は、複数の機器(例えばホス
トコンピュータ,インタフェイス機器,リーダ,プリン
タなど)から構成されるシステムに適用しても、一つの
機器からなる装置(例えば、複写機,ファクシミリ装置
など)に適用してもよい。また、本発明の目的は、前述
した実施形態の機能を実現するソフトウェアのプログラ
ムコードを記録した記憶媒体を、システムあるいは装置
に供給し、そのシステムあるいは装置のコンピュータ
(またはCPUやMPU)が記憶媒体に格納されたプロ
グラムコードを読出し実行することによっても、達成さ
れることは言うまでもない。The present invention can be applied to a system including a plurality of devices (for example, a host computer, an interface device, a reader, a printer, etc.), but can be applied to a single device (for example, a copier, a facsimile). Device). Further, an object of the present invention is to provide a storage medium storing a program code of software for realizing the functions of the above-described embodiments to a system or an apparatus, and a computer (or CPU or MPU) of the system or apparatus to execute the storage medium Needless to say, this can also be achieved by reading and executing the program code stored in the program.
【0124】この場合、記憶媒体から読出されたプログ
ラムコード自体が前述した実施形態の機能を実現するこ
とになり、そのプログラムコードを記憶した記憶媒体は
本発明を構成することになる。In this case, the program code itself read from the storage medium realizes the function of the above-described embodiment, and the storage medium storing the program code constitutes the present invention.
【0125】プログラムコードを供給するための記憶媒
体としては、例えば、フロッピディスク,ハードディス
ク,光ディスク,光磁気ディスク,CD−ROM,CD
−R,磁気テープ,不揮発性のメモリカード,ROMな
どを用いることができる。Examples of a storage medium for supplying the program code include a floppy disk, hard disk, optical disk, magneto-optical disk, CD-ROM, and CD.
-R, a magnetic tape, a nonvolatile memory card, a ROM, or the like can be used.
【0126】また、コンピュータが読出したプログラム
コードを実行することにより、前述した実施形態の機能
が実現されるだけでなく、そのプログラムコードの指示
に基づき、コンピュータ上で稼働しているOS(オペレ
ーティングシステム)などが実際の処理の一部または全
部を行い、その処理によって前述した実施形態の機能が
実現される場合も含まれることは言うまでもない。When the computer executes the readout program code, not only the functions of the above-described embodiment are realized, but also the OS (Operating System) running on the computer based on the instruction of the program code. ) May perform some or all of the actual processing, and the processing may realize the functions of the above-described embodiments.
【0127】さらに、記憶媒体から読出されたプログラ
ムコードが、コンピュータに挿入された機能拡張ボード
やコンピュータに接続された機能拡張ユニットに備わる
メモリに書込まれた後、そのプログラムコードの指示に
基づき、その機能拡張ボードや機能拡張ユニットに備わ
るCPUなどが実際の処理の一部または全部を行い、そ
の処理によって前述した実施形態の機能が実現される場
合も含まれることは言うまでもない。Further, after the program code read from the storage medium is written into a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer, based on the instruction of the program code, It goes without saying that the CPU included in the function expansion board or the function expansion unit performs part or all of the actual processing, and the processing realizes the functions of the above-described embodiments.
【0128】[0128]
【発明の効果】以上説明したように、本発明によれば、
符号化・復号化においてあるデータの繰り返しを検出し
てこれを利用するにおいて、少なくとも2つの異なるサ
イズのデータの繰り返しを用いて符号化・復号化するこ
とが可能となり、より圧縮率を高くすることが可能とな
る。これにより、グレイスケールまたはカラー画像デー
タのように一画素が多値で表現される画像データであっ
ても圧縮率を高くすることができる。また、本発明によ
れば、水平・垂直両方向の相関を利用して符号化する場
合等において一般に使用される3種類の操作、すなわち
あるデータの繰り返し、処理済データの複写、生データ
のうちの少なくとも2つを同時に符号化することが可能
となり、より圧縮率を高くすることができる。また、本
発明によれば、画像データのような2次元以上のデータ
構造を、水平・垂直両方向の相関を利用して符号化する
ことにより高い圧縮率が得られる。特に、水平・垂直の
相関が最も顕著である直左のデータおよび直上のデータ
を用いて圧縮を行うことにより計算量を小さくでき、ソ
フトウェアで符号化した場合に要する時間を短くするこ
とができる。As described above, according to the present invention,
In detecting and utilizing repetition of certain data in encoding / decoding, encoding / decoding can be performed using repetition of data of at least two different sizes, thereby increasing the compression rate. Becomes possible. This makes it possible to increase the compression ratio even for image data in which one pixel is represented by multi-values such as gray scale or color image data. Further, according to the present invention, three kinds of operations generally used in encoding using correlation in both horizontal and vertical directions, such as repetition of certain data, copying of processed data, and At least two of them can be encoded simultaneously, and the compression ratio can be further increased. Further, according to the present invention, a high compression rate can be obtained by encoding a data structure of two or more dimensions such as image data using correlation in both horizontal and vertical directions. In particular, the amount of calculation can be reduced by performing compression using data immediately to the left and data immediately above where the horizontal / vertical correlation is most remarkable, and the time required for encoding by software can be shortened.
【図1】本発明の第1の実施形態による印刷システムの
ハードウエア構成を説明するブロック図である。FIG. 1 is a block diagram illustrating a hardware configuration of a printing system according to a first embodiment of the present invention.
【図2】本実施形態による印刷装置を適用可能な印刷シ
ステムの制御構成を示すブロック図である。FIG. 2 is a block diagram illustrating a control configuration of a printing system to which the printing apparatus according to the present embodiment can be applied.
【図3】図2に示したプリンタドライバ12が符号化デ
ータを生成するのに用いるコマンドコードテーブルの一
例を説明する図である。FIG. 3 is a diagram illustrating an example of a command code table used by the printer driver 12 illustrated in FIG. 2 to generate encoded data.
【図4】図3に示したExtendコマンドに後続する第2の
コマンドコードの一例を示す図である。FIG. 4 is a diagram showing an example of a second command code following the Extend command shown in FIG. 3;
【図5】本実施形態によるコマンドの動作の一例を示す
図である。FIG. 5 is a diagram illustrating an example of a command operation according to the embodiment;
【図6A】本実施形態によるプリンタドライバの符号化
処理を説明するフローチャートである。FIG. 6A is a flowchart illustrating an encoding process of a printer driver according to the present embodiment.
【図6B】本実施形態によるプリンタドライバの符号化
処理を説明するフローチャートである。FIG. 6B is a flowchart illustrating an encoding process of the printer driver according to the present embodiment.
【図7】図6A及び図6Bで説明したプリンタドライバ
12の符号化手順を実現するためのプログラムリスト例
を示す図である。FIG. 7 is a diagram showing an example of a program list for realizing the encoding procedure of the printer driver 12 described in FIGS. 6A and 6B.
【図8】図7に示した関数count_rawを実現するための
プログラムリスト例を示す図である。FIG. 8 is a diagram showing an example of a program list for realizing the function count_raw shown in FIG. 7;
【図9】図2に示した復号回路20の詳細を示すブロッ
ク図である。FIG. 9 is a block diagram illustrating details of a decoding circuit 20 illustrated in FIG. 2;
【図10】本実施形態による復号処理の手順を説明する
フローチャートである。FIG. 10 is a flowchart illustrating a procedure of a decoding process according to the embodiment;
Claims (19)
検出し、該部分のデータ長を取得する第1取得手段と、 複数種類のサイズのうちのいずれかのサイズのデータの
繰り返しで置換し得る部分を検出し、該データの内容と
該部分のデータ長を取得する第2取得手段と、 前記第1乃至第2取得手段によって取得されない部分を
検出し、該部分のデータ内容及びデータ長を取得する第
3取得手段と、 前記第1乃至第3取得手段によって検出された各部分の
データ長とデータ内容に基づいて符号化データを生成す
る生成手段とを備えることを特徴とする符号化装置。A first obtaining means for detecting a portion which can be replaced by copying the processed data and obtaining a data length of the portion; and replacing the data by repeating data of any one of a plurality of sizes. A second obtaining means for detecting a possible portion and obtaining the content of the data and the data length of the portion; detecting a portion which is not obtained by the first and second obtaining means; Encoding means for acquiring encoded data based on the data length and data content of each part detected by the first to third acquiring means. apparatus.
前記第3取得手段で取得したデータ長とを単一コマンド
で表す符号化データを生成することを特徴とする請求項
1に記載の符号化装置。2. The apparatus according to claim 1, wherein the generation unit generates encoded data representing a data length obtained by the first obtaining unit to the third obtaining unit by a single command. Encoding device.
ることを特徴とする請求項2に記載の符号化装置。3. The encoding apparatus according to claim 2, wherein the single command is composed of one byte.
配列構造を有し、 前記第1取得手段は、直前の行データの同一の列位置に
あるデータの複写で置換し得る部分を検出することを特
徴とする請求項1に記載の符号化装置。4. The data to be encoded has a two-dimensional array structure, and the first obtaining means determines a portion which can be replaced by copying data at the same column position of the immediately preceding row data. The encoding device according to claim 1, wherein the encoding is detected.
イズとして、1バイト長、2バイト長、4バイト長を含
むことを特徴とする請求項1に記載の符号化装置。5. The encoding apparatus according to claim 1, wherein the second acquisition unit includes a one-byte length, a two-byte length, and a four-byte length as the plurality of types of sizes.
配列構造を有し、 前記生成手段は、前記第1取得手段で検出した部分が当
該行の最後まで到達する場合は、その部分を所定のコマ
ンドコードで置き換えることを特徴とする請求項1に記
載の符号化装置。6. The data to be encoded has a two-dimensional array structure, and the generation unit, when the part detected by the first acquisition unit reaches the end of the row, the part Is replaced with a predetermined command code.
は、前記選択されたサイズのデータの繰り返し数で示さ
れることを特徴とする請求項1に記載の符号化装置。7. The encoding apparatus according to claim 1, wherein the data length acquired by the second acquisition unit is indicated by the number of repetitions of the data of the selected size.
ドを解析する解析手段と、 復号化済みのデータを記憶する記憶手段と、 前記解析手段の解析結果に基づいて復号化データを出力
する出力手段とを備え、 前記出力手段が、 前記記憶手段より前記復号化済みのデータの対応部分を
取得して出力する第1出力手段と、 複数種類のサイズの中より指定されたサイズを有するデ
ータを後続の符号列より得て、これを指定された繰り返
し数だけ繰り返して出力する第2出力手段と、 指定されたデータ長のデータを後続の符号列より得て出
力する第3出力手段とを備えることを特徴とする復号化
装置。8. An analyzing means for analyzing a command consisting of a code string having a predetermined data length, a storing means for storing decoded data, and an output for outputting decoded data based on an analysis result of the analyzing means. Means, wherein the output means obtains and outputs a corresponding portion of the decoded data from the storage means, and outputs data having a designated size from a plurality of sizes. A second output unit that obtains from the subsequent code sequence and repeats and outputs the specified number of repetitions, and a third output unit that obtains and outputs data of a specified data length from the subsequent code sequence A decoding device characterized by the above-mentioned.
を組み合わせて、或いは前記第1と第3出力手段を組み
合わせて実行することを表わすことを特徴とする請求項
8に記載の復号化装置。9. The decoding method according to claim 8, wherein the command indicates execution of the combination of the first and second output units or the combination of the first and third output units. apparatus.
を検出し、該部分のデータ長を取得する第1取得工程
と、 複数種類のサイズのうちのいずれかのサイズのデータの
繰り返しで置換し得る部分を検出し、該データの内容と
該部分のデータ長を取得する第2取得工程と、 前記第1乃至第2取得工程によって取得されない部分を
検出し、該部分のデータ内容及びデータ長を取得する第
3取得工程と、 前記第1乃至第3取得工程によって検出された各部分の
データ長とデータ内容に基づいて符号化データを生成す
る生成工程とを備えることを特徴とする符号化方法。10. A first acquisition step of detecting a portion that can be replaced by copying processed data and acquiring the data length of the portion, and replacing the data by repeating data of any one of a plurality of sizes. A second obtaining step of detecting a possible portion and obtaining the content of the data and the data length of the portion; detecting a portion not obtained by the first and second obtaining steps; And a generating step of generating encoded data based on the data length and data content of each part detected in the first to third obtaining steps. Method.
至前記第3取得工程で取得したデータ長とを単一コマン
ドで表す符号化データを生成することを特徴とする請求
項10に記載の符号化方法。11. The method according to claim 10, wherein the generating step generates encoded data representing a data length obtained in the first to third obtaining steps by a single command. Encoding method.
れることを特徴とする請求項11に記載の符号化方法。12. The encoding method according to claim 11, wherein the single command is composed of one byte.
な配列構造を有し、 前記第1取得工程は、直前の行データの同一の列位置に
あるデータの複写で置換し得る部分を検出することを特
徴とする請求項10に記載の符号化方法。13. The data to be encoded has a two-dimensional array structure, and in the first obtaining step, a portion that can be replaced by copying data at the same column position of the immediately preceding row data is replaced. The encoding method according to claim 10, wherein the encoding is detected.
サイズとして、1バイト長、2バイト長、4バイト長を
含むことを特徴とする請求項10に記載の符号化方法。14. The encoding method according to claim 10, wherein the second acquisition step includes a one-byte length, a two-byte length, and a four-byte length as the plurality of types of sizes.
な配列構造を有し、 前記生成工程は、前記第1取得工程で検出した部分が当
該行の最後まで到達する場合は、その部分を所定のコマ
ンドコードで置き換えることを特徴とする請求項10に
記載の符号化方法。15. The data to be encoded has a two-dimensional array structure. In the generation step, when the part detected in the first acquisition step reaches the end of the row, the part is Is replaced with a predetermined command code.
は、前記選択されたサイズのデータの繰り返し数で示さ
れることを特徴とする請求項10に記載の符号化方法。16. The encoding method according to claim 10, wherein the data length obtained in the second obtaining step is indicated by the number of repetitions of the data of the selected size.
ンドを解析する解析工程と、 復号化済みのデータをメモリに記憶する記憶工程と、 前記解析工程の解析結果に基づいて復号化データを出力
する出力工程とを備え、 前記出力工程が、 前記メモリより前記復号化済みのデータの対応部分を取
得して出力する第1出力工程と、 複数種類のサイズの中より指定されたサイズを有するデ
ータを後続の符号列より得て、これを指定された繰り返
し数だけ繰り返して出力する第2出力工程と、 指定されたデータ長のデータを後続の符号列より得て出
力する第3出力工程とを備えることを特徴とする復号化
方法。17. An analyzing step of analyzing a command consisting of a code string having a predetermined data length, a storing step of storing decoded data in a memory, and outputting decoded data based on an analysis result of the analyzing step. A first output step of obtaining and outputting a corresponding portion of the decrypted data from the memory, and a data having a size specified from a plurality of sizes. And a third output step of obtaining and outputting data of a specified data length from the subsequent code string by repeating the same for a specified number of repetitions. A decoding method comprising:
程を組み合わせて、 或いは前記第1と第3出力工程を組み合わせて実行する
ことを表わすことを特徴とする請求項17に記載の復号
化方法。18. The decoding according to claim 17, wherein the command indicates that the first and second output steps are executed in combination or the first and third output steps are executed in combination. Method.
の方法をコンピュータによって実現するための制御プロ
グラムを格納する記憶媒体。19. A storage medium storing a control program for realizing a method according to claim 10 by a computer.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2000221236A JP2002043950A (en) | 2000-07-21 | 2000-07-21 | Encoding method and apparatus, and decoding method and apparatus |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2000221236A JP2002043950A (en) | 2000-07-21 | 2000-07-21 | Encoding method and apparatus, and decoding method and apparatus |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2002043950A true JP2002043950A (en) | 2002-02-08 |
Family
ID=18715686
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2000221236A Withdrawn JP2002043950A (en) | 2000-07-21 | 2000-07-21 | Encoding method and apparatus, and decoding method and apparatus |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2002043950A (en) |
Cited By (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2005294934A (en) * | 2004-03-31 | 2005-10-20 | Alfa Vision Kk | Image data compression method |
| JP2008504734A (en) * | 2004-06-25 | 2008-02-14 | アボセント コーポレイション | Digital video compression command priority |
| WO2009095956A1 (en) * | 2008-01-31 | 2009-08-06 | Fujitsu Limited | Data compression/decompression method, and compression/ decompression program |
| 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 |
| JP2014087066A (en) * | 2012-10-23 | 2014-05-12 | Kyocera Document Solutions Inc | Method, non-transitory computer-readable recording medium, computer, and program |
| US8805096B2 (en) | 2004-06-25 | 2014-08-12 | Avocent Corporation | Video compression noise immunity |
| US9560371B2 (en) | 2003-07-30 | 2017-01-31 | Avocent Corporation | Video compression system |
-
2000
- 2000-07-21 JP JP2000221236A patent/JP2002043950A/en not_active Withdrawn
Cited By (13)
| 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 |
| US9560371B2 (en) | 2003-07-30 | 2017-01-31 | Avocent Corporation | Video compression system |
| JP2005294934A (en) * | 2004-03-31 | 2005-10-20 | Alfa Vision Kk | Image data compression method |
| 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 |
| US8660194B2 (en) | 2006-04-28 | 2014-02-25 | Avocent Corporation | DVC delta commands |
| GB2469955B (en) * | 2008-01-31 | 2012-09-12 | Fujitsu Ltd | Data compression/decompression method,and compression/decompression program |
| US8164490B2 (en) | 2008-01-31 | 2012-04-24 | Fujitsu Limited | Data compression/decompression method and computer readable storage medium storing compression/decompression program |
| JP4814999B2 (en) * | 2008-01-31 | 2011-11-16 | 富士通株式会社 | Data compression / decompression method and compression / decompression program |
| GB2469955A (en) * | 2008-01-31 | 2010-11-03 | Fujitsu Ltd | Data compression/decompression method,and compression/decompression program |
| WO2009095956A1 (en) * | 2008-01-31 | 2009-08-06 | Fujitsu Limited | Data compression/decompression method, and compression/ decompression program |
| JP2014087066A (en) * | 2012-10-23 | 2014-05-12 | Kyocera Document Solutions Inc | Method, non-transitory computer-readable recording medium, computer, and program |
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 | |
| JP2000115783A (en) | Decoding device and method | |
| JPH1093827A (en) | Image processing method and apparatus | |
| JPH06334870A (en) | Encoder | |
| US20180176589A1 (en) | Transcode pcl delta-row compressed image to edges | |
| KR101180098B1 (en) | Split runlength encoding method and apparatus | |
| EP0703549B1 (en) | A two dimensional method and system for compressing bi-level images | |
| US6785424B1 (en) | Encoding method and apparatus for compressing a data structure having two or more dimensions, decoding method, and storage medium | |
| JP2002043950A (en) | Encoding method and apparatus, and decoding method and apparatus | |
| US7684644B2 (en) | Variable-length encoding for image data compression | |
| US6721456B1 (en) | Color image data and control bit compression scheme with run length encoding | |
| US4972497A (en) | Image coding system | |
| US20030020722A1 (en) | Image display apparatus | |
| US20010022664A1 (en) | Image processing device | |
| CN101282407B (en) | Image processing apparatus and method | |
| JP3970007B2 (en) | Image processing apparatus, image processing method, program, and storage medium | |
| JPH04230172A (en) | Facsimile data processing equipment | |
| US20020085765A1 (en) | Dual mode data compression technique Dual mode data compression technique | |
| US20020085764A1 (en) | Enhanced data compression technique | |
| EP0660587B1 (en) | Reversible video compression method | |
| JP3260862B2 (en) | Parallel data transmission device | |
| JP2003174561A (en) | Image processing apparatus, image processing method, program, and storage medium | |
| JP2002223360A (en) | Encoding device and method, decoding device and method, and storage medium, and printer driver and storage medium for storing the same | |
| JP3842650B2 (en) | Image processing apparatus and image processing method | |
| JP3657081B2 (en) | Printer controller |
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: 20071002 |