JP2000217005A - Data coding method/decoding method, data coder/decoder, and image data recording system using the data coding method/decoding method - Google Patents
Data coding method/decoding method, data coder/decoder, and image data recording system using the data coding method/decoding methodInfo
- Publication number
- JP2000217005A JP2000217005A JP11012479A JP1247999A JP2000217005A JP 2000217005 A JP2000217005 A JP 2000217005A JP 11012479 A JP11012479 A JP 11012479A JP 1247999 A JP1247999 A JP 1247999A JP 2000217005 A JP2000217005 A JP 2000217005A
- Authority
- JP
- Japan
- Prior art keywords
- value
- run
- code
- length
- decoding
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 172
- 238000003860 storage Methods 0.000 claims description 127
- 230000008569 process Effects 0.000 claims description 37
- 239000003086 colorant Substances 0.000 claims description 17
- 238000005259 measurement Methods 0.000 claims description 9
- 230000004044 response Effects 0.000 claims description 7
- 238000007906 compression Methods 0.000 abstract description 40
- 230000006835 compression Effects 0.000 abstract description 40
- 230000010076 replication Effects 0.000 abstract 2
- 238000010586 diagram Methods 0.000 description 13
- 238000006467 substitution reaction Methods 0.000 description 8
- 230000008859 change Effects 0.000 description 7
- 230000007246 mechanism Effects 0.000 description 4
- 230000003252 repetitive effect Effects 0.000 description 4
- 230000006837 decompression Effects 0.000 description 3
- 230000006872 improvement Effects 0.000 description 2
- 230000014759 maintenance of location Effects 0.000 description 2
- 239000013256 coordination polymer Substances 0.000 description 1
- 230000010485 coping Effects 0.000 description 1
- 238000013144 data compression Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000012634 fragment Substances 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 239000000725 suspension Substances 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
Landscapes
- Compression Of Band Width Or Redundancy In Fax (AREA)
Abstract
Description
【0001】[0001]
【発明の属する技術分野】本発明は、例えばプリンタ装
置に画像データを格納する際に使用されるデータの圧縮
伸張に用いる符号化及び復号方法及び装置に関し、特
に、プリンタ等でフレームバッファ容量を節約する、所
謂省メモリ機構に最適な符号化及び復号方法及び装置、
システムならびに記録媒体に関するものである。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an encoding / decoding method and apparatus used for compressing / decompressing data used for storing image data in a printer, for example, and more particularly to saving frame buffer capacity in a printer or the like. Encoding and decoding method and apparatus optimal for a so-called memory saving mechanism,
The present invention relates to a system and a recording medium.
【0002】[0002]
【従来の技術】近年、レーザービームプリンタ等の印刷
装置では、印刷のための画像データを圧縮即ち符号化し
て一時的に蓄積し、伸張即ち復号しながら実際の印刷を
行うことで必要なメモリを削減する、いわゆる省メモリ
技術が広く用いられている。このような省メモリ技術の
基本的な目的は必要なメモリ量を削減することによるコ
ストダウンであるので、この圧縮伸張のために複雑な専
用ハードウェアを備えることは好ましくなく、従って、
装置の制御を司るマイクロプロセッサにこれらの圧縮伸
張処理をソフトウェア的に行わせしめることが広く行わ
れている。この画像データ圧縮の方式及び装置に関して
は、既に多数の技術が開示されている。一般的に、二次
元静止画像を圧縮対象とする場合には、副走査方向のデ
ータ相関を加味して圧縮を行う二次元圧縮や算術符号を
用いる予測符号化方式を用いることで高い圧縮率を得ら
れることがよく知られている。しかし、それらの方式を
マイクロプロセッサでソフトウェア的に実行させると処
理速度が遅く、印刷の解像度や速度が年々向上する中で
省メモリ機構に適応することは困難となってきており、
従って、圧縮伸長をマイクロプロセッサに実行させるよ
うな場合には、一次元圧縮と称される比較的単純な方式
を用いることが普通である。2. Description of the Related Art In recent years, a printing apparatus such as a laser beam printer compresses or encodes image data for printing and temporarily accumulates the image data, and expands or decodes image data to perform actual printing while storing necessary memory. A so-called memory saving technique for reducing the number of pixels is widely used. Since the basic purpose of such a memory-saving technique is cost reduction by reducing the required memory amount, it is not preferable to provide complicated dedicated hardware for this compression / decompression, and
It is widely practiced to cause a microprocessor that controls the apparatus to perform these compression / decompression processes using software. A number of techniques have been disclosed for the image data compression system and apparatus. In general, when a two-dimensional still image is to be compressed, a high compression ratio can be achieved by using a two-dimensional compression that performs compression in consideration of data correlation in the sub-scanning direction or a predictive coding method that uses an arithmetic code. It is well known that it can be obtained. However, when these methods are executed by software using a microprocessor, the processing speed is slow, and it is becoming difficult to adapt to a memory saving mechanism as the resolution and speed of printing are improving year by year.
Therefore, when a microprocessor performs compression and decompression, it is common to use a relatively simple method called one-dimensional compression.
【0003】斯かる従来の一次元圧縮に関しては、ラン
レングス圧縮やファクシミリ装置等に用いられるMH符
号が広く知られている。これらの方式は、コンピュータ
処理による擬似中間調画像のように色(白黒)が短い周
期(ラン)で頻繁に変化するような画像データに対して
は十分な圧縮率が得られないという欠点があることが既
に知られている訳であるが、特に近年、パーソナルコン
ピュータやネットワークの進歩によりイメージデータを
印刷する機会が増大しているため、これらの方式を省メ
モリ機構に採用することは困難な状況になってきてい
る。又、二次元圧縮方式、予測符号化方式、MH符号方
式等においては、ラインバッファ、確率テーブル、符号
テーブルといった比較的大きな容量の参照手段が必要で
あるという欠点が存在することにも注意が必要である。
例えば、1200dpi(ドット/インチ)の解像度、
25ppm(ページ/分)の印刷速度であれば画素周波
数は100MHzを超えるのが一般的である。このよう
な周波数で前記のような参照手段を含む符号化・復号の
ハードウェア回路を動作させることは非常に困難であ
り、これを克服するため、回路を並列化することにより
低い周波数で動作させるという技法が用いられる訳であ
るが、テーブル等も含めて並列化する必要があることか
ら、大規模な回路となり、コストアップとなるという欠
点が存在することになる。With regard to such conventional one-dimensional compression, MH codes used in run-length compression, facsimile machines and the like are widely known. These methods have a disadvantage that a sufficient compression ratio cannot be obtained for image data in which the color (black and white) frequently changes in a short cycle (run), such as a pseudo halftone image obtained by computer processing. However, in recent years, it has been difficult to adopt these methods in a memory-saving mechanism, especially in recent years, with the increase in opportunities for printing image data due to advances in personal computers and networks. It is becoming. Also, it should be noted that the two-dimensional compression method, the predictive coding method, the MH coding method, and the like have a drawback that a relatively large capacity reference means such as a line buffer, a probability table, and a code table is required. It is.
For example, a resolution of 1200 dpi (dot / inch),
At a printing speed of 25 ppm (pages / minute), the pixel frequency generally exceeds 100 MHz. It is very difficult to operate the encoding / decoding hardware circuit including the above-mentioned reference means at such a frequency, and in order to overcome this, the circuit is operated at a low frequency by parallelizing the circuit. However, since it is necessary to perform parallel processing including a table and the like, there is a disadvantage that a large-scale circuit is required and the cost is increased.
【0004】前記のように色が短い周期で頻繁に変化す
るような画像データに対する圧縮率を改善するために、
画像データやランレングスの繰り返し性を検出するとい
う特徴を備えた符号化技術も知られている。例えば特許
第2683506号公報には白ワードの長さと黒ワード
の長さを両方記述可能な制御ワードを使用することで白
ワードと黒ワードが比較的短い周期で規則的に現れるイ
メージデータを効率的に圧縮する方法及び装置が開示さ
れている。この方式ではあるワード長(バイト)を規定
し、全てが白であるデータ単位を白ワード、全てが白で
ないものを黒ワードとして扱い、それらの繰り返し出現
数、黒ワードの内容、制御語等をワード長単位で符号化
しているので、符号化及び復号に際して特別な符号テー
ブルを必要とせずまたワード長単位で処理できるのでマ
イクロプロセッサで処理しても十分な処理性能を期待で
きるという点で優れている。しかし、ワード列単位で繰
り返し性を検出しているので、対象とする画像データに
含まれる繰り返しの周期とワード長とが一致するか倍数
となっている場合にのみ高い圧縮率が実現されることに
なり、一般的な画像データに対して十分な圧縮率が得ら
れないという欠点が存在する。In order to improve the compression ratio for image data in which colors frequently change in a short cycle as described above,
An encoding technique having a feature of detecting repeatability of image data and run length is also known. For example, Japanese Patent No. 2683506 discloses a method of efficiently controlling image data in which white and black words appear regularly in a relatively short period by using a control word capable of describing both the length of a white word and the length of a black word. A method and an apparatus for compressing data are disclosed. In this method, a certain word length (byte) is defined, data units that are all white are treated as white words, and those that are not all white are treated as black words, and the number of repeated occurrences, the contents of black words, control words, etc. Since encoding is performed in word length units, no special code table is required for encoding and decoding, and processing can be performed in word length units, which is excellent in that sufficient processing performance can be expected even with microprocessor processing. I have. However, since the repeatability is detected in units of word strings, a high compression ratio can be achieved only when the repetition period and the word length included in the target image data match or are multiples. Therefore, there is a disadvantage that a sufficient compression ratio cannot be obtained for general image data.
【0005】又、特開平9−65147公報には白及び
黒の各々についてランレングス値を記憶し、ある色のラ
ンレングス値が同色の直前のランレングス値に一致する
場合に所定の反復符号を生成することで圧縮率及び処理
速度を改善する方法及び装置が開示されている。色毎に
ランレングス値を記憶し、現在の値と直前の値を比較し
た場合の一致する可能性は比較的高いと考えられる。し
かし、明らかに、ラン長の一致が発生した時に生成され
る反復符号が一致しなかった場合に符号化される符号語
に比べて十分に少ないデータ量である場合にのみ圧縮率
が向上するものであり、より短い符号語を反復符号に割
り当てることは相対的に一致しないラン長の符号語を長
くするので、色が短い周期で頻繁に変化するような画像
データに対しては十分な圧縮率を持つ符号セットを得る
ことが困難であるという欠点が存在する。同明細書の実
施例によるならば、符号セットはMH符号に類似するも
のであり、マイクロプロセッサによる処理ではランレン
グス符号方式のような高速性を期待することは困難であ
り、また、ランレングス値を記憶するための記憶手段が
色に対応して設けられているので、ランレングス値の比
較や格納に際して、色に応じて参照・格納先を選択する
処理が必要となりマイクロプロセッサによる高速処理の
妨げになるという欠点も存在する。Japanese Patent Application Laid-Open No. 9-65147 stores run-length values for each of white and black. Methods and apparatus are disclosed for improving compression ratio and processing speed by generating. The run-length value is stored for each color, and it is considered that the likelihood of coincidence when the current value and the immediately preceding value are compared is relatively high. However, obviously, the compression rate is improved only when the amount of data is sufficiently smaller than the code word to be encoded when the repetition code generated when the run length coincides does not coincide. Assigning shorter codewords to repetition codes lengthens codewords with run lengths that are relatively inconsistent, and therefore has a sufficient compression ratio for image data in which colors change frequently in short periods. Has the disadvantage that it is difficult to obtain a code set with According to the embodiment of the specification, the code set is similar to the MH code, and it is difficult to expect high speed such as the run length coding method by the processing by the microprocessor. Is provided for each color, so that when comparing and storing run-length values, it is necessary to perform a process of selecting a reference / storage destination according to the color, which hinders high-speed processing by the microprocessor. There is also the disadvantage of becoming
【0006】[0006]
【発明が解決しようとする課題】前述した従来のかかる
画像符号化及び復号方法及び装置においては、特定の画
像に対しては高圧縮率が達成できるものの、色が短い周
期で頻繁に変化するような画像データに対しては十分な
圧縮率を得ることが困難であるという問題点があった。
そこで本発明の課題は、このような問題点を解決するも
のである。即ち、近年多用の一途をたどっている色が短
い周期で頻繁に変化するような画像データに対しても、
省メモリで十分な圧縮率が確保できるデータ符号化方法
/復号方法、データ符号化装置/復号装置、及び、その
データ符号化方法/復号方法を用いた画像データ記録シ
ステムを提供することを目的とする。In the above-described conventional image encoding and decoding method and apparatus, although a high compression ratio can be achieved for a specific image, the color frequently changes in a short cycle. There is a problem in that it is difficult to obtain a sufficient compression ratio with respect to various image data.
Therefore, an object of the present invention is to solve such a problem. That is, even for image data in which colors that have been heavily used in recent years change frequently in short cycles,
An object of the present invention is to provide a data encoding method / decoding method, a data encoding device / decoding device, and an image data recording system using the data encoding method / decoding method that can secure a sufficient compression ratio with a memory saving. I do.
【0007】[0007]
【課題を解決するための手段】前記目的を達成するため
に、本発明の請求項1記載のデータ符号化方法は、デー
タを走査して得られる色毎に交互のランレングス数値列
を入力し、所定の符号列に変換して出力する符号化方法
であって、所定のランレングス数値を入力した時に前記
ランレングス数値の値が同色の直前のランレングス数値
に一致する場合を一致事象と設定すると共に一致しない
事象を不一致事象と設定し、一致事象が連続する数を反
復数と設定し、前記一致事象または一致事象の連続が発
生した場合には前記反復数に対応する反復数符号を生成
し、前記不一致事象が発生した場合には前記ランレング
ス数値の値を示す符号を生成することを特徴とする。請
求項2の本発明は、請求項1に記載のデータ符号化方法
において、前記一致事象または一致事象の連続に対して
前記反復数に対応する符号を生成し、前記不一致事象に
対して前記ランレングス数値の値を示す符号を生成する
ための制御内容には、前記反復数を記憶するための反復
数記憶手段に初期値を格納する初期化段階と、前記一致
事象の発生に対応して前記反復数記憶手段に格納された
前記反復数の値を増加させる増加段階と、該時点におけ
る前記不一致事象の発生に対応して前記反復数記憶手段
に格納された前記反復数の値が初期値でない場合には、
前記反復数の値を示す符号を出力した後に前記反復数記
憶手段に格納された前記反復数の値を初期値に戻し、前
記反復数が初期値である時点で前記ランレングス数値の
値を示す符号を生成する符号生成段階と、対象データの
符号化が終了するまで、前記増加段階および前記符号生
成段階を繰り返す繰り返し段階と、符号化の対象となる
データの符号化が終了した時点で、前記反復数の値が初
期値でない場合には、前記反復数の値を示す符号を出力
する符号出力段階とを有することを特徴とする。According to a first aspect of the present invention, there is provided a data encoding method comprising the steps of inputting an alternate run-length numerical sequence for each color obtained by scanning data. A coding method for converting a run length value into a predetermined code sequence and outputting the run length value when a predetermined run length value is input and the run length value matches the immediately preceding run length value of the same color. In addition, an event that does not match is set as a non-matching event, a number of consecutive matching events is set as a repetition number, and when the matching event or a series of matching events occurs, a repetition number code corresponding to the repetition number is generated. When the mismatch event occurs, a code indicating the value of the run length numerical value is generated. According to a second aspect of the present invention, in the data encoding method according to the first aspect, a code corresponding to the number of repetitions is generated for the coincidence event or a series of coincidence events, and the run is performed for the non-coincidence event. The control content for generating the sign indicating the value of the length numerical value includes an initialization step of storing an initial value in a repetition number storage means for storing the repetition number, and the control step corresponding to the occurrence of the coincidence event. An increasing step of increasing the value of the number of repetitions stored in the number-of-repetitions storage means, and the value of the number of repetitions stored in the number-of-repetitions storage means corresponding to the occurrence of the mismatch event at the time is not an initial value in case of,
After outputting a code indicating the value of the number of repetitions, the value of the number of repetitions stored in the number-of-repetitions storage unit is returned to an initial value, and the value of the run-length value is indicated when the number of repetitions is the initial value. A code generation step of generating a code, a repetition step of repeating the increasing step and the code generation step until the encoding of the target data is completed, and at the time when the encoding of the data to be encoded is completed, And outputting a code indicating the value of the number of repetitions if the value of the number of repetitions is not the initial value.
【0008】請求項3の本発明は、請求項1または請求
項2に記載のデータ符号化方法において、前記一致事象
及び不一致事象を識別する制御は、色数分のランレング
ス数値を記憶・参照するためのランレングス値記憶手段
A及びランレングス値記憶手段Lに所定の初期値を格納
する初期化段階と、所定の前記ランレングス数値が前記
各ランレングス値記憶手段Lに入力された時点で、前記
ランレングス数値と前記ランレングス値記憶手段Aに格
納された値とが一致する場合が一致事象であり、一致し
ない場合が不一致事象であると識別する識別段階と、前
記識別段階の後、次のランレングス値入力より以前の時
点において、前記ランレングス値記憶手段Aに前記ラン
レングス値記憶手段Lの値を格納した後、前記ランレン
グス値記憶手段Lに前記所定のランレングス数値の値を
格納する段階とを備えたことを特徴とする。請求項4の
本発明は、請求項3に記載のデータ符号化方法におい
て、前記一致事象及び不一致事象を識別する制御の初期
化段階において、前記ランレングス値記憶手段Aにラン
レングスの測定を開始するときの対象色とは異なる色で
始まる場合を意味する初期値を設定することを特徴とす
る。According to a third aspect of the present invention, in the data encoding method according to the first or second aspect, the control for discriminating the coincidence event and the non-coincidence event stores and refers to a run length numerical value corresponding to the number of colors. An initializing step of storing a predetermined initial value in the run length value storing means A and the run length value storing means L, and a time when the predetermined run length numerical value is inputted to each of the run length value storing means L. An identification step in which a case where the run-length numerical value matches the value stored in the run-length value storage means A is a coincidence event, and a case where the value is not coincident is a mismatch event; and after the identification step, Before the next run length value input, the value of the run length value storage unit L is stored in the run length value storage unit A, and then the run length value storage unit L is stored. Characterized by comprising a step of storing the value of said predetermined run length value. According to a fourth aspect of the present invention, in the data encoding method according to the third aspect, a run length measurement is started in the run length value storage means A in an initialization stage of control for identifying the coincidence event and the mismatch event. In this case, an initial value is set, which means that the color starts with a color different from the target color.
【0009】請求項5記載の本発明のデータ符号化装置
は、データを走査して得られる色毎に交互のランレング
ス数値列を入力し、所定の符号列に変換して出力する符
号化装置であって、所定のランレングス数値を入力し記
憶するランレングス値記憶手段Lと、前記ランレングス
数値と同色の直前のランレングス数値を記憶するランレ
ングス値記憶手段Aと、前記ランレングス数値の値が同
色の直前のランレングス数値に一致するか否かを判別す
る判別手段と、前記ランレングス数値の値が同色の直前
のランレングス値に一致する場合に該一致が反復する反
復数を記憶する反復数記憶手段と、前記反復数を示す符
号を生成する反復数符号生成手段と、前記ランレングス
数値の値が同色の直前のランレングス値に一致しない場
合には前記ランレングス数値の値を示す符号を生成する
ランレングス符号生成手段とを具備することを特徴とす
る。請求項6の本発明は、請求項5記載のデータ符号化
装置において、前記不一致事象に対応して前記ランレン
グス数値の値を示す符号を生成し、前記一致事象または
一致事象の連続に対応する前記反復数に対応して符号を
生成するデータ符号化装置であって、反復数を記憶する
反復数記憶手段と、前記一致事象の発生のたびに前記反
復数の値を増加させる反復数演算手段と、前記不一致事
象の発生に際し、該不一致事象の発生時点における前記
反復数の値が初期値でない場合には、前記反復数の値を
示す符号を出力した後に反復数の値を初期値に戻し、反
復数が初期値である時点で前記ランレングス数値の値を
示す符号を生成するランレングス符号生成手段と、符号
化の対象となるデータの符号化が終了するまで前記各手
段の動作を繰り返す制御を行う制御手段と、対象データ
の符号化が終了となった時点で前記反復数の値が初期値
でない場合に、前記反復数の値を示す符号を出力する反
復数符号生成手段とを備えたことを特徴とする。According to a fifth aspect of the present invention, there is provided a data encoding apparatus for inputting an alternate run-length numerical sequence for each color obtained by scanning data, converting the run-length numerical sequence into a predetermined code sequence, and outputting the converted code sequence. A run length value storage means L for inputting and storing a predetermined run length value, a run length value storage means A for storing a run length value immediately before the same color as the run length value, and a run length value storage means A; Determining means for determining whether or not the value matches the immediately preceding run-length value of the same color; and storing the number of repetitions in which the match is repeated when the value of the run-length value matches the immediately preceding run-length value of the same color. A repetition number storage means for generating a code indicating the number of repetitions, and a repetition number code generating means for generating a code indicating the number of repetitions, and the run length value when the value of the run length value does not match the immediately preceding run length value of the same color. Characterized by comprising a run-length code generation means for generating a code indicating the value of Goes numeric. According to a sixth aspect of the present invention, in the data encoding apparatus according to the fifth aspect, a code indicating the value of the run-length numerical value is generated in response to the mismatch event, and the code corresponds to the match event or a series of match events. A data encoding device for generating a code corresponding to the number of repetitions, wherein the repetition number storage means stores a repetition number, and the repetition number calculating means increases a value of the repetition number every time the coincidence event occurs If the value of the number of repetitions at the time of occurrence of the mismatch event is not the initial value when the mismatch event occurs, the code indicating the value of the number of iterations is output, and then the value of the number of iterations is returned to the initial value. A run-length code generating means for generating a code indicating the value of the run-length numerical value at the time when the number of repetitions is an initial value, and repeating the operations of the respective means until the encoding of the data to be encoded is completed. System And a repetition number code generation means for outputting a code indicating the value of the number of repetitions when the value of the number of repetitions is not the initial value when the encoding of the target data is completed. It is characterized by the following.
【0010】請求項7の本発明は、請求項5または6に
記載のデータ符号化装置において、前記ランレングス数
値を入力し記憶するランレングス値記憶手段Lと、前記
ランレングス数値と同色の直前のランレングス数値を記
憶するランレングス値記憶手段Aと、反復数を記憶する
反復数記憶手段とは、マイクロプロセッサの汎用レジス
タにより構成されることを特徴とする。請求項8記載の
本発明の画像データ記録システムは、請求項1から請求
項4までの何れか1項に記載されたデータ符号化方法を
画像形成装置に適用したことを特徴とする。請求項9記
載の本発明の画像データ記録システムは、請求項8に記
載された画像形成装置が、プリンタであることを特徴と
する。請求項10記載の本発明のデータ復号方法は、請
求項1から請求項4までの何れか1項に記載のデータ符
号化方法を用いて生成された符号列データを走査して得
られる符号列を入力し、色毎に交互のランレングス数値
列に復号して出力するデータ復号方法であって、入力し
た符号列が前記ランレングス符号生成手段により生成さ
れた符号である場合には、前記符号が表わすランレング
ス数値を出力し、入力した符号列が前記反復数符号生成
手段により生成された符号である場合には、同色の直前
のランレングス数値を反復数符号が表わす反復数の個数
分出力することを特徴とする。According to a seventh aspect of the present invention, in the data encoding apparatus according to the fifth or sixth aspect, a run length value storage means L for inputting and storing the run length numerical value, and a run length value immediately before the same color as the run length numerical value. The run-length value storage means A for storing the run-length numerical value and the repetition number storage means for storing the repetition number are constituted by general-purpose registers of a microprocessor. An image data recording system according to an eighth aspect of the present invention is characterized in that the data encoding method according to any one of the first to fourth aspects is applied to an image forming apparatus. An image data recording system according to a ninth aspect of the present invention is characterized in that the image forming apparatus according to the eighth aspect is a printer. According to a tenth aspect of the present invention, there is provided a data decoding method according to any one of the first to fourth aspects, wherein a code sequence obtained by scanning code sequence data generated by using the data encoding method according to any one of the first to fourth aspects. And a decoding method for decoding and outputting an alternate run-length numerical sequence for each color, wherein the input code sequence is a code generated by the run-length code generation means. Is output, and if the input code string is a code generated by the number-of-repetitions code generation means, the last run-length value of the same color is output by the number of repetitions represented by the number-of-repetitions code. It is characterized by doing.
【0011】請求項11の本発明は、請求項10に記載
のデータ復号方法において、色数分のランレングス数値
を記憶・参照するための複号側ランレングス値記憶手段
A及び復号側ランレングス値記憶手段Lに符号化時と同
じ初期値を格納する初期化段階と、所定の符号を入力・
復号して前記符号が示す数値とその属性を得る段階と、
前記符号が示す数値の属性が前記ランレングス符号であ
る場合には、前記符号が示す数値をランレングス数値と
して出力し、前記複号側ランレングス値記憶手段Aに前
記復号側ランレングス値記憶手段Lの内容を格納した
後、前記復号側ランレングス値記憶手段Lに前記ランレ
ングス数値を格納する段階と、前記符号が示す数値の属
性が前記反復符号である場合には、前記反復数を記憶・
参照するための反復数記憶手段に前記反復数の値を格納
し、前記反復数の値が初期値となるまで、前記複号側ラ
ンレングス値記憶手段Aに記憶された数値をランレング
ス数値として出力し、前記複号側ランレングス値記憶手
段Aに前記復号側ランレングス値記憶手段Lに記憶され
た値を格納した後、前記復号側ランレングス値記憶手段
Lに前記ランレングス数値または前記複号側ランレング
ス値記憶手段Aに記憶された値を格納し、前記反復数記
憶手段に記憶された値を所定値減じる処理を繰り返す段
階と、復号化の対象となる符号列のデータが終了するま
で、前記所定の符号単位を入力・復号して前記符号が示
す数値とその属性を得る段階から前記反復数の値を所定
値減じる処理を繰り返す段階までを繰り返す段階とを有
することを特徴とする。請求項12記載の本発明のデー
タ復号装置は、請求項11に記載のデータ復号方法を用
いたデータ復号装置であって、入力した符号列を符号単
位毎に記憶する符号列記憶手段と、前記符号単位の符号
が前記ランレングス符号である場合には、前記ランレン
グス符号が表わすランレングス数値を生成するランレン
グス値生成手段と、入力した符号単位が前記反復数符号
である場合には、前記複号側ランレングス値記憶手段A
に記憶された同色の直前のランレングス数値を前記符号
が表わす反復数の個数分出力するランレングス値出力手
段とを備えたことを特徴とする。According to an eleventh aspect of the present invention, in the data decoding method of the tenth aspect, a decoding-side run-length value storage means A for storing and referencing a run-length value corresponding to the number of colors, and a decoding-side run-length. An initialization step of storing the same initial value in the value storage means L as at the time of encoding;
Decoding to obtain a numerical value indicated by the code and its attribute;
When the attribute of the numerical value indicated by the code is the run-length code, the numerical value indicated by the code is output as a run-length numerical value, and the decoding-side run-length value storing means is stored in the decoding-side run-length value storing means A. After storing the content of L, storing the run-length numerical value in the decoding-side run-length value storing means L; and storing the number of repetitions when the attribute of the numerical value indicated by the code is the repetitive code.・
The value of the number of repetitions is stored in the number-of-repetitions storage means for reference, and the value stored in the decoding-side run-length value storage means A is regarded as a run-length value until the value of the number of repetitions becomes an initial value. After outputting the value stored in the decoding-side run-length value storage means L in the decoding-side run-length value storage means A, the run-length numerical value or the decoding value is stored in the decoding-side run-length value storage means L. A step of storing the value stored in the number-side run-length value storage means A and repeating the process of reducing the value stored in the number-of-repetitions storage means by a predetermined value; and the data of the code string to be decoded ends. A step of repeating the steps from inputting and decoding the predetermined code unit to obtain a numerical value indicated by the code and its attribute to repeating a process of reducing the value of the repetition number by a predetermined value. That. A data decoding apparatus according to a twelfth aspect of the present invention is a data decoding apparatus using the data decoding method according to the eleventh aspect, wherein: a code string storage unit that stores an input code string for each code unit; When the code of the code unit is the run-length code, a run-length value generating unit that generates a run-length value represented by the run-length code; and when the input code unit is the repetition number code, Decoding side run length value storage means A
And run-length value output means for outputting the run-length value immediately before the same color stored in the same number as the number of repetitions represented by the code.
【0012】請求項13の本発明は、請求項12に記載
のデータ復号装置において、色数分のランレングス数値
を記憶・参照するための前記複号側ランレングス値記憶
手段A及び復号側ランレングス値記憶手段Lと、所定の
符号単位を入力・復号して前記符号が示す数値とその属
性を得る復号数値・属性判別手段と、前記復号数値・属
性判別手段にて復号された数値の属性が前記ランレング
ス符号である場合には、前記数値をランレングス数値と
して出力し、前記復号数値・属性判別手段にて復号され
た数値の属性が前記反復数符号である場合には、前記反
復数の値が初期値となるまで、前記複号側ランレングス
値記憶手段Aに記憶された値をランレングス数値として
出力するランレングス値生成手段と、前記復号数値・属
性判別手段にて復号された数値の属性が前記反復数符号
である場合には、前記数値を格納し記憶する復号側反復
数記憶手段と、前記復号側反復数記憶手段に記憶された
反復数の値を減じる処理を反復数に対応して繰り返す反
復数演算手段と、前記各記憶手段に符号化時と同じ初期
値を格納する制御、前記複号側ランレングス値記憶手段
Aに前記復号側ランレングス値記憶手段Lに記憶された
値を格納させた後に前記復号側ランレングス値記憶手段
Lに前記ランレングス数値または前記複号側ランレング
ス値記憶手段Aに記憶された値を格納させる制御、復号
化の対象となる符号列のデータが終了するまで前記反復
数演算手段に繰り返し動作させる制御を行う制御手段と
を備えたことを特徴とする。請求項14の本発明は、請
求項12または13に記載のデータ復号装置において、
ランレングス数値を入力し記憶する復号側ランレングス
値記憶手段Lと、前記ランレングス数値と同色の直前の
ランレングス数値を記憶する複号側ランレングス値記憶
手段Aと、反復数を記憶する反復数記憶手段とは、マイ
クロプロセッサの汎用レジスタにより構成されることを
特徴とする。According to a thirteenth aspect of the present invention, in the data decoding apparatus according to the twelfth aspect, the decoding-side run-length value storage means A and the decoding-side run-length storage means for storing and referring to run-length numerical values for the number of colors Length value storage means L, decoded numerical value / attribute determining means for inputting / decoding a predetermined code unit to obtain a numerical value indicated by the code and its attribute, and attribute of the numerical value decoded by the decoded numerical value / attribute determining means Is the run-length code, the numerical value is output as a run-length numerical value. If the attribute of the numerical value decoded by the decoded numerical / attribute determination means is the repetition number code, the repetition number is used. The run-length value generation means for outputting the value stored in the decoding side run-length value storage means A as a run-length numerical value until the value of If the attribute of the numerical value obtained is the repetition number code, a decoding side repetition number storage unit that stores and stores the numerical value, and a process of reducing the value of the repetition number stored in the decoding side repetition number storage unit Means for calculating the number of repetitions corresponding to the number of repetitions, control for storing the same initial value in each of the storage means as in encoding, and storage for the decoding-side run-length value L in the decoding-side run-length value storage means A After storing the value stored in the decoding-side run-length value storage means L, storing the run-length numerical value or the value stored in the decoding-side run-length value storage means A. And control means for controlling the repetition number calculating means to repeat the operation until the data of the code string is completed. According to a fourteenth aspect of the present invention, in the data decoding device according to the twelfth or thirteenth aspect,
Decoding-side run-length value storage means L for inputting and storing a run-length value; decoding-side run-length value storage means A for storing the immediately preceding run-length value of the same color as the run-length value; The number storage means is constituted by a general-purpose register of a microprocessor.
【0013】請求項15の本発明は、請求項1から請求
項4までの何れか1項に記載のデータ符号化方法におい
て、前記データ符号化方法により符号化される第1の符
号は、4ビット幅を有し、前記4ビットの数値が10未
満であることにより識別され、前記数値に1を加算した
値がランレングス数値に対応する前記符号の一形式であ
り、第2の符号は8ビット幅を有し、符号列において先
行する上位4ビットの値が10以上の所定値であること
により識別され、下位5ビットの値に11を加算した値
がランレングス数値に対応する前記ランレングス符号の
一形式であり、第3の符号は少なくとも8ビット幅で4
の倍数となるビット幅を有し、符号列において先行する
上位4ビットの値が10以上の所定値であることにより
識別され、該4ビットに続く各4ビットについて、その
4ビットの値において8以上の数値が検出されるまで各
4ビットの下位3ビットを上位に向かって連接した数値
に43を加算した値がランレングス数値に対応する前記
符号の一形式であり、第4の符号は4ビット幅を有し、
該4ビットの数値が10以上の所定値であることにより
識別され、前記反復数が1であることに対応する前記符
号の一形式であり、第5の符号は4ビット幅を有し、該
4ビットの数値が10以上の所定値であることにより識
別され、前記反復数が2であることに対応する前記符号
の一形式であり、第6の符号は少なくとも8ビット幅で
4の倍数となるビット幅を有し、符号列において先行す
る上位4ビットの値が10以上の所定値であることによ
り識別され、該4ビットに続く各4ビットについて、そ
の4ビットの値において8以上の数値が検出されるまで
各4ビットの下位3ビットを上位に向かって連接した数
値に4を加算した値が前記反復数に対応する前記反復数
符号の一形式であることを特徴とする。According to a fifteenth aspect of the present invention, in the data encoding method according to any one of the first to fourth aspects, the first code encoded by the data encoding method is 4 bits. A bit width, identified by the 4-bit number being less than 10, a value obtained by adding 1 to the number is a form of the code corresponding to the run-length number, and the second code is 8 The run length corresponding to the run length value, which has a bit width, is identified by the value of the upper 4 bits preceding in the code string being a predetermined value of 10 or more, and adding 11 to the value of the lower 5 bits. One type of code, the third code is at least 8 bits wide and 4
Are identified by the value of the preceding upper 4 bits in the code string being a predetermined value of 10 or more, and for each of the 4 bits following the 4 bits, 8 in the value of the 4 bits. A value obtained by adding 43 to a numerical value obtained by concatenating the lower 3 bits of each 4 bits upward until the above numerical value is detected is one form of the code corresponding to the run-length numerical value. Has a bit width,
The four-bit number is identified by being a predetermined value of 10 or more, and is a type of the code corresponding to the number of repetitions being one, and the fifth code has a four-bit width, A 4-bit numerical value is identified by a predetermined value of 10 or more, and is a type of the code corresponding to the number of repetitions being 2. The sixth code is at least 8 bits wide and a multiple of 4. Is identified by the value of the upper 4 bits preceding in the code string being a predetermined value of 10 or more, and for each of the 4 bits following the 4 bits, a numerical value of 8 or more in the 4-bit value A value obtained by adding 4 to a numerical value obtained by concatenating the lower 3 bits of each 4 bits toward the upper side until is detected is one form of the repetition number code corresponding to the repetition number.
【0014】請求項16の本発明は、請求項10または
請求項11に記載のデータ復号方法において、前記デー
タ復号方法により復号される第1の符号は4ビット幅を
有し、前記4ビットの数値が10未満であることにより
識別され、前記数値に1を加算した値がランレングス数
値に対応する前記符号の一形式であり、第2の符号は8
ビット幅を有し、符号列において先行する上位4ビット
の値が10以上の所定値であることにより識別され、下
位5ビットの値に11を加算した値がランレングス数値
に対応する前記ランレングス符号の一形式であり、第3
の符号は少なくとも8ビット幅で4の倍数となるビット
幅を有し、符号列において先行する上位4ビットの値が
10以上の所定値であることにより識別され、該4ビッ
トに続く各4ビットについて、その4ビットの値におい
て8以上の数値が検出されるまで各4ビットの下位3ビ
ットを上位に向かって連接した数値に43を加算した値
がランレングス数値に対応する前記符号の一形式であ
り、第4の符号は4ビット幅を有し、該4ビットの数値
が10以上の所定値であることにより識別され、前記反
復数が1であることに対応する前記符号の一形式であ
り、第5の符号は4ビット幅を有し、該4ビットの数値
が10以上の所定値であることにより識別され、前記反
復数が2であることに対応する前記符号の一形式であ
り、第6の符号は少なくとも8ビット幅で4の倍数とな
るビット幅を有し、符号列において先行する上位4ビッ
トの値が10以上の所定値であることにより識別され、
該4ビットに続く各4ビットについて、その4ビットの
値において8以上の数値が検出されるまで各4ビットの
下位3ビットを上位に向かって連接した数値に4を加算
した値が前記反復数に対応する前記反復数符号の一形式
であることを特徴とする。According to a sixteenth aspect of the present invention, in the data decoding method according to the tenth or eleventh aspect, the first code decoded by the data decoding method has a 4-bit width, and A number is identified by being less than 10, and a value obtained by adding 1 to the number is a form of the code corresponding to the run-length number, and the second code is 8
The run length corresponding to the run length value, which has a bit width, is identified by the value of the upper 4 bits preceding in the code string being a predetermined value of 10 or more, and adding 11 to the value of the lower 5 bits. A form of code
Has a bit width that is at least an 8-bit width and a multiple of four, and is identified by the fact that the value of the preceding upper four bits in the code string is a predetermined value of 10 or more, and each of the four bits following the four bits , A value obtained by adding 43 to a numerical value obtained by concatenating the lower 3 bits of each 4 bits upwards until a numerical value of 8 or more is detected in the 4-bit value is a form of the code corresponding to the run-length numerical value. And the fourth code has a width of 4 bits, and is identified by a 4-bit numerical value being a predetermined value of 10 or more, and is a form of the code corresponding to the number of repetitions being 1. The fifth code has a 4-bit width, is identified by the 4-bit number being a predetermined value of 10 or more, and is a form of the code corresponding to the number of repetitions being 2. , The sixth sign is less Identified by also has an 8-bit wide bit width as a multiple of 4 in a predetermined value of the upper 4 bit value is 10 or more preceding the code sequence,
For each of the 4 bits following the 4 bits, a value obtained by adding 4 to a numerical value obtained by concatenating the lower 3 bits of each 4 bits upwards until the value of 8 or more is detected in the value of the 4 bits is the number of repetitions. Is a form of the repetition number code corresponding to.
【0015】請求項17の本発明は、請求項5または6
に記載のデータ符号化装置において、前記第1の符号か
ら第6までの符号を生成する符号化手段を備えたことを
特徴とする。請求項18の本発明は、請求項12または
13に記載のデータ復号装置において、前記第1の符号
から第6までの符号を復号する復号手段を備えたことを
特徴とする。請求項19記載の本発明の画像データ記録
システムは、請求項10、請求項11または請求項15
の何れか1項に記載されたデータ復号方法を画像形成装
置に適用したことを特徴とする。請求項20記載の本発
明の画像データ記録システムは、請求項19に記載され
た画像形成装置がプリンタであることを特徴とする。請
求項21記載の本発明のコンピュータ読み取り可能な記
録媒体は、請求項1から請求項4、または請求項15の
何れか1項に記載されたデータ符号化方法をコンピュー
タに実行させるプログラムを記録したことを特徴とす
る。請求項22記載の本発明のコンピュータ読み取り可
能な記録媒体は、請求項10、請求項11または請求項
17の何れか1項に記載されたデータ復号方法をコンピ
ュータに実行させるプログラムを記録したことを特徴と
する。The present invention according to claim 17 is the invention according to claim 5 or 6.
The data encoding device according to the above, further comprising an encoding unit that generates the first to sixth codes. According to an eighteenth aspect of the present invention, in the data decoding apparatus according to the twelfth or thirteenth aspect, the data decoding apparatus further comprises decoding means for decoding the first to sixth codes. The image data recording system according to the nineteenth aspect of the present invention is the tenth aspect, the eleventh aspect or the fifteenth aspect.
Wherein the data decoding method according to any one of the above is applied to an image forming apparatus. An image data recording system according to a twentieth aspect of the present invention is characterized in that the image forming apparatus according to the nineteenth aspect is a printer. A computer-readable recording medium according to a twenty-first aspect of the present invention stores a program for causing a computer to execute the data encoding method according to any one of the first to fourth aspects or the fifteenth aspect. It is characterized by the following. According to a twenty-second aspect of the present invention, there is provided a computer-readable recording medium storing a program for causing a computer to execute the data decoding method according to the tenth, eleventh, or seventeenth aspect. Features.
【0016】前記のように構成されたデータの符号化方
法は、請求項1によれば、生成される符号数を削減し、
コンピュータ処理による擬似中間調画像のように色が短
い周期で頻繁に変化するような画像データに対しても十
分に高い圧縮率を得ることできる符号化方法を提供する
ことができる。前記のように構成されたデータの符号化
方法は、請求項2によれば、前記制御をマイクロプロセ
ッサによるソフトウェア処理で行うことによって十分高
い処理速度を期待することが可能となるよう、代入、加
算、及び、比較・分岐といった簡素な制御で実現するこ
とができる符号化方法を提供することができる。前記の
ように構成されたデータの符号化方法は、請求項3によ
れば、前記制御をマイクロプロセッサによるソフトウェ
ア処理で行っても十分高い処理速度を期待することが可
能となるよう、色に基づく判断・分岐が不要で、且つ、
代入、及び、比較・分岐といった簡素な制御で実現する
画像データの符号化方法を提供することができる。According to a first aspect of the present invention, there is provided a data encoding method configured to reduce the number of generated codes.
It is possible to provide an encoding method capable of obtaining a sufficiently high compression ratio even for image data in which colors frequently change in a short period, such as pseudo halftone images obtained by computer processing. According to the data encoding method configured as described above, according to claim 2, by performing the control by software processing by a microprocessor, the substitution and addition are performed so that a sufficiently high processing speed can be expected. And an encoding method that can be realized by simple control such as comparison and branching. According to the third aspect of the present invention, the data encoding method configured as described above is based on color so that a sufficiently high processing speed can be expected even if the control is performed by software processing by a microprocessor. Judgment / branch is unnecessary, and
It is possible to provide an image data encoding method that can be realized by simple control such as substitution, comparison, and branching.
【0017】前記のように構成されたデータの符号化方
法は、請求項4によれば、ランレングス数値が0である
ことを表現する符号を不要とし、従って、より高い圧縮
率を有する符号セットを利用可能とする符号化方法を提
供することができる。前記のように構成されたデータの
符号化装置は、請求項5によれば、より高い圧縮率が達
成可能な画像データの符号化装置を提供することができ
る。前記のように構成されたデータの符号化装置は、請
求項6によれば、前記制御をマイクロプロセッサによる
ソフトウェア処理で行っても十分高い処理速度を期待す
ることが可能となるよう代入、減算、及び、比較・分岐
といった簡素な制御で実現でき、処理が単純となり極め
て高速な画像データの符号化装置を提供することができ
る。前記のように構成されたデータの符号化装置は、請
求項7によれば、極めて高い処理速度を期待することが
可能な画像データの符号化装置を提供することができ
る。前記のように構成されたデータ記録システムは、請
求項8によれば、種々の場合に適応することが可能な画
像データの符号化方法を用いるデータ記録システムを提
供することができる。According to the fourth aspect of the present invention, there is provided a data encoding method which does not require a code representing that a run-length value is 0, and therefore has a higher compression ratio. Can be provided. According to the data encoding device configured as described above, according to claim 5, it is possible to provide an image data encoding device that can achieve a higher compression rate. According to the data encoding apparatus configured as described above, according to claim 6, substitution, subtraction, In addition, it is possible to realize an image data encoding apparatus which can be realized by simple control such as comparison and branching, and which has simple processing and very high speed. According to the data encoding device configured as described above, according to claim 7, it is possible to provide an image data encoding device that can expect an extremely high processing speed. According to the data recording system configured as described above, according to claim 8, it is possible to provide a data recording system using an image data encoding method applicable to various cases.
【0018】前記のように構成された画像形成装置は、
請求項9によればプリンタであり、よって高速で且つ省
メモリ対応可能なプリンタを提供することができる。前
記のように構成されたデータの復号方法は、請求項10
によれば、迅速で且つ省メモリーが達成できるデータ復
号方法を提供することができる。前記のように構成され
たデータの復号方法は、請求項11によれば、省メモリ
ーで且つ迅速な画像データ復号方法を提供できる。前記
のように構成されたデータの復号装置は、請求項12に
よれば、省メモリーで且つ迅速な画像データ復号が可能
な復号装置を提供することができる。前記のように構成
されたデータの復号装置は、請求項13によれば、迅速
なデータ復号が可能で且つ省メモリーのデータ復号装置
を提供することができる。前記のように構成されたデー
タの復号装置は、請求項14に記載した通り、処理速度
の高いデータ処理が可能であるとともにプロセッサに内
在するメモリと兼用することができ、省メモリのデータ
復号装置を提供することができる。The image forming apparatus configured as described above has
According to the ninth aspect, the present invention is a printer, and therefore, it is possible to provide a high-speed and memory-saving printer. A method for decoding data configured as described above is described in claim 10.
According to this method, it is possible to provide a data decoding method that can achieve quick and memory-saving. According to the data decoding method configured as described above, according to claim 11, a memory-saving and quick image data decoding method can be provided. According to the data decoding device configured as described above, according to the twelfth aspect, it is possible to provide a decoding device capable of quickly saving image data with less memory. According to the data decoding device configured as described above, it is possible to provide a data decoding device capable of quick data decoding and saving memory. The data decoding apparatus configured as described above can perform high-speed data processing and can also be used as a memory included in a processor, as described in claim 14, and has a memory-saving data decoding apparatus. Can be provided.
【0019】前記のように構成されたデータの符号化方
法は、請求項15に記載した通り、符号化生成に際して
特殊なテーブル参照を必要とせず、それらの処理を代
入、加減算、シフト、論理積、及び、比較・分岐といっ
た簡素な制御で実現できる符号セットを導入するので、
該制御をマイクロプロセッサによるソフトウェア処理で
行っても十分高い処理速度を期待することが可能な画像
データの符号化方法を提供することができる。更に、導
入する各符号は処理を容易にハードウェア化できるよう
4ビットまたはその倍数の符号長を有するものであり、
ハードウェア処理とソフトウェア処理を組み合わせるよ
うにすることで、同一の符号化方法を幅広い性能レンジ
に適応させることが可能である画像データの符号化方法
を提供することができる。前記のように構成されたデー
タの符号化及び復号方法は、請求項16に記載した通
り、数値復号に際して特殊なテーブル参照を必要とせ
ず、それらの処理を代入、加減算、シフト、論理積、及
び、比較・分岐といった簡素な制御で実現できる符号セ
ットを導入するので、該制御をマイクロプロセッサによ
るソフトウェア処理で行っても十分高い処理速度を期待
することが可能な画像データの復号方法を提供すること
ができる。更に、導入する各符号は処理を容易にハード
ウェア化できるよう4ビットまたはその倍数の符号長を
有するものであり、ハードウェア処理とソフトウェア処
理を組み合わせるようにすることで、同一の復号方法を
幅広い性能レンジに適応させることが可能である画像デ
ータの復号方法を提供することができる。In the data encoding method configured as described above, a special table reference is not required at the time of encoding generation, and these processes are substituted, added, subtracted, shifted, and ANDed. And a code set that can be realized by simple control such as comparison and branching.
It is possible to provide an image data encoding method that can expect a sufficiently high processing speed even if the control is performed by software processing by a microprocessor. Furthermore, each code to be introduced has a code length of 4 bits or a multiple thereof so that the processing can be easily implemented in hardware.
By combining hardware processing and software processing, it is possible to provide an image data encoding method capable of adapting the same encoding method to a wide performance range. The encoding and decoding method of data configured as described above does not require a special table reference at the time of numerical decoding as described in claim 16, and substitutes those processes for addition, subtraction, shift, logical product, and Introducing a code set that can be realized by simple control such as comparison and branching, and provides an image data decoding method that can expect a sufficiently high processing speed even if the control is performed by software processing by a microprocessor. Can be. Furthermore, each code to be introduced has a code length of 4 bits or a multiple thereof so that the processing can be easily implemented in hardware. By combining hardware processing and software processing, the same decoding method can be widely used. A method for decoding image data that can be adapted to a performance range can be provided.
【0020】前記のように構成されたデータの符号化装
置は、請求項17に記載した通り、画像の符号化におい
て極めて効率的なデータ処理を行う符号化装置を提供す
ることができる。前記のように構成されたデータの復号
装置は、請求項18に記載した通り、画像の復号におい
て極めて効率的なデータ処理を行う復号装置を提供する
ことができる。前記のように構成されたデータ記録シス
テムは、請求項19に記載した通り、擬似中間調のよう
な色の交番の激しい画像にも適切に対応できる画像デー
タ記録システムを提供することができる。前記のように
構成された画像形成装置は、請求項20に記載した通
り、請擬似中間調のような色の交番の激しい画像にも適
切に対応できる画像形成装置が提供できる。請求項2
1、22に記載のコンピュータ読み取り可能な記録媒体
は、記録媒体を利用することでコンピュータによってプ
ログラムを読み取り可能とし、プログラムを実行するこ
とができる。The data encoding device configured as described above can provide an encoding device that performs extremely efficient data processing in image encoding, as described in claim 17. The data decoding device configured as described above can provide a decoding device that performs extremely efficient data processing in decoding an image, as described in claim 18. The data recording system configured as described above can provide an image data recording system that can appropriately cope with an image in which color alternation is intense, such as pseudo halftone, as described in claim 19. The image forming apparatus configured as described above can provide an image forming apparatus that can appropriately cope with an image in which color alternation is intense, such as a pseudo halftone, as described in claim 20. Claim 2
The computer-readable recording media described in 1 and 22 allow a computer to read a program by using the recording medium and execute the program.
【0021】[0021]
【発明の実施の形態】本発明の実施の形態を図面を参照
しつつて詳細に説明する。図1は本発明の基本的な原理
を説明するための図である。以下に述べる原理は本発明
の全ての請求項に共通するものであり、コンピュータ処
理による擬似中間調画像のように色が短い周期で頻繁に
変化するような画像データに対しても十分に高い圧縮率
を得ることを意図して発案されている。図1では、圧縮
の対象となる画像データが6ドットの白で始まり、次に
3ドットの黒、云々と続く場合を例としている。ランレ
ングス数値の計測を白から始める場合、画像データを走
査して得られる色毎に交互のランレングス数値列は図の
“ランレングスL”に示すような値となり、この値が符
号化装置に順次入力されるものとする。前記ランレング
ス数値Lの値が同色の直前のランレングス数値に一致す
る場合を一致事象P(以下事象Pと称する)、一致しな
い場合を不一致事象Q(以下事象Qと称する)とし、事
象Pが連続する数を反復数N(N≧1)とする。各ラン
レングス数値Lに対して、事象Pとなるか、或いは、事
象Qとなるかを同図の“事象”の欄に示してある。ま
た、各事象Pに対する前記反復数Nがどのような値をな
るかを同図の“反復数N”欄に示してある。厳密には、
画像データの最初の白の6ドットと最初の黒の3ドット
には同色の直前のランレングス数値が存在しないため、
何らかの方式定義を与えないと前記事象の判断を行うこ
とができない訳であるが、ここでは単純に両者を事象Q
と仮定する。Embodiments of the present invention will be described in detail with reference to the drawings. FIG. 1 is a diagram for explaining the basic principle of the present invention. The principle described below is common to all claims of the present invention, and sufficiently high compression is applied to image data in which colors frequently change in a short cycle, such as a pseudo halftone image by computer processing. Invented with the intention of gaining a rate. FIG. 1 shows an example in which image data to be compressed starts with 6 dots of white, then 3 dots of black, and so on. When the run length numerical value measurement is started from white, an alternate run length numerical value sequence for each color obtained by scanning the image data becomes a value as shown in “Run length L” in the figure, and this value is transmitted to the encoding device. Assume that they are sequentially input. A case where the value of the run-length numerical value L matches the run-length numerical value immediately before the same color is referred to as a coincidence event P (hereinafter referred to as event P), and a case where the values do not coincide is referred to as a non-coincidence event Q (hereinafter referred to as event Q). A continuous number is defined as a repetition number N (N ≧ 1). For each run-length numerical value L, whether it becomes event P or event Q is shown in the column of “event” in FIG. The value of the number of repetitions N for each event P is shown in the column of "number of repetitions N" in FIG. Strictly speaking,
Since the first six dots of white and the first three dots of black of the image data do not have a run length value immediately before the same color,
It is impossible to judge the above event unless some method definition is given.
Assume that
【0022】本発明では、前記事象Qに対しては前記ラ
ンレングス数値Lの値を示すL符号を生成し、前記事象
Pまたは事象Pの連続に対しては前記反復数Nに対応す
るN符号を生成する。生成される符号がL符号となる
か、或いは、N符号となるかを同図の“符号”欄に示し
てある。同図から、容易に判断できるように、計10個
のランレングス数値Lの数値入力に対して生成される符
号は計6個となり、符号数の低下が可能となることがわ
かる。前記の原理が意図した効果を奏するためには、事
象Pが発生する確率と事象Pが連続する確率が十分に高
いものである必要のあることは容易に理解できる。本願
発明者の観測によれば、通常の文字原稿における事象P
の発生確率は15%程度、事象Pが連続する確率は25
%程度に過ぎないが、これらをMH符号で圧縮すると9
0%程度の圧縮率が得られる。しかし、網掛け、円グラ
フのようなパターングラフィックス、あるいは写真イメ
ージのような擬似中間調の画像等で色が短い周期で頻繁
に変化するような要素が増えるに従って、事象Pの発生
確率及び事象Pが連続する確率が著しく向上し、逆に、
MH符号による圧縮率は著しく低下する傾向のあること
が観測された。MH符号による圧縮率が38%と観測中
最も低かった画像データにおける事象Pの発生確率は9
4%、事象Pが連続する確率は99%であった。言い換
えるならば、元々高い圧縮率を期待できる画像データに
ついては圧縮率の著しい改善は期待できないが、圧縮率
の低さが問題となるような画像データに対して圧縮率の
著しい改善が見込まれる訳であり、これは少なくとも1
ページ分の画像データを圧縮できるメモリ容量がコスト
を支配する主要な要因となる省メモリ機構にとって非常
に好適な性質と言える。According to the present invention, an L code indicating the value of the run length numerical value L is generated for the event Q, and corresponding to the repetition number N for the event P or a series of events P. Generate an N code. Whether the generated code is an L code or an N code is shown in the “Code” column in FIG. From the figure, it can be seen that, as can be easily determined, a total of six codes are generated for a total of ten run-length numerical values L input, and the number of codes can be reduced. It can be easily understood that the probability that the event P occurs and the probability that the event P continues should be sufficiently high for the above-described principle to achieve the intended effect. According to the observations made by the inventor of the present application, the event P
Is about 15%, and the probability that event P continues is 25
%, But when these are compressed with the MH code, 9%
A compression ratio of about 0% is obtained. However, as the number of elements in which the color frequently changes in a short cycle increases in shading, pattern graphics such as pie charts, or pseudo-halftone images such as photographic images, the probability of occurrence of event P and The probability that P continues is significantly improved, and conversely,
It has been observed that the compression rate by the MH code tends to decrease significantly. The occurrence probability of the event P in the image data having the lowest compression ratio of 38% with the MH code being 38% is 9
4% and the probability that event P was continuous was 99%. In other words, a significant improvement in the compression ratio cannot be expected for image data that can originally be expected to have a high compression ratio, but a significant improvement in the compression ratio is expected for image data in which a low compression ratio poses a problem. Which is at least 1
This can be said to be a very suitable property for a memory saving mechanism in which the memory capacity capable of compressing image data for a page is a major factor controlling cost.
【0023】図2は本発明による符号化装置及び復号装
置を画像形成装置に適用した一実施例を示す構成図であ
る。図2には本件発明が適用される周知のプリンタ装置
1が示されている。パーソナルコンピュータ等のホスト
マシーン2からの画像データがホストI/F3を介して
コントローラー4に入力される。この際の画像データの
一例が前出の図1に示されたランレングス数値Lに該当
する。5はオペレーショナルパネル、6はパネルI/
F、7はフオントROM、8はNV−RAM、9はオプ
ションRAM、10はプリンタエンジン11にデータを
送り込む際のエンジンI/Fである。12は、例えばF
DやICカードもしくはネットワーク上から導入される
記録媒体13に書き込まれたプログラムをプリンタ装置
1に導入するための入力装置である。14はプログラム
ROM、15はRAM、16は制御手段としてのCPU
であり、このプログラムROM14、RAM15、CP
U16により、本発明の最も主要な特徴部分である符号
化装置17及び復号装置18が構成されており、この部
分を図上黒太枠で囲んである。FIG. 2 is a block diagram showing an embodiment in which the encoding apparatus and the decoding apparatus according to the present invention are applied to an image forming apparatus. FIG. 2 shows a known printer device 1 to which the present invention is applied. Image data from a host machine 2 such as a personal computer is input to the controller 4 via the host I / F 3. An example of the image data at this time corresponds to the run length numerical value L shown in FIG. 5 is an operational panel, 6 is a panel I /
F and 7 are font ROMs, 8 is an NV-RAM, 9 is an option RAM, and 10 is an engine I / F for sending data to the printer engine 11. 12 is, for example, F
It is an input device for introducing a program written on a recording medium 13 introduced from a D, an IC card, or a network into the printer device 1. 14 is a program ROM, 15 is a RAM, 16 is a CPU as control means
The program ROM 14, RAM 15, CP
The encoding device 17 and the decoding device 18 which are the most main features of the present invention are constituted by U16, and these portions are surrounded by a thick black frame in the figure.
【0024】本実施例の符号化装置および復号装置を、
図3の(a)及び(b)に示す。図3(a)は本件発明
の符号化装置の内部構成であり、19はランレングス記
憶手段A、20はランレングス記憶手段B、21はラン
レングス記憶手段L、22は判別手段、23は反復数記
憶手段及び演算手段、24はランレングス符号生成手
段、25は反復数符号生成手段、26は符号化手段であ
る。この構成の動作に関しては、図4等を用いて以降に
説明する。図3(b)は、前出の符号化方法及び装置に
より符号化された符号列を復号する方法及び装置に関す
るものである。30は復号側ランレングス記憶手段A、
31は復号側ランレングス記憶手段B、27は復号にあ
たり、符号列の数値と属性とを判別する復号数値・属性
判別手段と記憶するための復号数値・属性記憶手段を含
む復号数値・属性判別記憶手段であり、28は復号手
段、29は復号側ランレングス値記憶手段L及び復号側
ランレングス値出力手段を含むランレングス値生成手
段、32は復号側反復数記憶手段及び復号側演算手段で
ある。この構成に関する動作も、図4等を用いて以降に
説明する。The encoding device and the decoding device of the present embodiment
3 (a) and 3 (b). FIG. 3A shows the internal configuration of the encoding apparatus according to the present invention, wherein 19 is a run-length storage means A, 20 is a run-length storage means B, 21 is a run-length storage means L, 22 is a discriminating means, and 23 is a repeater. Numeral storage means and calculation means, 24 is a run-length code generation means, 25 is a repetition number code generation means, and 26 is an encoding means. The operation of this configuration will be described later with reference to FIG. FIG. 3B relates to a method and an apparatus for decoding a code string encoded by the encoding method and the apparatus described above. 30 is decoding-side run-length storage means A,
31 is a decoding-side run-length storage means B, and 27 is a decoding numerical / attribute discriminating storage including a decoding numerical / attribute discriminating means for discriminating a numerical value and an attribute of a code string upon decoding, and a decoding numerical / attribute storing means for storing. 28, decoding means; 29, run-length value generating means including decoding-side run-length value storage means L and decoding-side run-length value output means; 32, decoding-side iteration number storage means and decoding-side arithmetic means. . The operation related to this configuration will be described later with reference to FIG.
【0025】図4は本発明による符号化方法の一実施例
を示すフロー図である。本図は、請求項1の実施例でも
あるが、同時に、請求項2記載の符号生成に関する各段
階、及び、請求項3より請求項4記載の事象識別に関す
る各段階を含むものとする。まず、同図に用いられてい
る記号について説明する。A及びBは、色数分のランレ
ングス数値を記憶・参照するための一時記憶である。C
は、初期化段階において前記A及びBに代入される定数
を意味する。Lは、画像データを走査して得られるラン
レングス数値を記憶・参照するための一時記憶である。
Nは、前記反復数、即ち、前記事象Pの連続する数を記
憶・参照するための一時記憶である。本実施例をソフト
ウェアで構成する場合には、前記A、B、L、及び、N
は適切な一時記憶手段を用いればよいが、特にマイクロ
プロセッサの汎用レジスタを用いることが処理速度向上
の観点から好ましい。また、前記定数Cと制御の各段階
はプログラム即ち命令コードとして適切な記憶手段を用
いればよい。FIG. 4 is a flowchart showing an embodiment of the encoding method according to the present invention. Although this figure is also an embodiment of claim 1, it also includes each step of code generation according to claim 2 and each step of event identification according to claims 3 to 4. First, the symbols used in FIG. A and B are temporary storages for storing and referring to run-length numerical values for the number of colors. C
Means a constant substituted into A and B in the initialization stage. L is a temporary storage for storing and referring to a run length numerical value obtained by scanning the image data.
N is a temporary storage for storing and referring to the number of repetitions, that is, a continuous number of the events P. When the present embodiment is configured by software, the above A, B, L, and N
Although a suitable temporary storage means may be used, it is particularly preferable to use a general-purpose register of a microprocessor from the viewpoint of improving the processing speed. In addition, the constant C and each stage of control may use a suitable storage means as a program, ie, an instruction code.
【0026】以下、図4の各段階に沿って本実施例の動
作を説明する。符号化開始により、まず、ステップ10
においてA及びBに所定の定数Cを、Nに“0”を代入
する。本実施例ではA及びBに同一の値Cを代入してい
るが、AとBに対して別個の値を代入しても構わない。
次に、ステップ11において1個のランレングス数値を
取得し、Lに格納する。次に、ステップ12においてA
とランレングス数値Lの値を比較し、一致する場合には
ステップ16へ、不一致である場合にはステップ13へ
と分岐する。この判断は、前記事象P及び事象Qの識別
に相当する。AとLが一致した場合、つまり事象Pの場
合、ステップ16では反復数Nの値を“1”増加させ
る。この処理は事象Pが発生した場合には反復数Nを表
わすN符号を生成するためにNを計数するとともに、符
号生成を保留していることに他ならない。AとLが不一
致であった場合、つまり事象Qの場合には、先ず、ステ
ップ13においてNと“0”とを比較し、Nが“0”で
ない場合、即ち符号生成を保留されている場合には、ス
テップ14においてその時点でのN値に対応するN符号
を生成し、ステップ15においてNの値を“0”に戻す
ことで保留状態を解消する。ステップ15の次、また
は、先のステップ13でNが“0”であった場合、即
ち、符号生成保留のない時点で、ステップ17において
その時点でのL値に対応するL符号を生成する。Hereinafter, the operation of the present embodiment will be described with reference to the steps shown in FIG. At the start of encoding, first, step 10
, A predetermined constant C is substituted for A and B, and “0” is substituted for N. In this embodiment, the same value C is substituted for A and B, but different values may be substituted for A and B.
Next, in step 11, one run length numerical value is acquired and stored in L. Next, in step 12, A
Is compared with the value of the run-length numerical value L. If they match, the process branches to step 16; if they do not match, the process branches to step 13. This determination corresponds to the identification of the event P and the event Q. When A and L match, that is, in the event P, in step 16, the value of the number of repetitions N is increased by "1". This processing is nothing more than counting N to generate an N code representing the number of repetitions N when the event P occurs, and suspending code generation. If A and L do not match, that is, if it is event Q, first, N is compared with "0" in step 13, and if N is not "0", that is, if code generation is suspended. In step, an N code corresponding to the N value at that time is generated in step, and the value of N is returned to “0” in step 15, thereby canceling the hold state. If N is “0” in step 13 following step 15 or in step 13, that is, at a time when code generation is not suspended, an L code corresponding to the L value at that time is generated in step 17.
【0027】事象Pまたは事象Qに対応する前記の処理
の次に、ステップ18において、Aの内容をその時点で
のBの値に更新し、Bの値をその時点でのLの値に更新
する。次に、ステップ19により全対象画像データに対
する処理が終了したか否かを判断し、画像データが残さ
れている場合には前記ステップ11に分岐して前記ステ
ップ18に至る制御を繰り返し、画像データが終了した
時点でステップ20へと進む。ステップ20においてN
と“0”とを比較し、Nが“0”でない場合、即ち符号
生成を保留されている場合には、ステップ21において
その時点でのN値に対応するN符号を生成して保留状態
を解消する。ステップ21の次、または、先のステップ
20でNが“0”であった場合、即ち、符号生成保留の
ない時点で符号化処理を完了する。以上の説明により、
本実施例によるならば、簡素な制御のみで、事象Qに対
してはランレングス数値Lを示すL符号が生成され、事
象Pまたは事象Pの連続に対しては反復数Nに対応する
N符号が生成され得ることが理解できる。特に、事象P
及び事象Qの判断に際しては、前記A及びBの一時記憶
を色に特定して設けるのではなく、ステップ18から明
らかなように、色とは無関係に順送りする手法を用いて
いるので、ステップ18及びステップ12において色に
基づく判断が不要となっており高速処理に寄与できる。After the above-described processing corresponding to the event P or the event Q, in step 18, the content of A is updated to the value of B at that time, and the value of B is updated to the value of L at that time. I do. Next, it is determined in step 19 whether or not the processing for all the target image data has been completed. If the image data remains, the control branches to step 11 and repeats the control to step 18 to repeat the image data. When the process is completed, the process proceeds to step 20. N in step 20
Is compared with “0”. If N is not “0”, that is, if code generation is suspended, an N code corresponding to the N value at that time is generated in step 21 to change the suspension state. To eliminate. If N is "0" in step 20 following step 21 or in step 20 before, that is, at the time when code generation is not suspended, the encoding process is completed. By the above explanation,
According to the present embodiment, an L code indicating the run length numerical value L is generated for the event Q with only simple control, and an N code corresponding to the number of repetitions N is generated for the event P or a series of the events P. Can be generated. In particular, event P
In determining the event Q, the temporary storage of A and B is not specified for each color, but a method of sequentially moving the colors regardless of the color is used, as is apparent from step 18. In addition, the judgment based on the color is unnecessary in step 12, which can contribute to high-speed processing.
【0028】前記図1に関する説明においては、第1の
ランレングス数値と第2のランレングス数値には同色の
直前のランレングス数値が存在しないため、何らかの方
式定義を与えないと事象の判断を行うことができないこ
とを述べたが、本実施例においては、フロー図を追跡す
れば容易に理解できるように、第1のランレングス数値
については前記Aの初期値と、第2のランレングス数値
については前記Bの初期値との比較が行われ、一致する
場合が事象P、一致しない場合が事象Qとなることがわ
かる。請求項4記載の発明は、前記Aの初期値として
“0”を代入するものである。該内容を本実施例に適用
するならば、前記の説明から明らかなように、第1のラ
ンレングス数値が“0”である場合に事象Pが発生する
という特徴を得ることが可能となる。一般的に少なくと
も1ドット以上の画像データを走査して色毎に交互のラ
ンレングス数値を生成する場合、ランレングス数値が
“0”となるのは、白から測定を始めて画像が黒から始
まる場合と、黒から測定を始めて画像が白から始まる場
合のみであり、測定開始色を定めればいずれか一方とな
ることがわかる。それ以降のランレングス数値は“1”
以上の値を持つので、“0”なる値の発生頻度は非常に
低いことがわかる。そこで、この“0”というランレン
グス数値を事象PとみなしてN符号で符号化させると、
L符号において“0”なる値を表現する必要がなくなる
という特徴を得ることができる。後述する符号セットは
実際に、“0”を表現するL符号を定義しないものであ
る。In the description relating to FIG. 1, since the first run-length value and the second run-length value do not have a run-length value immediately before the same color, an event is determined unless some system definition is given. However, in the present embodiment, as can be easily understood by tracing the flow chart, the first run-length value is the initial value of A and the second run-length value is Is compared with the initial value of B, and it can be seen that event P is determined when they match, and event Q is determined when they do not match. According to a fourth aspect of the present invention, "0" is substituted as the initial value of the A. If this content is applied to the present embodiment, it is possible to obtain a feature that the event P occurs when the first run-length value is “0”, as is clear from the above description. Generally, when scanning at least one dot of image data to generate alternate run length values for each color, the run length value becomes “0” when the measurement starts from white and the image starts from black. And only when the image starts from black and the image starts from white, and it can be seen that either one can be determined if the measurement start color is determined. The run length value after that is "1"
With the above values, it is understood that the frequency of occurrence of the value “0” is extremely low. Then, when this run-length value of “0” is regarded as an event P and is encoded by N code,
It is possible to obtain a feature that it is not necessary to represent a value “0” in the L code. The code set described below does not actually define an L code representing “0”.
【0029】なお、以上の説明では、ステップ11に示
すランレングス測定及びこれに関連するステップ19に
示すデータ終了判断の手順、及び、ステップ14、ステ
ップ17、及び、ステップ21に示す符号生成に関する
詳細な制御手順は省略してある。ランレングス測定及び
これに関連するデータ終了判断に関しては、当業者にと
っては十分公知の技術であるため省略するものとする。
符号生成に関する制御手順を示すためには、先に具体的
符号セットを定義する必要があるため、後述するものと
する。図5は本発明による復号方法の一実施例を示すフ
ロー図である。まず、同図に用いられている記号につい
て説明する。A及びBは、色数分のランレングス数値を
記憶・参照するための一時記憶である。Cは、初期化段
階において前記A及びBに代入される定数である。L
は、画像データを走査して得られるランレングス数値を
記憶・参照するための一時記憶である。Nは、前記反復
数、即ち、前記事象Pの連続する数を記憶・参照するた
めの一時記憶である。Wは、符号単位から復号した数値
を記憶・参照するための一時記憶である。Vは、前記W
の内容がランレングス数値(V=0)であるか反復数
(V=1)であるかを示すフラグ情報のための一時記憶
である。前出の符号化方法の場合と同様に、本実施例を
ソフトウェアで構成する場合には、前記A、B、L、及
び、Nは適切な一時記憶手段を用いればよいが、特にマ
イクロプロセッサの汎用レジスタを用いることが処理速
度向上の観点から好ましい。また、前記定数Cと制御の
各段階はプログラム、即ち命令コードとして適切な記憶
手段を用いればよい。In the above description, the details of the run length measurement shown in step 11 and the procedure for determining the end of data shown in step 19 and the code generation shown in steps 14, 17 and 21 are described. Various control procedures are omitted. The measurement of the run length and the determination of the end of the data related thereto are well known to those skilled in the art and will not be described.
In order to show a control procedure regarding code generation, it is necessary to define a specific code set first, and this will be described later. FIG. 5 is a flowchart showing one embodiment of the decoding method according to the present invention. First, the symbols used in FIG. A and B are temporary storages for storing and referring to run-length numerical values for the number of colors. C is a constant assigned to A and B in the initialization stage. L
Is a temporary storage for storing and referring to a run length numerical value obtained by scanning image data. N is a temporary storage for storing and referring to the number of repetitions, that is, a continuous number of the events P. W is temporary storage for storing and referring to a numerical value decoded from a code unit. V is the W
Is a temporary storage for flag information indicating whether the content is a run-length numerical value (V = 0) or the number of repetitions (V = 1). As in the case of the above-described encoding method, when the present embodiment is configured by software, the above-mentioned A, B, L, and N may use appropriate temporary storage means. It is preferable to use a general-purpose register from the viewpoint of improving the processing speed. In addition, the constant C and each stage of control may use a suitable storage means as a program, that is, an instruction code.
【0030】以下、同図の各段階に沿って本実施例の動
作を説明する。復号開始により、まず、ステップ30に
おいてA及びBに所定の定数Cを代入する。正しい復号
が行われるためには、各々に代入される定数は符号化に
おいて同名の一時記憶に代入される値と一致するもので
ある必要がある。次に、ステップ31において一個の符
号単位を読み出し、復号して、Wに復号した数値を、該
数値の属性、即ち反復数か否かをVに格納する。次に、
ステップ32において該Vの値を用いて数値Wの属性を
判定し、ランレングス数値であれば(V=0)処理38
へ、反復数であれば(V=1)ステップ33へと分岐す
る。ランレングス数値が得られた場合には、まず、ステ
ップ38において前記Wの値をLに代入してランレング
ス数値として出力し、ステップ39においてAの値をそ
の時点でのBの値に更新し、Bの値をその時点でのLの
値に更新し、ステップ40へと進む。反復数が得られた
場合には、まず、ステップ33において前記Wの値をN
に格納し、次にステップ34においてその時点でのAの
値をLに代入してランレングス数値として出力し、次に
ステップ35においてAの値をその時点でのBの値に更
新し、Bの値をその時点でのLの値に更新し、次にステ
ップ36においてNの値を“1”減じ、次にステップ3
7においてNの値を検査してNが“0”となるまでステ
ップ34よりステップ36までを繰り返し、Nが“0”
となった時点でステップ40へと進む。Hereinafter, the operation of the present embodiment will be described with reference to the respective steps shown in FIG. Upon the start of decoding, first, in step 30, a predetermined constant C is substituted for A and B. In order for correct decoding to be performed, the constant assigned to each of them must match the value assigned to the temporary storage of the same name in encoding. Next, in step 31, one code unit is read and decoded, and the numerical value decoded into W is stored in V as an attribute of the numerical value, that is, whether or not the number of repetitions. next,
In step 32, the attribute of the numerical value W is determined using the value of the V, and if it is a run-length numerical value (V = 0) processing 38
If the number of repetitions is (V = 1), the flow branches to step 33. When the run-length value is obtained, first, in step 38, the value of W is substituted for L and output as a run-length value. In step 39, the value of A is updated to the value of B at that time. , B are updated to the current value of L, and the process proceeds to step 40. When the number of repetitions is obtained, first, in step 33, the value of W is set to N
Then, in step 34, the value of A at that time is substituted for L and output as a run-length numerical value. Then, in step 35, the value of A is updated to the value of B at that time. Is updated to the current value of L, then the value of N is reduced by "1" in step 36, and
In step 7, the value of N is checked, and steps 34 to 36 are repeated until N becomes "0".
Then, the process proceeds to step 40.
【0031】次に、ステップ40により全対象符号列に
対する処理が終了したか否かを判断し、符号データが残
されている場合には前記ステップ31に分岐してステッ
プ40に至る制御を繰り返し、符号データが終了した時
点で復号処理を終了する。以上の説明により、本実施例
によるならば、簡素な制御のみで、前記L符号とN符号
とで構成される符号列データから元のランレングス数値
列が生成され得ることが理解できる。但し、本実施例は
具体的な数値復号手段を特定しないものであるため、最
適の状態とはなっていない点に注意が必要である。即
ち、該手段と本実施例を組み合わせて一連の処理とする
ならば、前記WやVといった一時記憶を経由する必然性
がないためである。以上の説明では、ステップ34、ス
テップ38に示すランレングス数値出力を画像データに
戻すための及びこれに関連するステップ40に示すデー
タ終了判断の手順、及び、ステップ31に関する詳細な
制御手順は省略してある。前記描画手段及びこれに関連
するデータ終了判断は、当業者にとっては十分公知の技
術であるため省略するものとする。数値復号手段に関す
る制御手順を示すためには、先に具体的符号セットを定
義する必要があるが、これについては後述するものとす
る。Next, in step 40, it is determined whether or not the processing for all the target code strings has been completed. If code data remains, the control branches to step 31 and repeats the control to step 40. The decoding process ends when the code data ends. From the above description, according to the present embodiment, it can be understood that the original run-length numerical sequence can be generated from the code sequence data composed of the L code and the N code with only simple control. However, it should be noted that the present embodiment does not specify a specific numerical value decoding means, and is not in an optimum state. That is, if the means and this embodiment are combined to form a series of processes, there is no necessity to go through temporary storage such as W or V. In the above description, the procedure for returning the run-length numerical output to the image data shown in steps 34 and 38 and the procedure for determining the end of the data shown in step 40 related thereto and the detailed control procedure for step 31 are omitted. It is. The drawing means and the data end determination related thereto are well known to those skilled in the art and will not be described. In order to show the control procedure relating to the numerical value decoding means, it is necessary to define a specific code set first, which will be described later.
【0032】図6は、本発明の符号化・復号方法に用い
る符号セットの一実施例を示す図である。本実施例の符
号セットは、図に示すように、6形式の符号単位から構
成される。第1の符号形式L1より第3の符号形式L3
まではランレングス数値を表わすL符号であり、第4の
符号形式N1より第6の符号形式N3までは反復数を表
わすN符号である。第1の符号形式L1は4ビット幅を
有し、該4ビットの数値が“10”未満であることによ
り識別され、該数値に“1”を加算した値がランレング
ス数値Lに対応する。第2の符号形式L2は8ビット幅
を有し、符号列において先行する上位4ビットの値が
“11”または“12”であることにより識別され、下
位5ビットの値に“11”を加算した値がランレングス
数値Lに対応する。第3の符号形式L3は少なくとも8
ビット幅で4の倍数となるビット幅を有し、符号列にお
いて先行する上位4ビットの値が“12”であることに
より識別され、該4ビットに続く各4ビットについて、
その4ビットの値において“8”以上の数値が検出され
るまで各4ビットの下位3ビットを上位に向かって連
接、即ちつなぎ合わせをした数値に“43”を加算した
値がランレングス数値Lに対応する。FIG. 6 is a diagram showing an embodiment of a code set used in the encoding / decoding method of the present invention. As shown in the figure, the code set according to the present embodiment includes six types of code units. The third code format L3 from the first code format L1
Are the L codes representing the run-length numerical values, and the fourth code format N1 to the sixth code format N3 are the N codes representing the number of repetitions. The first code format L1 has a 4-bit width, and is identified by the fact that the 4-bit value is less than “10”, and a value obtained by adding “1” to the value corresponds to the run-length value L. The second code format L2 has an 8-bit width, is identified by the value of the preceding upper 4 bits in the code string being “11” or “12”, and adds “11” to the value of the lower 5 bits. The calculated value corresponds to the run length numerical value L. The third code format L3 is at least 8
It has a bit width that is a multiple of 4 in bit width, and is identified by the value of the preceding upper 4 bits in the code string being “12”, and for each of the 4 bits following the 4 bits,
The lower three bits of each of the four bits are concatenated upward, ie, the value obtained by adding "43" to the connected numerical value until the numerical value of "8" or more is detected in the 4-bit value is the run-length numerical value L. Corresponding to
【0033】第3の符号形式L3の右端に記載した数
式、即ちL={Fn,…,F1,F0}+43は、代表
的なハードウェア記述言語であるヴェリログ(Verilog;
米国Cadence社の登録商標)の表現を用いたもの
で括弧の内部で、カンマで区切られたFn等の各要素を
記述された順序で連接し1個の数値とすることを意味す
るものである。第4の符号形式N1は4ビット幅を有
し、該4ビットの数値が“13”であることにより識別
され、前記反復数Nが“1”であることに対応する。第
5の符号形式N2は4ビット幅を有し、該4ビットの数
値が“14”であることにより識別され、前記反復数N
が“2”であることに対応する。第6の符号形式N3は
少なくとも8ビット幅で4の倍数となるビット幅を有
し、符号列において先行する上位4ビットの値が“1
5”であることにより識別され、該4ビットに続く各4
ビットについて、その4ビットの値において“8”以上
の数値が検出されるまで各4ビットの下位3ビットを上
位に向かって連接、即ちつなぎ合わせした数値に“4”
を加算した値が前記反復数Nに対応する。第6の符号形
式N3の右端に記載した数式、即ちN={Fn,…,F
1,F0}+4は、代表的なハードウェア記述言語であ
る例えばヴェリログ(Verilog;米国Cadence社の
登録商標)の表現を用いたもので括弧の内部で、カンマ
で区切られたFn等の各要素を記述された順序で連接し
1個の数値とすることを意味するものである。The mathematical expression described at the right end of the third code format L3, that is, L = {Fn,..., F1, F0} +43, is a typical hardware description language, Verilog;
(Cadence, U.S.A.) is used, which means that elements such as Fn separated by commas are connected in the order described in parentheses to form one numerical value. . The fourth code format N1 has a 4-bit width and is identified by the fact that the 4-bit value is “13”, which corresponds to the repetition number N being “1”. The fifth code format N2 has a 4-bit width, and is identified by the fact that the 4-bit value is "14".
Is "2". The sixth code format N3 has a bit width of at least 8 bits and a multiple of 4, and the value of the preceding upper 4 bits in the code string is “1”.
5 ", each 4 bits following the 4 bits.
As for the bits, the lower three bits of each of the four bits are concatenated toward the upper side until a numerical value equal to or more than "8" is detected in the value of the four bits, that is, the connected numerical value is "4".
Corresponds to the number of repetitions N. The mathematical expression described at the right end of the sixth code format N3, that is, N = {Fn,.
1, F0} +4 is a representation using a typical hardware description language, for example, Verilog (registered trademark of Cadence Corporation, USA), and each element such as Fn separated by a comma in parentheses. Are concatenated in the described order to form one numerical value.
【0034】反復数Nが“3”に対応する符号は明示さ
れていないが、N1符号(N=1)とN2符号(N=
2)を組み合わせて用いるものとする。これらの組み合
わせで構成される符号量は8ビットであり、N3形式の
符号の最低符号量と同じとなり、この組み合わせ表現を
用いることで、ある符号量を持つN3符号が対応する値
域を上げることが可能となるためである。また、ランレ
ングス数値が“0”となる符号もまた明示されていない
が、この問題は請求項4に記載した発明を用いて、その
符号自体を不要とすることが好適である。但し、本実施
例の符号形式は表現可能な値域を原理的に制約するもの
ではなく、L3符号やN3符号を用いるならば任意の整
数を表現できるという特徴が存在する点に注意された
い。なぜならば、数値を復号するための処理に用いられ
る一時記憶は有限のビット幅を有するものであり、一
方、L3符号やN3符号の長さには制限がないので、連
接と加算による処理の結果が桁上がりにより“0”や負
数となるような符号を生成することができるからであ
る。Although the code corresponding to the number of repetitions N of "3" is not explicitly shown, the N1 code (N = 1) and the N2 code (N =
2) shall be used in combination. The code amount composed of these combinations is 8 bits, which is the same as the minimum code amount of the code in the N3 format. By using this combination expression, it is possible to increase the range corresponding to the N3 code having a certain code amount. This is because it becomes possible. In addition, although the code with which the run-length numerical value is "0" is not specified, it is preferable that the code itself be unnecessary by using the invention described in claim 4. However, it should be noted that the code format of the present embodiment does not restrict the expressible value range in principle, and there is a feature that any integer can be expressed if an L3 code or an N3 code is used. The reason is that the temporary storage used for the process of decoding a numerical value has a finite bit width, while the length of the L3 code or the N3 code is not limited. This is because it is possible to generate a code such that “0” or a negative number is generated by carry.
【0035】本願発明者の観測によるならば、本実施例
の符号セットを用いた符号化により非常に優れた圧縮率
が観測された。文字のみの画像データについてはMH方
式とほぼ同等の圧縮率が観測され、擬似中間調画像のよ
うに色が短い周期で頻繁に変化するような画像データに
ついてはMH方式に比べて著しく高い圧縮率が観測され
た。先に述べたように、MH符号による圧縮率が観測中
最も低かった画像データの圧縮率は38%であったが、
本方式により92%に改善された。前記に具体的符号セ
ットの実施例を導入したことで、以下、この符号セット
の使用を前提に、符号化方法に関するL符号生成方法の
実施例、N符号生成方法の実施例、及び、復号方法に関
して数値復号方法の実施例を順次説明する。According to the observations made by the inventor of the present application, a very excellent compression ratio was observed by encoding using the code set of the present embodiment. A compression ratio almost equivalent to that of the MH system is observed for image data containing only characters, and a compression ratio significantly higher than that of the MH system for image data such as a pseudo halftone image whose color frequently changes in a short cycle. Was observed. As described above, the compression ratio of the image data whose compression ratio by the MH code was the lowest during observation was 38%,
With this method, it was improved to 92%. With the introduction of the specific code set embodiment, the embodiment of the L code generation method, the embodiment of the N code generation method, and the decoding method for the coding method will be described below on the assumption that this code set is used. In the following, embodiments of the numerical decoding method will be sequentially described.
【0036】図7は前記事象Qに呼応してランレングス
符号を生成する制御の実施例を示すフロー図である。こ
れは前出の図4のステップ17を具体化したものであ
り、入力である一個のランレングス数値Lを前記図6に
記載した符号セットのL1〜L3形式のいずれか一つに
変換する。同図において、“K(n)←X;”なる代入
式は、“X”の下位“n”ビットを符号として出力する
ことを意味するものとする。また、“W”は前記L3符
号を生成する処理に用いる一時記憶である。L符号生成
処理が開始されると、即ち、ある一個のランレングス数
値Lが入力されると、まず、ステップ50において、該
ランレングス数値Lが“10”以下であるか否かを判断
し、“10”以下である場合には、ステップ51におい
て、該ランレングス数値Lから“1”を減じた値の下位
4ビットを符号として出力し、符号生成処理を終了す
る。生成される符号は4ビット幅で、この減算の結果、
その値は“10”未満であり、その値に“1”を加えた
ものがランレングス数値Lを表わすことから、前記L1
符号に他ならないことがわかる。前記ステップ50にお
いて、ランレングス数値Lが“11”以上の値であると
判断される場合には、次にステップ52においてランレ
ングス数値Lが“42”以下であるか否かが判断され、
“42”以下である場合には、ステップ53において、
該ランレングス数値Lに“149”を加えた値の下位8
ビットを符号として出力し、符号生成処理を終了する。
ランレングス数値Lと符号値を対応づける代入式“K
(8)←L+149”を、“K(8)←L−11+16
0”と展開すれば、これが前記L2符号に他ならないこ
とが容易に理解できる。ランレングス数値Lは“11≦
L≦42”の値域を有するので“0≦L−11≦31”
となり前記L2符号の数値部F、即ち下位5ビットに相
当し、“160”を2進数表現するならば“10100
000”であって、上位3ビットが符号固有の定数に相
当する。FIG. 7 is a flowchart showing an embodiment of control for generating a run-length code in response to the event Q. This is a concrete example of step 17 in FIG. 4 described above, and converts one input run-length numerical value L into one of the L1 to L3 formats of the code set described in FIG. In the figure, the substitution expression “K (n) ← X;” means that the lower “n” bits of “X” are output as a code. “W” is temporary storage used for the process of generating the L3 code. When the L code generation process is started, that is, when a certain run-length numerical value L is input, first, in step 50, it is determined whether or not the run-length numerical value L is equal to or less than "10". If it is equal to or less than "10", in step 51, the lower 4 bits of the value obtained by subtracting "1" from the run-length value L are output as a code, and the code generation process ends. The generated code is 4 bits wide, and as a result of this subtraction,
The value is less than “10”, and the value obtained by adding “1” to the value represents the run length numerical value L.
It turns out that it is nothing but a sign. If it is determined in step 50 that the run length value L is equal to or greater than "11", then in step 52, it is determined whether the run length value L is equal to or less than "42".
If it is equal to or less than “42”, in step 53,
Lower 8 of the value obtained by adding “149” to the run length numerical value L
The bit is output as a code, and the code generation process ends.
An assignment expression “K” that associates a run-length numerical value L with a code value
(8) ← L + 149 ”is replaced with“ K (8) ← L−11 + 16 ”.
It can easily be understood that this is nothing but the above-mentioned L2 code when expanded to "0".
L ≦ 42 ”, so“ 0 ≦ L−11 ≦ 31 ”
It corresponds to the numerical value part F of the L2 code, that is, the lower 5 bits, and if “160” is represented by a binary number, “10100
000 ", and the upper three bits correspond to a code-specific constant.
【0037】前記ステップ52において、ランレングス
数値Lが“43”以上の数値であると判断された場合に
は、まず、ステップ54において“12”なる数値を4
ビットの符号として出力する。“12”を2進数表現す
るならば“1100”であり、これは、前記L3符号開
始を識別するための定数に他ならない。次に、ステップ
55において、Wにランレングス数値Lから“43”を
減じた数値を代入する。以下、このWの値を用いて、L
3符号の数値部を生成する制御は、まず、ステップ56
においてWの値が“8”未満であるか否かを判断し、
“8”以上である場合にはステップ57において該W値
と定数“7”とのビット毎の論理積をとった値の下位4
ビットを符号として出力し、次にステップ58において
該Wの値を下位側、即ち右に3ビットシフトした値で更
新し、前記ステップ56においてWの値が“8”未満と
なるまで、これらステップ57及びステップ58を繰り
返し、前記ステップ56においてWの値が“8”未満と
なった時点で、ステップ59においてWに定数“8”を
加えた値の下位4ビットを符号として出力して符号生成
処理を終了するという各段階を含む。定数“7”を2進
数表現すれば“0111”であり、ステップ57におい
て生成される符号は常に“8”未満の数値となり、以降
にWの数値断片を表わす符号が連続することを明示し、
一方、定数“8”を2進数表現すれば“1000”であ
り、ステップ59において生成される符号は常に“8”
以上の数値となり、該符号が数値部の最後のものである
ことを明示する訳である。If it is determined in step 52 that the run length numerical value L is a numerical value equal to or greater than "43", first in step 54, the numerical value "12" is
Output as the sign of the bit. If “12” is expressed in a binary number, it is “1100”, which is nothing but a constant for identifying the start of the L3 code. Next, at step 55, a value obtained by subtracting "43" from the run-length value L is substituted for W. Hereinafter, using this value of W, L
The control for generating the numerical part of the three codes is as follows.
It is determined whether the value of W is less than “8” in
If the value is equal to or greater than "8", in step 57 the lower 4 bits of the value obtained by ANDing the W value and the constant "7" for each bit.
The bit is output as a code, and the value of W is updated in step 58 with the value shifted to the lower side, that is, right by 3 bits. In step 56, until the value of W is less than "8", 57 and step 58 are repeated, and when the value of W becomes less than "8" in step 56, the lower 4 bits of the value obtained by adding a constant "8" to W are output as a code in step 59 to generate a code. It includes each stage of terminating the process. If the constant "7" is represented by a binary number, it is "0111", and the code generated in step 57 is always a numerical value less than "8".
On the other hand, if the constant “8” is expressed in binary, it is “1000”, and the code generated in step 59 is always “8”.
The above numerical values indicate that the sign is the last one of the numerical values.
【0038】図8は前記事象Pまたは事象Pの連続に呼
応して前記反復数に対応するN符号を生成する制御の実
施例を示すフロー図である。これは、前出の図4のステ
ップ14及びステップ21を具体化したものであり、入
力である一個の反復数Nを前記図6に示した符号セット
のN1〜N3形式のいずれか一つに変換する。図7同
様、同図において、“K(n)←X;”なる代入式は、
“X”の下位“n”ビットを符号として出力することを
意味するものとする。また、“W”は前記N3符号を生
成する処理に用いる一時記憶である。N符号生成処理が
開始されると、即ち、ある一個の反復数Nが入力される
と、まず、ステップ60において該N値が“3”未満で
あるか否かを判断し、“3”未満、即ちNが“1”また
は“2”である場合には、ステップ61において、該N
値に“12”を加えた値の下位4ビットを符号として出
力し、符号生成処理を終了する。生成される符号は4ビ
ット幅で、Nの値が“1”である場合には“13”、N
の値が“2”である場合には“14”となり、それぞ
れ、前記N1符号及びN2符号に他ならないことがわか
る。前記ステップ60において、ランレングス数値Lが
“3”以上の値であると判断される場合には、次にステ
ップ62においてN値が“3”であるか否かが判断さ
れ、“3”である場合には、ステップ63において、定
数“222”の下位8ビットを符号として出力し、符号
生成処理を終了する。定数“222”を2進数表現する
ならば“11011110”であり、これは、前記N1
“1101”(N=1)符号と前記N2符号“111
0”(N=2)とを連接したものであり、前記のよう
に、Nの値が“3”であることに対応する。原理的にN
2符号が上位でN1符号が下位であっても構わず、従っ
て、ステップ63において用いられる定数は“237”
即ち2進数の“11101101”であっても構わな
い。FIG. 8 is a flowchart showing an embodiment of the control for generating the N code corresponding to the number of repetitions in response to the event P or the continuation of the event P. This is a concrete example of the steps 14 and 21 in FIG. 4 described above, and the number of repetitions N as one input is changed to one of the N1 to N3 forms of the code set shown in FIG. Convert. As in FIG. 7, in FIG. 7, the substitution expression “K (n) ← X;”
This means that the lower “n” bits of “X” are output as codes. “W” is temporary storage used for the process of generating the N3 code. When the N code generation process is started, that is, when a certain number of repetitions N is input, first, at step 60, it is determined whether or not the N value is less than “3”. That is, when N is “1” or “2”, in step 61, the N
The lower 4 bits of the value obtained by adding "12" to the value are output as a code, and the code generation processing ends. The code to be generated is 4 bits wide, and if the value of N is “1”, “13”, N
Is "14" when the value is "2", and it can be seen that there is no other than the N1 code and N2 code, respectively. If it is determined in step 60 that the run length value L is a value equal to or greater than "3", it is next determined in step 62 whether the N value is "3". If there is, in step 63, the lower 8 bits of the constant "222" are output as a code, and the code generation process ends. If the constant “222” is expressed in binary, it is “11011110”.
“1101” (N = 1) code and the N2 code “111”
0 "(N = 2), which corresponds to the value of N being" 3 "as described above.
The two codes may be higher and the N1 code may be lower. Therefore, the constant used in step 63 is "237".
That is, it may be a binary number “11101101”.
【0039】前記ステップ62において、ランレングス
数値Lが“4”以上の数値である場合には、まず、ステ
ップ64において“15”なる数値を4ビットの符号と
して出力する。“15”を2進数表現するならば“11
11”であり、これは、前記N3符号開始を識別するた
めの定数に他ならない。次に、ステップ65において、
WにN値から“4”を減じた数値を代入する。以下、こ
のWの値を用いて、N3符号の数値部を生成する制御
は、まず、ステップ66においてWの値が“8”未満で
あるか否かを判断し、“8”以上である場合にはステッ
プ67において該W値と定数“7”とのビット毎の論理
積をとった値の下位4ビットを符号として出力し、次に
ステップ68において該Wの値を下位側即ち右に3ビッ
トシフトした値で更新し、前記ステップ66においてW
の値が“8”未満となるまで、これらステップ67及び
ステップ68を繰り返し、前記ステップ66においてW
の値が“8”未満となった時点で、ステップ69におい
てWに定数“8”を加えた値の下位4ビットを符号とし
て出力して符号生成処理を終了するという各段階を含
む。定数“7”を2進数表現すれば“0111”であ
り、ステップ57において生成される符号は常に“8”
未満の数値となり、以降にWの数値断片を表わす符号が
連続することを明示し、一方、定数“8”を2進数表現
すれば“1000”であり、ステップ69において生成
される符号は常に“8”以上の数値となり、該符号が数
値部の最後のものであることを明示する訳である。If it is determined in step 62 that the run length numerical value L is a numerical value equal to or greater than "4", first, in step 64, a numerical value "15" is output as a 4-bit code. If “15” is expressed in binary, “11”
11 ″, which is nothing but a constant for identifying the start of the N3 code.
A value obtained by subtracting “4” from the N value is substituted for W. Hereinafter, the control for generating the numerical part of the N3 code using the value of W is performed by first determining in step 66 whether the value of W is less than “8”. In step 67, the lower 4 bits of the value obtained by ANDing the W value and the constant "7" for each bit are output as a code, and then in step 68, the value of W is shifted to the lower side, that is, 3 bits to the right. The value is updated with the bit-shifted value.
Steps 67 and 68 are repeated until the value of “<8” is less than “8”.
Is smaller than "8", in step 69, the lower 4 bits of the value obtained by adding the constant "8" to W are output as a code, and the code generation process is terminated. If the constant “7” is expressed in binary, it is “0111”, and the code generated in step 57 is always “8”.
, Which indicates that the sign representing the numerical fragment of W is continuous. On the other hand, if the constant "8" is represented by a binary number, it is "1000", and the code generated in step 69 is always "1000". It becomes a numerical value of 8 "or more, which clearly indicates that the sign is the last one of the numerical part.
【0040】図9は前記符号化方法により生成された符
号列データから一個の符号単位を入力し、ランレングス
数値または反復数値に復号する制御の実施例を示すフロ
ー図である。これは、前出の図5のステップ31を具体
化したものであり、入力である一個の符号単位から、復
号した数値Wと該Wの内容がランレングス数値(V=
0)であるか反復数(V=1)であるかを示すフラグ情
報Vを出力する。同図において、“K←符号入力;”な
る代入式は、一時記憶Kの下位4ビットに順次符号列デ
ータの4ビットが代入され、Kの持つビット幅に応じ
て、その上位には“0”が補充されるものを意味する。
なお、“U”はL3符号またはN3符号の数値復元に用
いられる一時記憶である。数値復号の処理が開始される
と、まず、ステップ70において符号の最初の4ビット
を入力しKに代入する。次に、ステップ71において、
該K値が“13”未満であるか否かを判別する。前記図
6から明らかなように、この判別は数値復元を行う対象
符号がランレングス数値(K≦12)であるか、反復数
値(K>12)であるかを識別するものである。前記ス
テップ71でKが“13”未満である場合、即ち、符号
がランレングス数値である場合には、まず、ステップ7
2においてフラグVに“0”を格納し、以降に復号する
値Wがランレングス数値であることを示す。次に、ステ
ップ73において前記K値が“10”未満であるか否か
を判別する。K値が“10”未満であれば、前記L1符
号であることが確定するので、ステップ74においてW
にK値に“1”を加えた値を代入して数値復号処理を終
了する。前記ステップ73において、Kが10以上の値
を示す場合には、ステップ75において、前記K値が
“12”であるか否かを判別する。K値が“12”でな
い場合には、前記L2符号であることが確定するので、
ステップ76において、Kを左に4ビットシフトした値
をWに代入し、次の符号4ビット分をKに読み取って、
該Wに該Kを加えた値から定数“149”を減じた値を
Wに代入して数値復号処理を終了する。L2符号に関す
るこれらの処理は、8ビット符号の値から定数“14
9”を減じた値を復号値とするものであり、符号化にお
いてランレングス数値に定数“149”を加えた値を符
号とした図6のステップ53の逆操作となっていること
が容易に理解できる。前記ステップ75においてK値が
“12”である場合には、前記L3符号であることが確
定するので、まず、ステップ77において一時記憶Uに
定数“43”を格納する。この数値は以降の数値部から
得られる数値をランレングス数値に復号するために加算
されるべきオフセット値であり、符号化において数値部
の符号化に先立って、ランレングス数値から定数“4
3”を減じた図6のステップ55の逆操作を行うための
ものである。以下、数値部を復号するための制御は、ま
ず、ステップ82においてWに“0”を格納し、次に、
ステップ83において次の符号4ビット分をKに読み取
り、次にステップ84においてKの値が“8”未満であ
るか否かを判断し、“8”未満である場合にはステップ
85においてW値に該K値を加算し、次にステップ86
において該Wの値を上位側、即ち左に3ビットシフトし
た値で更新し、前記ステップ84においてKの値が
“8”未満となるまで、これらステップ83よりステッ
プ86までを繰り返し、前記ステップ84においてKの
値が“8”以上となった時点で、ステップ87において
WにKを加算し、定数“8”を減じ、更に前記U値を加
算した値をWに代入して数値復号処理を終了する。FIG. 9 is a flowchart showing an embodiment of control for inputting one code unit from the code string data generated by the above-mentioned encoding method and decoding it into a run-length numerical value or a repetitive numerical value. This is a concrete example of step 31 in FIG. 5 described above. From one input code unit, the decoded numerical value W and the contents of the W are the run-length numerical values (V =
0) or the number of repetitions (V = 1). In the figure, the substitution expression “K ← code input;” is such that four bits of code string data are sequentially substituted into the lower four bits of the temporary storage K, and “0” is added to the upper part according to the bit width of K. "Means what is replenished.
Note that “U” is temporary storage used for numerical restoration of the L3 code or the N3 code. When the numerical decoding process is started, first, in step 70, the first four bits of the code are input and substituted into K. Next, in step 71,
It is determined whether or not the K value is less than "13". As is apparent from FIG. 6, this discrimination identifies whether the target code for which the numerical value is to be restored is a run-length numerical value (K ≦ 12) or a repetitive numerical value (K> 12). If K is less than "13" in step 71, that is, if the sign is a run-length numerical value, first, step 7
In step 2, "0" is stored in the flag V to indicate that the value W to be decoded thereafter is a run-length numerical value. Next, at step 73, it is determined whether or not the K value is less than "10". If the K value is less than “10”, it is determined that the code is the L1 code.
Is substituted with a value obtained by adding "1" to the K value, and the numerical value decoding process is terminated. If K is equal to or greater than 10 in step 73, it is determined in step 75 whether the K value is "12". If the K value is not “12”, it is determined that the code is the L2 code.
In step 76, the value obtained by shifting K by 4 bits to the left is substituted for W, and the next 4 bits of code are read into K,
A value obtained by subtracting a constant “149” from the value obtained by adding the K to the W is substituted for W, and the numerical value decoding process ends. These processes for the L2 code are performed by converting the value of the 8-bit code to a constant “14”.
9 is used as the decoded value, and the inverse operation of step 53 in FIG. 6 in which the value obtained by adding a constant “149” to the run-length numerical value in the encoding is easily obtained. It can be understood that if the K value is "12" in step 75, it is determined that the code is the L3 code, so first in step 77 a constant "43" is stored in the temporary storage U. This is an offset value to be added in order to decode a numerical value obtained from the following numerical part into a run-length numerical value. In encoding, prior to encoding of the numerical part, a constant “4” is calculated from the run-length numerical value.
6 to reduce the value of "3". In the control for decoding the numerical value part, first, "0" is stored in W in step 82, and
In step 83, the next 4 bits of the code are read into K. Then, in step 84, it is determined whether or not the value of K is less than "8". The K value is added to
In step 84, the value of W is updated with a value shifted by 3 bits to the upper side, that is, to the left. Steps 83 to 86 are repeated until the value of K is less than "8" in step 84. When the value of K becomes equal to or more than "8" in step 87, K is added to W in step 87, the constant "8" is reduced, and the value obtained by adding the U value is substituted for W to perform numerical decoding processing. finish.
【0041】一方、前記ステップ71でKが“13”以
上である場合、即ち、符号が反復数である場合には、ま
ず、ステップ78においてフラグVに“1”を格納し、
以降に復号する値Wが反復数であることを示す。次に、
ステップ79において前記K値が“15”であるか否か
を判別する。K値が“15”に一致しない場合には、前
記N1符号または前記N2符号であることが確定するの
で、ステップ80において、WにK値から“12”を減
じた値を代入して数値復号処理を終了する。これによ
り、入力した符号がN1(“13”)である場合には
“1”、N2(“14”)である場合には“2”なる反
復数が復号されることは容易に理解できる。また、先の
ステップ79において前記K値が“15”である場合に
は、前記N3符号であることが確定するので、ステップ
81において一時記憶Uに“4”を代入し、以下、L3
符号に関して前記に説明したステップ82よりステップ
87に至る制御を用いて数値を復号し、Wに代入して数
値復号処理を終了する。前記の数値復号制御の実施例
は、先に図5を用いて説明した復号方法との関連で、復
号した数値Wと該Wの内容がランレングス数値(V=
0)であるか反復数値(V=1)であるかを示すフラグ
情報Vを出力するよう構成した。しかし、先にも述べた
ように、復号制御と数値復号制御とを分離する必然性は
なく、一体化することがむしろ当然である。同様の事柄
は、図4を用いて説明した符号化手順と、図7及び図8
を用いて説明した符号生成手順についても当てはまる。
一体化する場合には、前記のような入出力の方法をとる
必然性はなく、より簡素な手順に組み替えることが可能
である。但し、最終的にどのような手順とするのが最適
であるかは、その実施形態によるところが大きく、また
当業者にとっては容易に最適化できるものであるので詳
細な実施例は省略するものとする。以上の実施例で、本
発明による符号化及び復号方法の制御手順を説明した訳
であるが、以下、図を用いて具体的な符号化及び復号の
動作例を説明する。On the other hand, if K is equal to or greater than "13" in step 71, that is, if the code is the number of repetitions, "1" is first stored in the flag V in step 78,
This indicates that the value W to be decoded thereafter is the number of iterations. next,
In a step 79, it is determined whether or not the K value is "15". If the K value does not coincide with “15”, it is determined that the code is the N1 code or the N2 code. The process ends. Thus, it can be easily understood that the number of repetitions "1" is decoded when the input code is N1 ("13"), and the number of repetitions is "2" when the input code is N2 ("14"). If the K value is "15" in step 79, it is determined that the code is the N3 code. In step 81, "4" is assigned to the temporary storage U.
The numerical value is decoded using the control from step 82 to step 87 described above for the code, and is substituted for W, thereby terminating the numerical value decoding process. In the embodiment of the numerical value decoding control, the decoded numerical value W and the contents of the W are the run-length numerical values (V =
0) or a repetition value (V = 1). However, as described above, it is not necessary to separate the decoding control and the numerical decoding control, and it is rather natural to integrate them. The same thing can be said of the encoding procedure described with reference to FIG.
This also applies to the code generation procedure described using.
In the case of integration, there is no necessity to adopt the input / output method as described above, and it is possible to change to a simpler procedure. However, what procedure is ultimately optimal is largely dependent on the embodiment and can be easily optimized by those skilled in the art, so that detailed examples will be omitted. . In the above embodiment, the control procedure of the encoding and decoding method according to the present invention has been described. Hereinafter, a specific example of the encoding and decoding operations will be described with reference to the drawings.
【0042】図10は、本発明による符号化の動作例を
説明するための図である。同図に示すように、圧縮の対
象となる画像データが3ドットの黒で始まり、次に41
ドットの白、云々と続く場合を例としている。ランレン
グスの計測は白から始めるものとする。図10には、1
0個のランレングス数値が示してあるが、計測を白から
始めるため、最初に入力されるランレングス数値は
“0”となり、以後、図示した10個の数値が続くた
め、合計11個のランレングス数値が入力されることに
なる。10個のランレングス数値を示した図の下の表
は、符号化の動作をステップ順に説明する表である。表
形式の部分において、“段階”欄は符号化のステップを
“S1”より“S12”までのステップで説明するため
の記号を示す欄である。“S1”より“S11”の各段
階は、前記合計11個のランレングス数値が入力された
時点に相当し、“S12”は符号化終了時点に相当す
る。“L”欄は前記“S1”より“S11”の各時点で
入力されたランレングス数値を表わし、“B”欄は前記
“S1”より“S11”の各時点での前記一時記憶Bの
内容を表わし、“A”欄は前記“S1”より“S11”
の各時点での前記一時記憶Aの内容を表わし、“L=
A”欄は前記“S1”より“S11”の各時点で“L=
A”が成立するか否かを表わし、成立する場合である
(YES)が前記事象Pの発生を、不成立の場合である
(NO)が前記事象Qの発生に相当し、“N”欄は前記
“S1”より“S11”の各時点での前記一時記憶Nの
内容を表わし、“符号生成”欄は、次の段階に至るまで
に生成する符号の内容を表わし、“符号(16進)”欄
は生成される符号を16進数で表わしたものである。FIG. 10 is a diagram for explaining an example of the encoding operation according to the present invention. As shown in the figure, the image data to be compressed starts with three dots of black,
An example is shown in which dots are white, and so on. The run length measurement shall start with white. In FIG.
Although zero run-length numerical values are shown, the run-length numerical value input first becomes "0" because the measurement starts from white, and thereafter, the ten numerical values shown continue, so that a total of 11 run-length numerical values are obtained. The length value will be entered. The table below the figure showing the ten run-length numerical values is a table for explaining the encoding operation in the order of steps. In the tabular form, the “stage” column is a column showing symbols for describing the encoding steps in steps from “S1” to “S12”. Each stage from "S1" to "S11" corresponds to a point in time when the total of 11 run-length numerical values have been input, and "S12" corresponds to a point in time at which encoding ends. The “L” column indicates the run length numerical value input at each time point from “S1” to “S11”, and the “B” column indicates the contents of the temporary storage B at each time point from “S1” to “S11”. In the “A” column, “S11” is used instead of “S1”.
Represents the contents of the temporary storage A at each time point of “L =
The “A” column indicates “L = L” at each time point from “S1” to “S11”.
A "represents whether or not A is satisfied. The case where" A "is satisfied corresponds to the occurrence of the event P, and the case where it is not satisfied (NO) corresponds to the occurrence of the event Q." N " The column indicates the contents of the temporary storage N at each time from "S1" to "S11", and the "sign generation" column indicates the contents of the codes to be generated up to the next stage. The “hexadecimal)” column indicates the generated code in hexadecimal.
【0043】前記にも説明したように、段階S1より段
階S11において入力されるL値は“0”、“3”、
“41”、云々と表に示す値となる。A及びBには初期
値“0”が代入されており、各段階を移行する間に、A
にBの値が、BにLの値が代入されるので、段階S1よ
り段階S11におけるA及びBの値は表に示す値とな
る。段階S2、段階S3、及び段階9においてはLとA
とが不一致となり事象Qが発生するが、段階S12を除
くその他の段階では一致して事象Pが発生する。事象P
の発生する各段階では、符号を発生せず、反復数Nの値
を“1”増加させるが、その値は次の段階に反映されて
いる。例えば段階S1において検出される事象Pの処理
結果として、符号生成は行われず、段階S2においてN
=1が反映されるのみとなる。また、段階S4より段階
S8までのように事象Pが5個連続する場合には、該当
期間において符号生成は行われず、段階S9においてN
=5が反映されるのみとなる。As described above, the L values input from step S1 to step S11 are "0", "3",
"41", and the values shown in the table. The initial value “0” is substituted for A and B, and during the transition of each stage, A
Is substituted for the value of B, and the value of L is substituted for B, so that the values of A and B in steps S1 through S11 are as shown in the table. In steps S2, S3, and 9, L and A
Do not coincide with each other, and an event Q occurs. However, in other stages except for step S12, the event P coincides with each other and an event P occurs. Event P
Does not generate a code at each stage in which occurs, the value of the number of repetitions N is increased by “1”, and the value is reflected in the next stage. For example, as a processing result of the event P detected in step S1, no code is generated, and in step S2, N
= 1 is only reflected. Further, when five events P are consecutive as in steps S4 to S8, no code is generated in the corresponding period, and N is determined in step S9.
= 5 is only reflected.
【0044】最初に事象Qが発生する段階S2では、N
の値が“1”であるため、まず、N1符号(‘D’)が
生成され、Nに“0”が代入され、次に“L=3”を表
わすL1符号(‘2’)が生成される。次に事象Qが発
生する段階S3では、Nの値が“0”に戻っているた
め、“L=41”を表わすL2符号(‘BE’)のみが
生成される。次に事象Qが発生する段階S9では、Nの
値が“5”であるため、まず、“N=5”を表わすN3
符号(‘F9’)が生成され、Nに“0”が代入され、
次に“L=443”を表わすL3符号(‘C02E’)
が生成される。段階S10及び段階S11において2個
のランレングス数値が入力されるが、ともに事象Pが発
生し、符号生成を保留したまま入力完了となる。入力完
了となった段階S12においては、Nの値が“2”とな
っているため、“N=2”を表わすN2符号(‘E’)
が生成され、符号化完了となる。At the stage S2 when the event Q first occurs, N
Is "1", first, an N1 code ('D') is generated, "0" is substituted for N, and then an L1 code ('2') representing "L = 3" is generated. Is done. Next, at the stage S3 when the event Q occurs, since the value of N has returned to "0", only the L2 code ('BE') representing "L = 41" is generated. Next, in the step S9 in which the event Q occurs, the value of N is "5".
A code ('F9') is generated, "0" is substituted for N,
Next, an L3 code ('C02E') representing “L = 443”
Is generated. In step S10 and step S11, two run-length numerical values are input. In both cases, the event P occurs, and the input is completed while the code generation is suspended. At the stage S12 when the input is completed, the value of N is "2", so the N2 code ('E') representing "N = 2"
Is generated, and the encoding is completed.
【0045】図11は本発明によるL3符号生成の動作
例を説明するための図である。前記、図10の段階S9
の例に合わせて、“L=443”なるランレングス数値
を‘C02E’(16進数)なる符号に符号化する例を
図6の符号生成制御の各段階に対応して説明するもので
ある。表形式の部分において、“段階”欄は符号生成の
ステップを“T1”より“T10”までのステップで説
明するための記号を示す欄であり、括弧内に示す数字は
図6において括弧書きされているステップ記号に対応す
る。“Wの値”欄は各ステップにおける一時記憶Wの値
を2進数と10進数で示す欄である。“W<8の判定”
欄は、図7のステップ56の判定結果を示す欄である。
“符号生成(16進数)”欄は、該当する段階で生成さ
れる符号を16進数で示す欄である。符号化処理が開始
されると、L>42であるため、まず、段階T1におい
てL3符号を識別する定数である‘C’(16進数)を
4ビットの符号として出力する。次に段階T2において
“L−43”即ち“400”なる値をWに代入する。次
に、段階T3では、“W≧8”であるため、続く段階T
4においてWと定数“7”の論理積の下位4ビット即ち
‘0’(16進数)を符号として出力し、続く段階T5
においてWを右に3ビット分シフトした値即ち“50”
でWを更新する。次に、段階T6では、“W≧8”であ
るため、続く段階T7においてWと定数“7”の論理積
の下位4ビット即ち‘2’(16進数)を符号として出
力し、続く段階T8においてWを右に3ビット分シフト
した値即ち“6”でWを更新する。次に、段階T9で
は、“W<8”であるため、続く段階T10においてW
に“8”を加えた値の下位4ビット即ち‘E’(16進
数)を符号として出力し、符号化を完了する。FIG. 11 is a diagram for explaining an operation example of L3 code generation according to the present invention. Step S9 of FIG.
The following describes an example of encoding the run-length value “L = 443” into a code “C02E” (hexadecimal number) corresponding to each stage of the code generation control in FIG. In the tabular form, the "stage" column is a column showing symbols for describing the code generation steps in steps from "T1" to "T10", and the numbers in parentheses are written in parentheses in FIG. Corresponding to the step symbol. The "value of W" column is a column indicating the value of the temporary storage W in each step in binary and decimal numbers. “Judgment of W <8”
The column is a column indicating the determination result of step 56 in FIG.
The “code generation (hexadecimal)” column is a column indicating the code generated at the corresponding stage in hexadecimal. When the encoding process is started, since L> 42, first, at step T1, 'C' (hexadecimal), which is a constant for identifying the L3 code, is output as a 4-bit code. Next, in step T2, the value "L-43", that is, "400" is substituted for W. Next, in step T3, since “W ≧ 8”, the following step T3
In step 4, the lower 4 bits of the logical product of W and the constant "7", that is, '0' (hexadecimal) is output as a sign, and the subsequent step T5
, A value obtained by shifting W to the right by 3 bits, ie, “50”
To update W. Next, in step T6, since “W ≧ 8”, in the following step T7, the lower 4 bits of the logical product of W and the constant “7”, that is, '2' (hexadecimal) is output as a sign, and the following step T8 , The W is updated with a value obtained by shifting W to the right by 3 bits, that is, “6”. Next, in step T9, since “W <8”, in the subsequent step T10, W
, The lower 4 bits of the value obtained by adding “8” to the output, that is, 'E' (hexadecimal number) is output as a code, and the coding is completed.
【0046】図12は、データ復号の動作例を説明する
ための図である。前記図12による符号化の動作例の結
果として出力される符号列データを順次入力して、色毎
に交互のランレングス値数列を出力する場合を例に説明
するものである。表形式の部分において、“段階”欄は
復号のステップを“Y1”より“Y14”までのステッ
プで説明するための記号を示し、“符号入力(16
進)”欄は、該当する段階で入力される符号を16進数
で示し、“L”欄はランレングス数値を表わし、“N”
欄は各時点における反復数の一時記憶Nの値を表わし、
“B”欄は各時点における前記一時記憶Bの値を表わ
し、“A”欄は各時点における前記一時記憶Aの値を表
わす。復号が開始されると、A及びBに初期値として
“0”が代入される。次に、段階Y1において、符号
‘D’を読み込み、これはN1符号であるので、Nに該
符号の復号値である“1”を代入する。入力されたのが
反復数であるため、次に、段階Y2において、LにAの
値を代入してランレングス数値として出力し、NをNか
ら“1”減じた値で、AをBの値で、BをLの値で夫々
更新する。Nが“0”となったため、次に、段階Y3に
おいて、符号‘2’を読み込み、これはL1符号である
ので、Lに該符号の復号値である“3”を代入してラン
レングス数値として出力し、AをBの値で、BをLの値
で夫々更新する。FIG. 12 is a diagram for explaining an example of data decoding operation. An example will be described in which code string data output as a result of the encoding operation example shown in FIG. 12 is sequentially input, and an alternate run-length value sequence is output for each color. In the tabular form, the “stage” column shows a symbol for describing the decoding step by steps from “Y1” to “Y14”, and “code input (16
Column) shows the code inputted at the corresponding stage in hexadecimal, the column "L" shows the run length numerical value, and the column "N"
The column represents the value of the temporary storage N of the number of iterations at each time point,
The “B” column represents the value of the temporary storage B at each time point, and the “A” column represents the value of the temporary storage A at each time point. When decoding is started, “0” is substituted into A and B as initial values. Next, in step Y1, the code 'D' is read, and since this is an N1 code, "1" which is a decoded value of the code is substituted for N. Since the input is the number of repetitions, the value of A is substituted into L and output as a run-length numerical value in step Y2, and N is subtracted from N by "1". And B is updated with the value of L. Since N has become "0", next, in step Y3, code "2" is read. Since this is an L1 code, "3" which is the decoded value of the code is substituted for L, and the run-length numerical value is obtained. And updates A with the value of B and B with the value of L, respectively.
【0047】次に、段階Y4において、符号‘BE’を
読み込み、これはL2符号であるので、Lに該符号の復
号値である“41”を代入してランレングス数値として
出力し、AをBの値で、BをLの値で夫々更新する。次
に、段階Y5において、符号‘F9’を読み込み、これ
はN3符号であるので、Nに該符号の復号値である
“5”を代入する。次に、段階Y6より段階Y10にお
いて、LにAの値を代入してランレングス数値として出
力し、NをNから“1”減じた値で、AをBの値で、B
をLの値で夫々更新する段階を、Nが“0”となるまで
計5回分繰り返す。次に、段階Y11において、符号
‘C02E’を読み込み、これはL3符号であるので、
Lに該符号の復号値である“443”を代入してランレ
ングス数値として出力し、AをBの値で、BをLの値で
夫々更新する。入力されたのが反復数であるため、次
に、段階Y12において、符号‘E’を読み込み、これ
はN2符号であるので、Nに該符号の復号値である
“2”を代入する。入力されたのが反復数であるため、
次に、段階Y13より段階Y14において、LにAの値
を代入してランレングス数値として出力し、NをNから
“1”減じた値で、AをBの値で、BをLの値で夫々更
新する段階を、Nが“0”となるまで計2回分繰り返
す。表の“L”欄を見れば明らかに、以上の動作によ
り、図12の例で符号化処理に入力された計11個のラ
ンレングス数値が順次復号されていることがわかる。Next, in step Y4, the code 'BE' is read, and since this is an L2 code, the decoded value of the code "41" is substituted for L and output as a run-length value, and A is output. With the value of B, B is updated with the value of L, respectively. Next, at step Y5, the code 'F9' is read, and since this is an N3 code, “5” which is the decoded value of the code is substituted for N. Next, in steps Y6 to Y10, the value of A is substituted for L and output as a run length numerical value.
Is updated with the value of L for a total of five times until N becomes “0”. Next, in step Y11, the code 'C02E' is read, and since this is an L3 code,
Substitute “443”, which is the decoded value of the code, into L, and output it as a run-length numerical value. Since the input is the number of repetitions, next, in step Y12, the code 'E' is read. Since this is an N2 code, "2" which is the decoded value of the code is substituted for N. Since the input is the number of iterations,
Next, in steps Y13 to Y14, the value of A is substituted into L and output as a run-length numerical value. N is a value obtained by subtracting "1" from N, A is the value of B, and B is the value of L. Are repeated two times in total until N becomes "0". It is apparent from the "L" column of the table that, by the above operation, a total of 11 run-length numerical values input to the encoding processing in the example of FIG. 12 are sequentially decoded.
【0048】[0048]
【発明の効果】本発明は、以上説明したように構成され
ているので、請求項1によれば、生成される符号数を削
減し、コンピュータ処理による擬似中間調画像のように
色が短い周期で頻繁に変化するような画像データに対し
ても十分に高い圧縮率を得ることできる符号化方法を提
供することができた。請求項2によれば、記制御をマイ
クロプロセッサによるソフトウェア処理で行うことによ
って十分高い処理速度を期待することが可能となるよ
う、代入、加算、及び、比較・分岐といった簡素な制御
で実現することができる符号化方法を提供することがで
きた。請求項3によれば、前記制御をマイクロプロセッ
サによるソフトウェア処理で行っても十分高い処理速度
を期待することが可能となるよう、色に基づく判断・分
岐が不要で、且つ、代入、及び、比較・分岐といった簡
素な制御で実現する画像データの符号化方法を提供する
ことができた。請求項4によれば、ランレングス数値が
0であることを表現する符号を不要とし、従って、より
高い圧縮率を有する符号セットを利用可能とする符号化
方法を提供することができた。According to the present invention, as described above, according to the first aspect, the number of codes to be generated is reduced, and the period in which colors are short, such as a pseudo halftone image obtained by computer processing, is reduced. Thus, it was possible to provide an encoding method capable of obtaining a sufficiently high compression ratio even for image data that frequently changes. According to the second aspect, the control is performed by software processing by a microprocessor, so that a sufficiently high processing speed can be expected. Therefore, the control is realized by simple control such as assignment, addition, and comparison / branch. And a coding method that can perform the above. According to the third aspect, judgment and branching based on color are unnecessary, and substitution and comparison are performed so that a sufficiently high processing speed can be expected even if the control is performed by software processing by a microprocessor. -It has been possible to provide an image data encoding method which can be realized by simple control such as branching. According to the fourth aspect, it is possible to provide an encoding method that eliminates the need for a code representing that the run-length value is 0, and thus makes it possible to use a code set having a higher compression ratio.
【0049】請求項5によれば、より高い圧縮率が達成
可能な画像データの符号化装置を提供することができ
た。請求項6によれば、前記制御をマイクロプロセッサ
によるソフトウェア処理で行っても十分高い処理速度を
期待することが可能となるよう代入、減算、及び、比較
・分岐といった簡素な制御で実現でき、処理が単純とな
り極めて高速な画像データの符号化装置を提供すること
ができた。請求項7によれば、極めて高い処理速度を期
待することが可能な画像データの符号化装置を提供する
ことができた。請求項8によれば、種々の場合に適応す
ることが可能な画像データの符号化方法を用いるデータ
記録システムを提供することができた。請求項9によれ
ば、高速で且つ省メモリ対応可能なプリンタを提供する
ことができた。According to the fifth aspect, an image data encoding apparatus capable of achieving a higher compression rate can be provided. According to claim 6, even if the control is performed by software processing by a microprocessor, a simple control such as substitution, subtraction, and comparison / branch can be realized so that a sufficiently high processing speed can be expected. Has been simplified and an extremely high-speed image data encoding apparatus can be provided. According to the seventh aspect, it is possible to provide an image data encoding device that can expect an extremely high processing speed. According to the eighth aspect, a data recording system using an image data encoding method applicable to various cases can be provided. According to the ninth aspect, a high-speed and memory-saving printer can be provided.
【0050】請求項10によれば、迅速で且つ省メモリ
ーが達成できるデータ復号方法を提供することができ
た。請求項11によれば、省メモリーで且つ迅速な画像
データ復号方法を提供できた。請求項12によれば、省
メモリーで且つ迅速な画像データ復号が可能な復号装置
を提供することができた。請求項13によれば、迅速な
データ復号が可能で且つ省メモリーのデータ復号装置を
提供することができた。請求項14によれば、処理速度
の高いデータ処理が可能であるとともにプロセッサに内
在するメモリと兼用することができ、省メモリのデータ
復号装置を提供することができた。請求項15によれ
ば、符号化生成に際して特殊なテーブル参照を必要とせ
ず、それらの処理を代入、加減算、シフト、論理積、及
び、比較・分岐といった簡素な制御で実現できる符号セ
ットを導入するので、該制御をマイクロプロセッサによ
るソフトウェア処理で行っても十分高い処理速度を期待
することが可能な画像データの符号化方法を提供するこ
とができる。更に、導入する各符号は処理を容易にハー
ドウェア化できるよう4ビットまたはその倍数の符号長
を有するものであり、ハードウェア処理とソフトウェア
処理を組み合わせるようにすることで、同一の符号化方
法を幅広い性能レンジに適応させることが可能である画
像データの符号化方法を提供することができた。According to the tenth aspect, it is possible to provide a data decoding method capable of achieving quick and memory saving. According to the eleventh aspect, a memory-saving and quick image data decoding method can be provided. According to the twelfth aspect, it is possible to provide a decoding device capable of quickly decoding image data with a small amount of memory. According to the thirteenth aspect, a data decoding device capable of quick data decoding and saving memory can be provided. According to the fourteenth aspect, it is possible to provide a data decoding device that can perform data processing at a high processing speed and can also be used as a memory inherent in a processor, and save memory. According to the fifteenth aspect, a code set that does not require a special table reference at the time of encoding generation, and that can realize such processing by simple control such as assignment, addition / subtraction, shift, logical product, and comparison / branch is introduced. Therefore, it is possible to provide an image data encoding method that can expect a sufficiently high processing speed even if the control is performed by software processing by a microprocessor. Furthermore, each code to be introduced has a code length of 4 bits or a multiple thereof so that the processing can be easily implemented in hardware. By combining hardware processing and software processing, the same encoding method can be used. An image data encoding method that can be adapted to a wide performance range can be provided.
【0051】請求項16によれば、数値復号に際して特
殊なテーブル参照を必要とせず、それらの処理を代入、
加減算、シフト、論理積、及び、比較・分岐といった簡
素な制御で実現できる符号セットを導入するので、該制
御をマイクロプロセッサによるソフトウェア処理で行っ
ても十分高い処理速度を期待することが可能な画像デー
タの復号方法を提供することができる。更に、導入する
各符号は処理を容易にハードウェア化できるよう4ビッ
トまたはその倍数の符号長を有するものであり、ハード
ウェア処理とソフトウェア処理を組み合わせるようにす
ることで、同一の復号方法を幅広い性能レンジに適応さ
せることが可能である画像データの復号方法を提供する
ことができた。請求項17によれば、画像の符号化にお
いて極めて効率的なデータ処理が行える画像データ符号
化装置が提供することができた。請求項18によれば、
画像の復号において極めて効率的なデータ処理が行える
画像データ復号装置が提供することができた。請求項1
9によれば、擬似中間調のような色の交番の激しい画像
にも適切に対応できる画像データ記録システムを提供す
ることができた。請求項20によれば、擬似中間調のよ
うな色の交番の激しい画像にも適切に対応できる画像形
成装置が提供できた。請求項21、22によれば、該記
録媒体を利用することでコンピュータによってプログラ
ムを読み取り可能とし、プログラムを実行することがで
きた。According to the sixteenth aspect, there is no need to refer to a special table at the time of numerical decoding, and these processes are substituted.
A code set that can be realized by simple control such as addition, subtraction, shift, logical product, and comparison / branch is introduced. A method for decoding data can be provided. Furthermore, each code to be introduced has a code length of 4 bits or a multiple thereof so that the processing can be easily implemented in hardware. By combining hardware processing and software processing, the same decoding method can be widely used. A method for decoding image data that can be adapted to the performance range can be provided. According to the seventeenth aspect, an image data encoding device capable of performing extremely efficient data processing in image encoding can be provided. According to claim 18,
An image data decoding device capable of performing extremely efficient data processing in image decoding can be provided. Claim 1
According to No. 9, it was possible to provide an image data recording system capable of appropriately coping with an image having a violent alternation of colors such as a pseudo halftone. According to the twentieth aspect, it is possible to provide an image forming apparatus that can appropriately cope with an image having a violent alternation of colors such as a pseudo halftone. According to claims 21 and 22, the program can be read by a computer by using the recording medium, and the program can be executed.
【図1】本発明の基本的な原理を説明するための説明図
である。FIG. 1 is an explanatory diagram for explaining a basic principle of the present invention.
【図2】本発明による符号化装置及び復号装置を画像形
成装置に適用した一実施例を示す構成図である。FIG. 2 is a configuration diagram illustrating an embodiment in which an encoding device and a decoding device according to the present invention are applied to an image forming apparatus.
【図3】(a)及び(b)は本発明の符号化装置及び復
号装置を示す説明図である。FIGS. 3A and 3B are explanatory diagrams showing an encoding device and a decoding device of the present invention.
【図4】本発明による符号化方法の一実施例を示すフロ
ーチャート図である。FIG. 4 is a flowchart illustrating an embodiment of an encoding method according to the present invention.
【図5】本発明による復号方法の一実施例を示すフロー
チャート図である。FIG. 5 is a flowchart illustrating an embodiment of a decoding method according to the present invention.
【図6】本発明の符号化・復号方法に用いる符号セット
の一実施例を示す図である。FIG. 6 is a diagram showing one embodiment of a code set used in the encoding / decoding method of the present invention.
【図7】本発明の、事象Qに呼応してランレングス符号
を生成する制御の実施例を示すフローチャート図であ
る。FIG. 7 is a flowchart illustrating an embodiment of control for generating a run-length code in response to an event Q according to the present invention.
【図8】本発明の、事象Pまたは事象Pの連続に呼応し
て前記反復数に対応するN符号を生成する制御の実施例
を示すフローチャート図である。FIG. 8 is a flowchart showing an embodiment of control for generating an N code corresponding to the number of repetitions in response to an event P or a continuation of the event P according to the present invention.
【図9】本発明に係る符号化方法により生成された符号
列データから一個の符号単位を入力し、ランレングス数
値または反復数値に復号する制御の実施例を示すフロー
チャート図である。FIG. 9 is a flowchart illustrating an example of control for inputting one code unit from code string data generated by the encoding method according to the present invention and decoding the code unit into a run-length numerical value or a repetitive numerical value.
【図10】本発明による符号化の動作例を説明するため
の説明図である。FIG. 10 is an explanatory diagram illustrating an operation example of encoding according to the present invention.
【図11】本発明によるL3符号生成の動作例を説明す
るための説明図である。FIG. 11 is an explanatory diagram illustrating an operation example of L3 code generation according to the present invention.
【図12】本発明によるデータ復号の動作例を説明する
ための説明図である。FIG. 12 is an explanatory diagram illustrating an operation example of data decoding according to the present invention.
1 プリンタ装置、2 ホストマシーン、3 ホストI
/F、4 コントローラー、5 オペレーショナルパネ
ル、6 パネルI/F、7 フォントROM、8NV−
RAM、9 オプションRAM、10 エンジンI/
F、11 プリンタエンジン、12 入力装置、13
記録媒体、14 プログラムROM、15RAM、16
CPU、17 符号化装置、18 復号装置、19
ランレングス記憶手段A、20 ランレングス記憶手段
B、21 ランレングス記憶手段L、22 判別手段、
23 反復数記憶・演算手段、24 ランレングス符号
生成手段、25 反復数符号生成手段、26 符号化手
段、27 復号数値・属性判別記憶手段、28 復号手
段、29 ランレングス数値生成手段1 printer device, 2 host machine, 3 host I
/ F, 4 controllers, 5 operational panels, 6 panel I / F, 7 font ROM, 8NV-
RAM, 9 optional RAM, 10 engine I /
F, 11 printer engine, 12 input device, 13
Recording medium, 14 program ROM, 15 RAM, 16
CPU, 17 encoding device, 18 decoding device, 19
Run-length storage means A, 20 run-length storage means B, 21 run-length storage means L, 22 discriminating means,
23 repetition number storage / operation means, 24 run length code generation means, 25 repetition number code generation means, 26 encoding means, 27 decoded numerical value / attribute determination storage means, 28 decoding means, 29 run length numerical value generation means
Claims (22)
ランレングス数値列を入力し、所定の符号列に変換して
出力する符号化方法であって、 所定のランレングス数値を入力した時に前記ランレング
ス数値の値が同色の直前のランレングス数値に一致する
場合を一致事象と設定すると共に一致しない事象を不一
致事象と設定し、一致事象が連続する数を反復数と設定
し、前記一致事象または一致事象の連続が発生した場合
には前記反復数に対応する反復数符号を生成し、前記不
一致事象が発生した場合には前記ランレングス数値の値
を示す符号を生成することを特徴とするデータ符号化方
法。An encoding method for inputting an alternate run-length numerical sequence for each color obtained by scanning data, converting the run-length numerical sequence into a predetermined code sequence, and outputting the code sequence, wherein a predetermined run-length numerical value is input. At times, the case where the value of the run-length value matches the immediately preceding run-length value of the same color is set as a coincidence event, and an event that does not match is set as a non-match event, and the number of consecutive matching events is set as the number of repetitions. When a coincidence event or a series of coincidence events occurs, a repetition number code corresponding to the repetition number is generated, and when the mismatch event occurs, a code indicating the value of the run-length numerical value is generated. Data encoding method.
して前記反復数に対応する符号を生成し、前記不一致事
象に対して前記ランレングス数値の値を示す符号を生成
するための制御内容には、前記反復数を記憶するための
反復数記憶手段に初期値を格納する初期化段階と、前記
一致事象の発生に対応して前記反復数記憶手段に格納さ
れた前記反復数の値を増加させる増加段階と、該時点に
おける前記不一致事象の発生に対応して前記反復数記憶
手段に格納された前記反復数の値が初期値でない場合に
は、前記反復数の値を示す符号を出力した後に前記反復
数記憶手段に格納された前記反復数の値を初期値に戻
し、前記反復数が初期値である時点で前記ランレングス
数値の値を示す符号を生成する符号生成段階と、対象デ
ータの符号化が終了するまで、前記増加段階および前記
符号生成段階を繰り返す繰り返し段階と、符号化の対象
となるデータの符号化が終了した時点で、前記反復数の
値が初期値でない場合には、前記反復数の値を示す符号
を出力する符号出力段階とを有することを特徴とする請
求項1に記載のデータ符号化方法。2. A control content for generating a code corresponding to the number of repetitions for the coincidence event or a series of coincidence events, and generating a code indicating the value of the run-length numerical value for the mismatch event. Comprises an initialization step of storing an initial value in a repetition number storage means for storing the repetition number, and increasing a value of the repetition number stored in the repetition number storage means in response to the occurrence of the coincidence event. If the value of the number of repetitions stored in the number of repetitions stored in the number-of-repetitions storage unit is not an initial value in response to the occurrence of the mismatch event at that time, a code indicating the value of the number of repetitions is output. A code generation step of returning the value of the number of repetitions stored in the number-of-repetitions storage unit to an initial value, and generating a code indicating the value of the run-length numerical value when the number of repetitions is the initial value; Encoding of Until the repetition step of repeating the increasing step and the code generation step, and when the coding of the data to be coded is completed, if the value of the number of repetitions is not the initial value, A code output step of outputting a code indicating a value.
制御は、色数分のランレングス数値を記憶・参照するた
めのランレングス値記憶手段A及びランレングス値記憶
手段Lに所定の初期値を格納する初期化段階と、所定の
前記ランレングス数値が前記各ランレングス値記憶手段
Lに入力された時点で、前記ランレングス数値と前記ラ
ンレングス値記憶手段Aに格納された値とが一致する場
合が一致事象であり、一致しない場合が不一致事象であ
ると識別する識別段階と、前記識別段階の後、次のラン
レングス値入力より以前の時点において、前記ランレン
グス値記憶手段Aに前記ランレングス値記憶手段Lの値
を格納した後、前記ランレングス値記憶手段Lに前記所
定のランレングス数値の値を格納する段階とを備えたこ
とを特徴とする請求項1または請求項2に記載のデータ
符号化方法。3. The control for discriminating a coincidence event and a non-coincidence event is performed by storing a predetermined initial value in a run-length value storage unit A and a run-length value storage unit L for storing and referring to run-length numerical values for the number of colors. At the initialization stage for storing, and when the predetermined run-length value is input to each of the run-length value storage means L, the run-length value matches the value stored in the run-length value storage means A. An identification step for identifying a case as a coincidence event and a non-coincidence as a non-coincidence event. After the identification step, the run-length value is stored in the run-length value storage means A at a time before the next run-length value input. Storing the value of the predetermined run length numerical value in the run length value storing means L after storing the value of the length value storing means L. The data encoding method according to claim 1 or 2.
制御の初期化段階において、前記ランレングス値記憶手
段Aにランレングスの測定を開始するときの対象色とは
異なる色で始まる場合を意味する初期値を設定すること
を特徴とする請求項3に記載のデータ符号化方法。4. In the initialization stage of the control for identifying the coincidence event and the non-coincidence event, the run-length value storage means A starts with a color different from the target color when the run-length measurement is started. 4. The data encoding method according to claim 3, wherein an initial value is set.
ランレングス数値列を入力し、所定の符号列に変換して
出力する符号化装置であって、 所定のランレングス数値を入力し記憶するランレングス
値記憶手段Lと、前記ランレングス数値と同色の直前の
ランレングス数値を記憶するランレングス値記憶手段A
と、前記ランレングス数値の値が同色の直前のランレン
グス数値に一致するか否かを判別する判別手段と、前記
ランレングス数値の値が同色の直前のランレングス値に
一致する場合に該一致が反復する反復数を記憶する反復
数記憶手段と、前記反復数を示す符号を生成する反復数
符号生成手段と、前記ランレングス数値の値が同色の直
前のランレングス値に一致しない場合には前記ランレン
グス数値の値を示す符号を生成するランレングス符号生
成手段とを具備することを特徴とするデータ符号化装
置。5. An encoding device for inputting an alternate run-length numerical sequence for each color obtained by scanning data, converting the run-length numerical sequence into a predetermined code sequence, and outputting the code sequence. A run length value storage means L for storing the run length value, and a run length value storage means A for storing the immediately preceding run length value of the same color as the run length value
Determining means for determining whether or not the value of the run-length value matches the immediately preceding run-length value of the same color; and determining whether the value of the run-length value matches the immediately preceding run-length value of the same color. A repetition number storage means for storing the number of repetitions to be repeated, a repetition number code generating means for generating a code indicating the number of repetitions, and if the value of the run length value does not match the immediately preceding run length value of the same color, A data encoding apparatus comprising: run length code generation means for generating a code indicating the value of the run length numerical value.
グス数値の値を示す符号を生成し、前記一致事象または
一致事象の連続に対応する前記反復数に対応して符号を
生成するデータ符号化装置であって、 反復数を記憶する反復数記憶手段と、前記一致事象の発
生のたびに前記反復数の値を増加させる反復数演算手段
と、前記不一致事象の発生に際し、該不一致事象の発生
時点における前記反復数の値が初期値でない場合には、
前記反復数の値を示す符号を出力した後に反復数の値を
初期値に戻し、反復数が初期値である時点で前記ランレ
ングス数値の値を示す符号を生成するランレングス符号
生成手段と、符号化の対象となるデータの符号化が終了
するまで前記各手段の動作を繰り返す制御を行う制御手
段と、対象データの符号化が終了となった時点で前記反
復数の値が初期値でない場合に、前記反復数の値を示す
符号を出力する反復数符号生成手段とを備えたことを特
徴とする請求項5記載のデータ符号化装置。6. Data encoding for generating a code indicating the value of the run-length numerical value corresponding to the mismatch event, and generating a code corresponding to the number of repetitions corresponding to the matching event or a series of matching events. An apparatus, comprising: a repetition number storage means for storing a repetition number; a repetition number calculation means for increasing a value of the repetition number each time the coincidence event occurs; and an occurrence of the mismatch event when the mismatch event occurs If the value of the number of iterations at the time is not the initial value,
A run-length code generation unit that returns a value of the number of repetitions to an initial value after outputting a code indicating the value of the number of repetitions, and generates a code indicating the value of the run-length value at the time when the number of repetitions is the initial value. A control unit for performing control to repeat the operation of each unit until the encoding of the data to be encoded is completed, and a case where the value of the number of repetitions is not the initial value at the time when the encoding of the target data is completed. 6. The data encoding apparatus according to claim 5, further comprising: a repetition number code generation unit that outputs a code indicating the value of the repetition number.
ランレングス値記憶手段Lと、前記ランレングス数値と
同色の直前のランレングス数値を記憶するランレングス
値記憶手段Aと、反復数を記憶する反復数記憶手段と
は、マイクロプロセッサの汎用レジスタにより構成され
ることを特徴とする請求項5または6に記載のデータ符
号化装置。7. A run length value storage means L for inputting and storing the run length value, a run length value storage means A for storing a run length value immediately before the same color as the run length value, and a repetition number. 7. The data encoding device according to claim 5, wherein the repetition number storage means is constituted by a general-purpose register of a microprocessor.
に記載されたデータ符号化方法を画像形成装置に適用し
たことを特徴とする画像データ記録システム。8. An image data recording system, wherein the data encoding method according to any one of claims 1 to 4 is applied to an image forming apparatus.
プリンタであることを特徴とする画像データ記録システ
ム。9. An image forming apparatus according to claim 8,
An image data recording system, being a printer.
項に記載のデータ符号化方法を用いて生成された符号列
データを走査して得られる符号列を入力し、色毎に交互
のランレングス数値列に復号して出力するデータ復号方
法であって、入力した符号列が前記ランレングス符号生
成手段により生成された符号である場合には、前記符号
が表わすランレングス数値を出力し、入力した符号列が
前記反復数符号生成手段により生成された符号である場
合には、同色の直前のランレングス数値を反復数符号が
表わす反復数の個数分出力することを特徴とするデータ
復号方法。10. The method according to claim 1, wherein:
A data decoding method for inputting a code string obtained by scanning code string data generated using the data encoding method described in the section, decoding the data into an alternate run-length numerical string for each color, and outputting the decoded data. If the input code string is a code generated by the run-length code generation means, a run-length value represented by the code is output, and the input code string is generated by the repetition number code generation means. In the data decoding method, the run-length numerical value immediately before the same color is output for the number of repetitions represented by the repetition number code.
おいて、色数分のランレングス数値を記憶・参照するた
めの複号側ランレングス値記憶手段A及び復号側ランレ
ングス値記憶手段Lに符号化時と同じ初期値を格納する
初期化段階と、所定の符号を入力・復号して前記符号が
示す数値とその属性を得る段階と、前記符号が示す数値
の属性が前記ランレングス符号である場合には、前記符
号が示す数値をランレングス数値として出力し、前記複
号側ランレングス値記憶手段Aに前記復号側ランレング
ス値記憶手段Lの内容を格納した後、前記復号側ランレ
ングス値記憶手段Lに前記ランレングス数値を格納する
段階と、前記符号が示す数値の属性が前記反復符号であ
る場合には、前記反復数を記憶・参照するための反復数
記憶手段に前記反復数の値を格納し、前記反復数の値が
初期値となるまで、前記複号側ランレングス値記憶手段
Aに記憶された数値をランレングス数値として出力し、
前記複号側ランレングス値記憶手段Aに前記復号側ラン
レングス値記憶手段Lに記憶された値を格納した後、前
記復号側ランレングス値記憶手段Lに前記ランレングス
数値または前記複号側ランレングス値記憶手段Aに記憶
された値を格納し、前記反復数記憶手段に記憶された値
を所定値減じる処理を繰り返す段階と、復号化の対象と
なる符号列のデータが終了するまで、前記所定の符号単
位を入力・復号して前記符号が示す数値とその属性を得
る段階から前記反復数の値を所定値減じる処理を繰り返
す段階までを繰り返す段階とを有することを特徴とする
データ復号方法。11. The data decoding method according to claim 10, wherein the decoding side run length value storage means A and the decoding side run length value storage means L for storing and referring to the run length numerical values for the number of colors. An initialization step of storing the same initial value as at the time of initialization, a step of inputting / decoding a predetermined code to obtain a numerical value indicated by the code and its attribute, and the attribute of the numerical value indicated by the code is the run-length code. In this case, the numerical value indicated by the code is output as a run-length numerical value, and the contents of the decoding-side run-length value storing means L are stored in the decoding-side run-length value storing means A. Storing the run length numerical value in the storage means L; and, if the attribute of the numerical value indicated by the code is the repetition code, storing the run number in the repetition number storage means for storing and referring to the repetition number. Until the value of the number of iterations becomes the initial value, and outputs the numerical value stored in the decoding side run-length value storage means A as a run-length numerical value;
After storing the value stored in the decoding-side run-length value storage unit L in the decoding-side run-length value storage unit A, the run-length value or the decoding-side run is stored in the decoding-side run-length value storage unit L. Storing the value stored in the length value storage means A and repeating the process of reducing the value stored in the repetition number storage means by a predetermined value; and until the data of the code string to be decoded ends, A data decoding method comprising: a step of inputting and decoding a predetermined code unit to obtain a numerical value indicated by the code and its attribute, and a step of repeating a process of reducing the value of the number of repetitions by a predetermined value. .
用いたデータ復号装置であって、 入力した符号列を符号単位毎に記憶する符号列記憶手段
と、前記符号単位の符号が前記ランレングス符号である
場合には、前記ランレングス符号が表わすランレングス
数値を生成するランレングス値生成手段と、入力した符
号単位が前記反復数符号である場合には、前記複号側ラ
ンレングス値記憶手段Aに記憶された同色の直前のラン
レングス数値を前記符号が表わす反復数の個数分出力す
るランレングス値出力手段とを備えたことを特徴とする
データ復号装置。12. A data decoding apparatus using the data decoding method according to claim 11, wherein code string storage means for storing an input code string for each code unit, and wherein the code of the code unit is the run-length code. A run length value generating means for generating a run length numerical value represented by the run length code when the code is a code; and a run length value storing means for decoding when the input code unit is the repetition number code. A data decoding apparatus comprising: run-length value output means for outputting the run-length numerical value immediately before the same color stored in A for the number of repetitions represented by the code.
おいて、色数分のランレングス数値を記憶・参照するた
めの前記複号側ランレングス値記憶手段A及び復号側ラ
ンレングス値記憶手段Lと、所定の符号単位を入力・復
号して前記符号が示す数値とその属性を得る復号数値・
属性判別手段と、前記復号数値・属性判別手段にて復号
された数値の属性が前記ランレングス符号である場合に
は、前記数値をランレングス数値として出力し、前記復
号数値・属性判別手段にて復号された数値の属性が前記
反復数符号である場合には、前記反復数の値が初期値と
なるまで、前記複号側ランレングス値記憶手段Aに記憶
された値をランレングス数値として出力するランレング
ス値生成手段と、前記復号数値・属性判別手段にて復号
された数値の属性が前記反復数符号である場合には、前
記数値を格納し記憶する復号側反復数記憶手段と、前記
復号側反復数記憶手段に記憶された反復数の値を減じる
処理を反復数に対応して繰り返す反復数演算手段と、前
記各記憶手段に符号化時と同じ初期値を格納する制御、
前記複号側ランレングス値記憶手段Aに前記復号側ラン
レングス値記憶手段Lに記憶された値を格納させた後に
前記復号側ランレングス値記憶手段Lに前記ランレング
ス数値または前記複号側ランレングス値記憶手段Aに記
憶された値を格納させる制御、復号化の対象となる符号
列のデータが終了するまで前記反復数演算手段に繰り返
し動作させる制御を行う制御手段とを備えたことを特徴
とするデータ復号装置。13. The data decoding apparatus according to claim 12, wherein said decoding-side run-length value storage means A and said decoding-side run-length value storage means L for storing and referring to run-length numerical values for the number of colors. , A decoded numerical value obtained by inputting and decoding a predetermined code unit to obtain a numerical value indicated by the code and its attribute
When the attribute of the numerical value decoded by the attribute discriminating means and the decoded numerical value / attribute discriminating means is the run-length code, the numerical value is output as a run-length numerical value. If the attribute of the decoded numerical value is the repetition number code, the value stored in the decoding side run length value storage means A is output as a run length numerical value until the value of the repetition number becomes an initial value. A run-length value generating unit that performs decoding, if the attribute of the numerical value decoded by the decoded numerical value / attribute determining unit is the repetition number code, a decoding-side repetition number storage unit that stores and stores the numerical value; A repetition number calculating means for repeating the process of reducing the value of the repetition number stored in the decoding side repetition number storage means in accordance with the repetition number, and control for storing the same initial value in each of the storage means as at the time of encoding;
After storing the value stored in the decoding-side run-length value storage means L in the decoding-side run-length value storage means A, the run-length value or the decoding-side run is stored in the decoding-side run-length value storage means L. Control means for storing the value stored in the length value storage means A, and control means for controlling the repetition number operation means to repeatedly operate until the data of the code string to be decoded is completed. Data decoding device.
号側ランレングス値記憶手段Lと、前記ランレングス数
値と同色の直前のランレングス数値を記憶する複号側ラ
ンレングス値記憶手段Aと、反復数を記憶する反復数記
憶手段とは、マイクロプロセッサの汎用レジスタにより
構成されることを特徴とする請求項12または13に記
載のデータ復号装置。14. A decoding-side run-length value storage means L for inputting and storing a run-length value, a decoding-side run-length value storage means A for storing the immediately preceding run-length value of the same color as the run-length value, 14. The data decoding apparatus according to claim 12, wherein the number-of-repetitions storage means for storing the number is constituted by a general-purpose register of a microprocessor.
れる第1の符号は、4ビット幅を有し、前記4ビットの
数値が10未満であることにより識別され、前記数値に
1を加算した値がランレングス数値に対応する前記符号
の一形式であり、 第2の符号は8ビット幅を有し、符号列において先行す
る上位4ビットの値が10以上の所定値であることによ
り識別され、下位5ビットの値に11を加算した値がラ
ンレングス数値に対応する前記ランレングス符号の一形
式であり、 第3の符号は少なくとも8ビット幅で4の倍数となるビ
ット幅を有し、符号列において先行する上位4ビットの
値が10以上の所定値であることにより識別され、該4
ビットに続く各4ビットについて、その4ビットの値に
おいて8以上の数値が検出されるまで各4ビットの下位
3ビットを上位に向かって連接した数値に43を加算し
た値がランレングス数値に対応する前記符号の一形式で
あり、 第4の符号は4ビット幅を有し、該4ビットの数値が1
0以上の所定値であることにより識別され、前記反復数
が1であることに対応する前記符号の一形式であり、 第5の符号は4ビット幅を有し、該4ビットの数値が1
0以上の所定値であることにより識別され、前記反復数
が2であることに対応する前記符号の一形式であり、 第6の符号は少なくとも8ビット幅で4の倍数となるビ
ット幅を有し、符号列において先行する上位4ビットの
値が10以上の所定値であることにより識別され、該4
ビットに続く各4ビットについて、その4ビットの値に
おいて8以上の数値が検出されるまで各4ビットの下位
3ビットを上位に向かって連接した数値に4を加算した
値が前記反復数に対応する前記反復数符号の一形式であ
ることを特徴とする請求項1から請求項4までの何れか
1項に記載のデータ符号化方法。15. The first code encoded by the data encoding method has a 4-bit width, is identified by the fact that the 4-bit value is less than 10, and adds 1 to the value. The value is a form of the code corresponding to the run-length numerical value, and the second code has an 8-bit width, and is identified by the value of the preceding upper 4 bits in the code string being a predetermined value of 10 or more. A value obtained by adding 11 to the value of the lower 5 bits is a form of the run-length code corresponding to the run-length numerical value, and the third code has a bit width of at least 8 bits and a multiple of 4; The leading 4 bits in the code string are identified by being a predetermined value of 10 or more.
For each of the 4 bits following the bit, the value obtained by adding 43 to the numerical value obtained by concatenating the lower 3 bits of each 4 bits upwards until the numerical value of 8 or more is detected in the 4-bit value corresponds to the run length numerical value. The fourth code has a 4-bit width, and the 4-bit value is 1
The fifth code has a 4-bit width, and is identified by being a predetermined value equal to or greater than 0, and is a form of the code corresponding to the number of repetitions being 1.
A sixth code is identified by being a predetermined value equal to or greater than 0, and is a form of the code corresponding to the number of repetitions being 2. The sixth code has a bit width of at least 8 bits and a multiple of 4. Then, the value of the preceding upper 4 bits in the code string is identified by being a predetermined value of 10 or more.
For each of the 4 bits following the bit, the value obtained by adding 4 to the number obtained by concatenating the lower 3 bits of each 4 bits upward until a value of 8 or more is detected in the 4-bit value corresponds to the number of repetitions. The data encoding method according to claim 1, wherein the data encoding method is a form of the repetition number code.
第1の符号は4ビット幅を有し、前記4ビットの数値が
10未満であることにより識別され、前記数値に1を加
算した値がランレングス数値に対応する前記符号の一形
式であり、 第2の符号は8ビット幅を有し、符号列において先行す
る上位4ビットの値が10以上の所定値であることによ
り識別され、下位5ビットの値に11を加算した値がラ
ンレングス数値に対応する前記ランレングス符号の一形
式であり、 第3の符号は少なくとも8ビット幅で4の倍数となるビ
ット幅を有し、符号列において先行する上位4ビットの
値が10以上の所定値であることにより識別され、該4
ビットに続く各4ビットについて、その4ビットの値に
おいて8以上の数値が検出されるまで各4ビットの下位
3ビットを上位に向かって連接した数値に43を加算し
た値がランレングス数値に対応する前記符号の一形式で
あり、 第4の符号は4ビット幅を有し、該4ビットの数値が1
0以上の所定値であることにより識別され、前記反復数
が1であることに対応する前記符号の一形式であり、 第5の符号は4ビット幅を有し、該4ビットの数値が1
0以上の所定値であることにより識別され、前記反復数
が2であることに対応する前記符号の一形式であり、 第6の符号は少なくとも8ビット幅で4の倍数となるビ
ット幅を有し、符号列において先行する上位4ビットの
値が10以上の所定値であることにより識別され、該4
ビットに続く各4ビットについて、その4ビットの値に
おいて8以上の数値が検出されるまで各4ビットの下位
3ビットを上位に向かって連接した数値に4を加算した
値が前記反復数に対応する前記反復数符号の一形式であ
ることを特徴とする請求項10または請求項11に記載
のデータ復号方法。16. A first code decoded by the data decoding method has a 4-bit width, is identified by the fact that the 4-bit value is less than 10, and a value obtained by adding 1 to the value is a run-time value. A second code having a width of 8 bits, identified by a value of the preceding upper 4 bits in the code string being a predetermined value of 10 or more, and A value obtained by adding 11 to the value of the bit is one form of the run-length code corresponding to the run-length numerical value. The third code has a bit width of at least 8 bits and a multiple of 4, and It is identified that the value of the preceding upper 4 bits is a predetermined value of 10 or more.
For each of the 4 bits following the bit, the value obtained by adding 43 to the numerical value obtained by concatenating the lower 3 bits of each 4 bits upwards until the numerical value of 8 or more is detected in the 4-bit value corresponds to the run length numerical value. The fourth code has a 4-bit width, and the 4-bit value is 1
The fifth code has a 4-bit width, and is identified by being a predetermined value equal to or greater than 0, and is a form of the code corresponding to the number of repetitions being 1.
A sixth code is identified by being a predetermined value equal to or greater than 0, and is a form of the code corresponding to the number of repetitions being 2. The sixth code has a bit width of at least 8 bits and a multiple of 4. Then, the value of the preceding upper 4 bits in the code string is identified by being a predetermined value of 10 or more.
For each of the 4 bits following the bit, the value obtained by adding 4 to the number obtained by concatenating the lower 3 bits of each 4 bits upward until a value of 8 or more is detected in the 4-bit value corresponds to the number of repetitions. 12. The data decoding method according to claim 10, wherein the repetition number code is in one form.
生成する符号化手段を備えたことを特徴とする請求項5
または6に記載のデータ符号化装置。17. The apparatus according to claim 5, further comprising: an encoding unit configured to generate the first to sixth codes.
Or the data encoding device according to 6.
復号する復号手段を備えたことを特徴とする請求項12
または13に記載のデータ復号装置。18. The apparatus according to claim 12, further comprising decoding means for decoding the first to sixth codes.
Or the data decoding device according to 13.
15の何れか1項に記載されたデータ復号方法を画像形
成装置に適用したことを特徴とする画像データ記録シス
テム。19. An image data recording system, wherein the data decoding method according to any one of claims 10, 11, and 15 is applied to an image forming apparatus.
はプリンタであることを特徴とする画像データ記録シス
テム。20. An image data recording system according to claim 19, wherein the image forming apparatus is a printer.
15の何れか1項に記載されたデータ符号化方法をコン
ピュータに実行させるプログラムを記録したことを特徴
とするコンピュータ読み取り可能な記録媒体。21. A computer-readable recording medium on which a program for causing a computer to execute the data encoding method according to claim 1 is recorded. .
17の何れか1項に記載されたデータ復号方法をコンピ
ュータに実行させるプログラムを記録したことを特徴と
するコンピュータ読み取り可能な記録媒体。22. A computer-readable recording medium storing a program for causing a computer to execute the data decoding method according to claim 10. Description:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP01247999A JP3842914B2 (en) | 1999-01-20 | 1999-01-20 | Data encoding method / decoding method, data encoding device / decoding device, and image data recording system using the data encoding method / decoding method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP01247999A JP3842914B2 (en) | 1999-01-20 | 1999-01-20 | Data encoding method / decoding method, data encoding device / decoding device, and image data recording system using the data encoding method / decoding method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2000217005A true JP2000217005A (en) | 2000-08-04 |
JP3842914B2 JP3842914B2 (en) | 2006-11-08 |
Family
ID=11806537
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP01247999A Expired - Fee Related JP3842914B2 (en) | 1999-01-20 | 1999-01-20 | Data encoding method / decoding method, data encoding device / decoding device, and image data recording system using the data encoding method / decoding method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3842914B2 (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6915017B2 (en) | 2001-04-24 | 2005-07-05 | Ricoh Company, Ltd. | Image compression apparatus, image expansion apparatus, image forming apparatus, image compression method, image expansion method and storage medium |
US6941023B2 (en) | 2001-03-21 | 2005-09-06 | Ricoh Company, Ltd. | Image data compression apparatus for compressing both binary image data and multiple value image data |
US7079691B2 (en) | 2000-10-31 | 2006-07-18 | Ricoh Company, Ltd. | Method of and apparatus for encoding, method of and apparatus for decoding, and image forming apparatus |
CN118674565A (en) * | 2024-05-30 | 2024-09-20 | 广东智云城建科技有限公司 | Financial automation management system based on big data |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5081539B2 (en) | 2007-08-31 | 2012-11-28 | 株式会社リコー | Image data encoding apparatus, image data encoding method, image forming apparatus, image forming method, image data decoding apparatus, and image data decoding method |
-
1999
- 1999-01-20 JP JP01247999A patent/JP3842914B2/en not_active Expired - Fee Related
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7079691B2 (en) | 2000-10-31 | 2006-07-18 | Ricoh Company, Ltd. | Method of and apparatus for encoding, method of and apparatus for decoding, and image forming apparatus |
US7359557B2 (en) | 2000-10-31 | 2008-04-15 | Ricoh Company, Ltd. | Method of and apparatus for encoding, method of and apparatus for decoding, and image forming apparatus |
US6941023B2 (en) | 2001-03-21 | 2005-09-06 | Ricoh Company, Ltd. | Image data compression apparatus for compressing both binary image data and multiple value image data |
US7233702B2 (en) | 2001-03-21 | 2007-06-19 | Ricoh Company, Ltd. | Image data compression apparatus for compressing both binary image data and multiple value image data |
US6915017B2 (en) | 2001-04-24 | 2005-07-05 | Ricoh Company, Ltd. | Image compression apparatus, image expansion apparatus, image forming apparatus, image compression method, image expansion method and storage medium |
US7483586B2 (en) | 2001-04-24 | 2009-01-27 | Ricoh Company, Ltd. | Image compression apparatus, image expansion apparatus, image forming apparatus, image compression method, image expansion method and storage medium |
CN118674565A (en) * | 2024-05-30 | 2024-09-20 | 广东智云城建科技有限公司 | Financial automation management system based on big data |
Also Published As
Publication number | Publication date |
---|---|
JP3842914B2 (en) | 2006-11-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2766302B2 (en) | Variable length code parallel decoding method and apparatus | |
JP3505266B2 (en) | Program execution device | |
JPH0366227A (en) | Method and system for compression coding and decoding method | |
JP2000115783A (en) | Decoder and its method | |
JPH114170A (en) | Method and device for double run length-encoding binary data | |
JP3842914B2 (en) | Data encoding method / decoding method, data encoding device / decoding device, and image data recording system using the data encoding method / decoding method | |
JPH05183443A (en) | Code conversion method | |
JP3327650B2 (en) | Recording device | |
JP4009808B2 (en) | Image processing device | |
JPH06217110A (en) | Image converting method | |
JP3676078B2 (en) | Run-length encoding method and compression apparatus | |
JP3753580B2 (en) | Data encoding method, data decoding method, and computer-readable recording medium recording a program for causing a computer to execute the method | |
JP4093200B2 (en) | Data compression method and program, and data restoration method and apparatus | |
JP4093193B2 (en) | Data compression method and program, and data restoration method and apparatus | |
JP2800538B2 (en) | Variable-length bit string processor | |
JP3139460B2 (en) | Method and apparatus for encoding binary document image | |
JP3130721B2 (en) | Binary image compression / expansion processing system and binary image extraction method | |
CN119625087B (en) | JBIG arithmetic coding and decoding method and system | |
JP2729165B2 (en) | Image processing apparatus and processing method thereof | |
JP3708318B2 (en) | Data compression / decompression apparatus and data compression / decompression method | |
JP3255808B2 (en) | Compression / expansion device | |
JPH11112355A (en) | Method and device for encoding and decoding, and image processor applied with same | |
JPH0575874A (en) | Binary data encoding method and decoding method | |
Cena et al. | A Q-Coder algorithm with carry free addition | |
JPH0645945A (en) | Arithmetic coding method and its decoding method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20040715 |
|
RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20040823 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20060728 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20060807 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20060811 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090818 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100818 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100818 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110818 Year of fee payment: 5 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110818 Year of fee payment: 5 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120818 Year of fee payment: 6 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120818 Year of fee payment: 6 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130818 Year of fee payment: 7 |
|
LAPS | Cancellation because of no payment of annual fees |