JPH05236283A - Compression decoding system for picture data - Google Patents

Compression decoding system for picture data

Info

Publication number
JPH05236283A
JPH05236283A JP4035308A JP3530892A JPH05236283A JP H05236283 A JPH05236283 A JP H05236283A JP 4035308 A JP4035308 A JP 4035308A JP 3530892 A JP3530892 A JP 3530892A JP H05236283 A JPH05236283 A JP H05236283A
Authority
JP
Japan
Prior art keywords
data
unit
image data
universal
intermediate data
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
Application number
JP4035308A
Other languages
Japanese (ja)
Other versions
JP3105330B2 (en
Inventor
Hirotaka Chiba
広隆 千葉
Yoshiyuki Okada
佳之 岡田
Yasuhiko Nakano
泰彦 中野
Shigeru Yoshida
茂 吉田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP04035308A priority Critical patent/JP3105330B2/en
Publication of JPH05236283A publication Critical patent/JPH05236283A/en
Application granted granted Critical
Publication of JP3105330B2 publication Critical patent/JP3105330B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PURPOSE:To improve the reliability of processing by judging whether data used for compression/decoding processing are regular data or erroneous data. CONSTITUTION:A picture data compression section 1 is provided with a pre- processing conversion section section 3, an intermediate data latch section 20, a universal coding section 4, a picture element number latch section 2, a counter section 21, and a comparing section 22. A decoding section 5 is provided with a universal decoding section 4A, an intermediate data latch section 20, a post processing conversion section 3A, a counter section 21, a comparing section 22 and a picture element number latch section 2. At picture data compression/ decoding, since the converted intermediate data are latched in the intermediate data latch section 20, a run length of intermediate data is counted by the counter section 21 and it is compared with a value in the picture element number latch section 2 at the comparing section 22 to detect whether or not erroneous data are in use.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、白黒2値の画像データ
を取り扱うファクシミリ装置や各種コンピュータシステ
ムにおいて利用される画像データの圧縮復元方式に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a compression / decompression system for image data used in facsimile machines and various computer systems that handle black and white binary image data.

【0002】近年、OA(オフィスオートメーション)
が発展し、文書が、白黒2値の画像情報として、ファク
シミリや光ディスクファイルシステム等で扱われるよう
になっている。
In recent years, OA (Office Automation)
Has been developed, and documents are handled as binary image information in a facsimile or an optical disk file system.

【0003】文書情報を、ディジタルデータとして利用
する時、画像情報のデータ量は、文字画像に比べ、非常
に大きく10数倍〜数10倍にもなる。従って、蓄積や
伝送等で、画像情報を効率良く扱うには、効率的なデー
タ圧縮を加え、データ量を減らすことが必須となる。
When the document information is used as digital data, the data amount of the image information is much larger than that of the character image and is ten to several tens times. Therefore, in order to handle image information efficiently in storage and transmission, it is essential to add efficient data compression and reduce the data amount.

【0004】[0004]

【従来の技術】図6〜図14は従来例を示した図であ
り、図6はユニバーサル型の説明図(Aはユニバーサル
型のアルゴリズム説明図、Bはユニバーサル型の符号形
式説明図)、図7はLZW符号化処理のフローチャー
ト、図8はLZW復号化処理のフローチャート、図9A
は、LZW符号化の具体的説明図、図9Bは辞書構成例
の説明図、図10はLZW復号化の具体的説明図であ
る。
2. Description of the Related Art FIGS. 6 to 14 are views showing a conventional example, FIG. 6 is an explanatory view of a universal type (A is a universal type algorithm explanatory diagram, B is a universal type code format explanatory diagram), FIG. 7 is a flowchart of LZW encoding processing, FIG. 8 is a flowchart of LZW decoding processing, and FIG. 9A.
Is a specific explanatory diagram of LZW encoding, FIG. 9B is an explanatory diagram of a dictionary configuration example, and FIG. 10 is a specific explanatory diagram of LZW decoding.

【0005】また、図11は圧縮部及び復元部の構成図
(Aは圧縮部の構成図、Bは復元部の構成図)、図12
は圧縮部の構成図、図13は中間データの説明図(Aは
中間データのフォーマット、Bはシフトレジスタ内のデ
ータ、Cは中間データ)、図14は復元部の構成図であ
る。
FIG. 11 is a block diagram of the compression section and the decompression section (A is a block diagram of the compression section, B is a block diagram of the decompression section), and FIG.
13 is a configuration diagram of the compression unit, FIG. 13 is an explanatory diagram of intermediate data (A is an intermediate data format, B is data in a shift register, C is intermediate data), and FIG. 14 is a configuration diagram of the decompression unit.

【0006】図11中、1は圧縮部、2は画素数保持
部、3は前処理変換部、4はユニバーサル符号化部、3
Aは後処理変換部、4Aはユニバーサル復号化部、5は
復元部を示す。
In FIG. 11, 1 is a compression unit, 2 is a pixel number holding unit, 3 is a preprocessing conversion unit, 4 is a universal encoding unit, 3
A is a post-processing conversion unit, 4A is a universal decoding unit, and 5 is a restoration unit.

【0007】また図12中、6はバッファ、7は出力セ
レクタ回路、8はカウンタ、9は否定回路(インバー
タ)、10−1〜10−4はシフトレジスタ、11−1
〜11−4はレジスタ、12−1〜12−4はEOR
(排他的論理和回路)、13はOR(論理和回路)を示
す。
In FIG. 12, 6 is a buffer, 7 is an output selector circuit, 8 is a counter, 9 is a negative circuit (inverter), 10-1 to 10-4 are shift registers, and 11-1.
11-4 are registers, 12-1-12-4 are EOR
(Exclusive OR circuit), 13 indicates OR (OR circuit).

【0008】更に、図14中において14は出力制御
部、15はFIFOのレジスタ、16はカウンタ、17
はレジスタ、18−1〜18−4はシフトレジスタ、1
9はレジスタを示す。
Further, in FIG. 14, 14 is an output control unit, 15 is a FIFO register, 16 is a counter, and 17 is a counter.
Is a register, 18-1 to 18-4 are shift registers, 1
9 indicates a register.

【0009】従来、データ圧縮方式として、ユニバーサ
ル符号化方式が知られていた。このユニバーサル符号化
方式は、情報保存型のデータ圧縮方式であり、データ圧
縮時に、情報源の統計的な性質を予め仮定しないため、
種々のタイプ(文字コード、オブジェクトコ−ド、画像
など、)のデータに適用することができる。
Conventionally, a universal encoding method has been known as a data compression method. This universal encoding method is an information storage type data compression method, and when data is compressed, the statistical properties of the information source are not assumed in advance.
It can be applied to various types of data (character code, object code, image, etc.).

【0010】ここで、ユニバーサル符号について簡単に
説明する。ユニバーサル符号の代表的なものとしては、
ZiV−Lempel(ジブ−レンペル)符号がある。
(詳しくは、例えば、宗像「ZiV−Lempelのデ
ータ圧縮法」、情報処理、VoL、26、No1、19
85年を参照のこと)。
Here, the universal code will be briefly described. A typical universal code is
There is a ZiV-Lempel code.
(For details, see, for example, Munakata “ZiV-Lempel Data Compression Method”, Information Processing, VoL, 26, No 1, 19
See 1985).

【0011】前記ZiV−Lempel符号では、ユニ
バーサル型と増分分解型(Incremental p
arsing)の2つのアルゴリズムが提案されてい
る。以下、前記2つのアルゴリズム及びその改良したア
ルゴリズムについて、簡単に説明する。
In the ZiV-Lempel code, the universal type and the incremental decomposition type (Incremental p
two algorithms have been proposed. The above two algorithms and their improved algorithms will be briefly described below.

【0012】(1) ユニバーサル型のアルゴリズム このアルゴリズムは、演算量は多いが、高圧縮率が得ら
れる。符号化データを、過去のデータ系列の任意の位置
から一致する最大長の系列に区切り(部分列)、過去の
系列の複製として符号化する方式である。以下図面に基
づいて説明する。
(1) Universal type algorithm Although this algorithm has a large amount of calculation, a high compression rate can be obtained. This is a method in which encoded data is separated from an arbitrary position of a past data series into a series of the same maximum length (subsequence) and is encoded as a copy of the past series. A description will be given below with reference to the drawings.

【0013】図6に、ユニバーサル型ZiV−Lemp
el(ジブ−レンペル)符号の符号化部の基本的な構成
を示す。この符号化部の符号化処理では、符号化データ
を、過去のデータ系列の任意の位置から、一致する最大
長の系列に区切り、過去の系列の複製として符号化す
る。
FIG. 6 shows a universal type ZiV-Lemp.
The basic structure of an encoding unit for an el (Jib-Lempel) code is shown. In the encoding process of the encoding unit, the encoded data is divided into a sequence of the maximum length that matches from any position of the past data sequence, and encoded as a copy of the past sequence.

【0014】具体的には、図6のAに示したように、符
号化済みの入力データを格納するPバッファと、これか
ら符号化するデータを格納するQバッファとを備え、Q
バッファのデータ系列と、Pバッファのデータ系列の全
ての部分系列とを照合して、Pバッファ中で一致する最
大長の部分系列を求める。
More specifically, as shown in FIG. 6A, a P buffer for storing coded input data and a Q buffer for storing data to be coded are provided.
The data series of the buffer is collated with all the partial series of the data series of the P buffer, and the partial series of the maximum length that matches in the P buffer is obtained.

【0015】そして、Pバッファ中で、この最大長の部
分系列を指定するために、「その最大長の部分系列の開
始位置」と、「一致する長さ(例えばワード数)」と、
「不一致をもたらしたシンボル(例えば次のワードのデ
ータ)」との組(図6のBに示した情報の組)を符号化
する。
Then, in order to specify this maximum length subsequence in the P buffer, "start position of the maximum length subsequence", "matching length (for example, number of words)",
A set (a set of information shown in B of FIG. 6) with “a symbol that causes a mismatch (for example, data of the next word)” is encoded.

【0016】次に、Qバッファ内の符号化したデータ系
列をPバッファに移して、Qバッファ内に符号化したデ
ータ系列分の新たなデータ系列を入力する。以下、同様
の処理を繰り返していくことで、データを部分系列に分
解して符号化を実行する。
Next, the encoded data sequence in the Q buffer is transferred to the P buffer, and a new data sequence for the encoded data sequence is input in the Q buffer. Hereinafter, by repeating the same processing, the data is decomposed into the partial series and the coding is executed.

【0017】前記ユニバーサル型のアルゴリズムの改良
型として、LZSS符号がある(例えば、T.C.Be
ll、“Better OPM/L Text Com
pression”、IEEE Trans、On C
ommun、VoL、COM−34、No.12、De
c、1986を参照)。
As an improved type of the universal type algorithm, there is an LZSS code (for example, TC Be.
ll, "Better OPM / L Text Com
"pression", IEEE Trans, On C
ommun, VoL, COM-34, No. 12, De
c, 1986).

【0018】前記LZSS符号では、前記Pバッファ中
の最大一致系列の開始位置、一致する長さの組と、次の
シンボルをフラグで区別し、符号量の少ない方で符号化
するものである。
In the LZSS code, the start position of the maximum matching sequence in the P buffer, a set of matching lengths, and the next symbol are distinguished by a flag, and the one with the smaller code amount is coded.

【0019】(2) 増分分解型のアルゴリズム ZiV−Lempel(ジブ−レンペル)符号の増分分
解型のアルゴリズムは、入力データの系列を、増分分解
して符号化するものであり、圧縮率はユニバーサル型よ
り劣るが、シンプルで、計算も容易であることが知られ
ている。
(2) Incremental decomposition type algorithm The ZiV-Lempel (dib-Lempel) code incremental decomposition type algorithm is for incrementally decomposing and coding a series of input data, and has a universal compression rate. It is known to be worse, but simpler and easier to calculate.

【0020】増分分解型のZiV−Lempel符号化
方式では、入力シンボルの系列を、X=aababab
aa・・・とすると、成分系列x=X0X1X2・・・
への増分分解は、次のようにする。
In the incremental decomposition type ZiV-Lempel coding system, a sequence of input symbols is represented by X = aababab.
If aa ..., Component series x = X0X1X2 ...
The incremental decomposition into is as follows.

【0021】Xjを、既成分の右端のシンボルを取り除
いた最長の列とし、X=a・ab・aba・b・aa・
・・となる。従って、X0=λ(空列)、X1=X0
a、X2=X1b、X3=X2a、X4=X0b、X5
=X1a、・・・と分解できる。
Let Xj be the longest sequence from which the rightmost symbols of the existing components have been removed, and X = a.ab.aba.b.aa.
・ ・ It becomes. Therefore, X0 = λ (empty column), X1 = X0
a, X2 = X1b, X3 = X2a, X4 = X0b, X5
= X1a, ...

【0022】増分分解した各成分系列は、既成分系列を
用いて、「成分のインデックス」と、「次のシンボル」
の組で符号化する。即ち、増分分解型のアルゴリズム
は、符号化パターンについて、過去に分解した部分列の
内、最大長一致するものを求め、過去に分解した部分列
の複製として符号化するものである。
For each component series that has been decomposed incrementally, the "component index" and the "next symbol" are used by using the existing component series.
Encoding with a set of. In other words, the incremental decomposition type algorithm finds a coding pattern that has the maximum length match among the previously decomposed partial sequences and encodes it as a copy of the previously decomposed partial sequences.

【0023】また、前記増分分解型のアルゴリズムを改
良したものとして、LZW符号がある。(例えば、T.
A.Welch、“A Technique for
High−Performance Data Com
pression”、Computer、June 1
984参照)。
An LZW code is an improved version of the incremental decomposition type algorithm. (For example, T.
A. Welch, “A Technique for
High-Performance Data Com
compression ”, Computer, June 1
984).

【0024】以下、LZW符号による符号化/復号化処
理について説明する。まずLZW符号化処理は、書き替
え可能な辞書を持ち、入力文字列の中を相異なる文字列
(部分列)に分け、この文字列を出現した順に参照番号
を付けて辞書に登録すると共に、現在入力している文字
列を、辞書に登録してある最長一致文字列の参照番号で
表して符号化するものである。
The encoding / decoding process using the LZW code will be described below. First, the LZW encoding process has a rewritable dictionary, divides the input character string into different character strings (substrings), adds the reference numbers in the order in which they appear, and registers them in the dictionary. The character string currently input is represented by the reference number of the longest matching character string registered in the dictionary and is encoded.

【0025】図9AにLZW符号化の説明図を示すと共
に図10にLZW復号化の説明図を示し、更に図9Bに
符号化及び復号化時に作成される辞書構成例を示す。
尚、図9、10にあっては説明を簡単にするため、ab
cの3文字の組合せからなるデータを圧縮、復元する場
合の例を取り上げている。
FIG. 9A shows an explanatory diagram of LZW encoding, FIG. 10 shows an explanatory diagram of LZW decoding, and FIG. 9B shows an example of a dictionary structure created at the time of encoding and decoding.
It should be noted that in FIGS.
An example of compressing and decompressing data consisting of a combination of three characters c is taken up.

【0026】図7のLZW符号化処理では、まずステッ
プS1で予め辞書に全文字につき一文字からなる文字列
を初期値として登録してから符号化を始める。ステップ
S1の符号化は入力した最初の文字Kにより辞書を検索
して参照番号ωを求め、これを語頭文字列とする。
In the LZW encoding process of FIG. 7, first, in step S1, a character string consisting of one character for all characters is registered in the dictionary in advance as an initial value, and then encoding is started. In the encoding in step S1, the dictionary is searched by the input first character K to obtain the reference number ω, which is used as the initial character string.

【0027】次にステップS2で入力データの次の文字
Kを読込み、ステップS3で文字入力が終了したか否か
チェックした後、ステップS4に進んでステップS1で
求めた語頭文字列ωにステップS2で読込んだ文字Kを
加えた拡張文字列(ωK)が辞書にあるか否か探す。
Next, in step S2, the next character K of the input data is read, and in step S3, it is checked whether or not the character input is completed. Then, the process proceeds to step S4 and the initial character string ω obtained in step S1 It is searched whether or not the extended character string (ωK) to which the character K read in S2 is added is in the dictionary.

【0028】ステップS4で文字列(ωK)が辞書にな
ければ、ステップS6に進んでステップS1で求めた文
字Kの参照番号ωを符号語code(ω)として出力
し、また文字列(ωK)に新たな参照番号を付加して辞
書に登録し、更にステップS2の入力文字Kを参照番号
ωに置き換えると共に辞書アドレスnをインクリメント
してステップS2に戻って次の文字Kを読み込む。
If the character string (ωK) is not found in the dictionary in step S4, the process proceeds to step S6, the reference number ω of the character K obtained in step S1 is output as the code word code (ω), and the character string (ωK) is also output. , A new reference number is added and registered in the dictionary, the input character K in step S2 is replaced with the reference number ω, the dictionary address n is incremented, and the process returns to step S2 to read the next character K.

【0029】一方、ステップS4で文字列(ωK)が辞
書にあればステップS5で文字列(ωK)を参照番号ω
に置き換え、再びステップS2に戻ってステップS4で
文字列(ωK)が辞書から探せなくなるまで最大一致長
の検索を続ける。
On the other hand, if the character string (ωK) is found in the dictionary at step S4, the character string (ωK) is referred to as reference number ω at step S5.
, And returns to step S2 again, and in step S4, the search for the maximum matching length is continued until the character string (ωK) cannot be searched from the dictionary.

【0030】図9を参照してLZW符号化を具体的に説
明すると次のようになる。まず図9Aの入力データin
putは左から右へと読む。最初の文字aを入力した
時、辞書には文字aの他に一致する文字列がないので、
OUTPUT CODE1(参照番号ω)を符号語して
出力する。そして文字aを語頭文字列ωとする。
The LZW encoding will be specifically described with reference to FIG. 9 as follows. First, the input data in in FIG. 9A
Put is read from left to right. When you enter the first letter a, there is no matching string in addition to the letter a in the dictionary, so
The OUTPUT CODE 1 (reference number ω) is coded and output. Then, let the character a be the initial character string ω.

【0031】次に2番目の文字bを入力したとすると、
この入力文字を語頭文字列ωに加えた拡張文字列ωK=
abは辞書にないことから、文字bのOUTPUT C
ODE2を符号語として出力する。そして、拡張文字冊
ωK=abに参照番号4を付けて辞書に登録する。実際
の辞書登録は図9Bの右側に示すように文字列1bとし
て登録される。そして文字bが語頭文字列ωとなる。
Next, if the second character b is input,
Extended character string ωK = which adds this input character to the initial character string ω
Since ab is not in the dictionary, OUTPUT C of the character b
Output ODE2 as a code word. Then, the extended character book ωK = ab is registered with the reference number 4 in the dictionary. The actual dictionary registration is registered as the character string 1b as shown on the right side of FIG. 9B. Then, the character b becomes the initial character string ω.

【0032】続いて3番目の文字aを入力したとする
と、文字bに語頭文字列ωを加えた拡張文字列ωK=b
a=2aは辞書にないことから、文字aのOUTPUT
CODE1を符号語として出力した後、拡張文字列ω
K=baを2aで表わし、参照番号5を付けて辞書に登
録する。そして文字aが新たな語頭文字列ωとなる。
Next, if the third character a is input, an expanded character string ωK = b obtained by adding the initial character string ω to the character b.
Since a = 2a is not in the dictionary, the OUTPUT of the character a
After outputting CODE1 as a code word, the extended character string ω
K = ba is represented by 2a, and the reference number 5 is added to register it in the dictionary. Then, the character a becomes a new initial character string ω.

【0033】4番目の入力文字bについては拡張文字列
ωK=abは1bの符号語4として既に辞書に登録され
ているので、文字列ωKを新たな語頭文字列ωとし、5
番目の文字cを入力して拡張文字列ωK=4c=abc
を作る。この拡張文字列ωK=abcは辞書に登録され
ていないことから、文字列ab=1bのOUTPUTC
ODE4を符号語として出力し、拡張文字列ωK=ab
cを辞書に4cの形で符号語6として登録する。以下同
様に、この処理を続ける。
For the fourth input character b, the extended character string ωK = ab is already registered in the dictionary as the code word 4 of 1b, so the character string ωK is set as a new initial character string ω.
The second character c is input and the extended character string ωK = 4c = abc
make. Since this extended character string ωK = abc is not registered in the dictionary, OUTPUTC of the character string ab = 1b
ODE4 is output as a code word, and the extended character string ωK = ab
c is registered in the dictionary as codeword 6 in the form of 4c. This process is continued in the same manner thereafter.

【0034】図8の復号化処理は図7の符号化の逆の操
作を行う。図8のLZW復号化では、符号化時と同様に
予め辞書に全文字につき一文字からなる文字列を最初値
として登録してから復号化を始める。
The decoding process of FIG. 8 is the reverse operation of the encoding of FIG. In the LZW decoding of FIG. 8, as in the case of encoding, a character string consisting of one character for every character is registered as a first value in the dictionary in advance, and then decoding is started.

【0035】先ずステップS1で最初の符号(参照番
号)を読込み、現在のCODEをOLDcodeとし、
最初の符号は既に辞書に登録された一文字の参照番号い
ずれかに該当することから、入力符号CODEに一致す
る文字code(K)を探し出し、文字Kを出力する。
First, in step S1, the first code (reference number) is read and the current CODE is set to OLDcode,
Since the first code corresponds to any one-character reference number already registered in the dictionary, the character code (K) matching the input code CODE is searched for and the character K is output.

【0036】尚、出力した文字Kは後の例外処理のため
FINcharにセットしておく。次にステップS2に
進んで次の符号を読込んでCODEにINcodeとし
てセットする。ステップS3で新たな符号があるか否
か、即ち符号入力の終了の有無をチェックしてステップ
S4に進み、ステップS3で入力された符号CODEが
辞書に定義(登録)されているか否かチェックする。
The output character K is set in FINchar for later exception processing. Next, in step S2, the next code is read and set in CODE as INcode. In step S3, it is checked whether or not there is a new code, that is, whether or not the code input is completed, and the process proceeds to step S4. It is checked whether or not the code CODE input in step S3 is defined (registered) in the dictionary. ..

【0037】通常、入力した符号語は前回までの処理で
辞書に登録されているため、ステップS5に進んで符号
CODEに対応する文字列code(ωK)を辞書から
読出し、ステップS6で文字Kを一時的にスタックし、
参照番号CODE(ω)を新な符号CODEとして再度
ステップS5に戻り、このステップS5、ステップS6
の手順を再帰的に参照番号ωが一文字Kに至るまで繰り
返し、最後にステップS7に進んでステップS6でスタ
ックした文字をLIFO(Last In Fast
Out) 形式でポップアップして出力する。
Since the input code word is normally registered in the dictionary by the processing up to the previous time, the process proceeds to step S5, the character string code (ωK) corresponding to the code CODE is read from the dictionary, and the character K is read in step S6. Temporarily stack,
The reference number CODE (ω) is set as a new code CODE, and the process returns to step S5 again, and steps S5 and S6
The above procedure is recursively repeated until the reference number ω reaches one character K, and finally the process proceeds to step S7, where the characters stacked in step S6 are LIFO (Last In Fast).
(Out) pops up and outputs.

【0038】同時にステップS7において、前回使った
符号ωと今回復元した文字列の最初の1文字Kを組(ω
K)と表した文字列に、新たな参照番号を付加して辞書
に登録する。
At the same time, in step S7, the code ω used last time and the first character K of the character string restored this time are combined (ω
A new reference number is added to the character string expressed as (K) and registered in the dictionary.

【0039】図10を参照してLZW復号化処理を具体
的に説明すると次のようになる。まず図10で最初の入
力符号語(INPUT CODE)は1であり、一文字
a、b、cについては既に参照番号1、2、3として図
9Bに示すように辞書に登録されているため、辞書の参
照により符号語1に一致する参照番号の文字列aに置き
換えて出力する。
The LZW decoding process will be described in detail with reference to FIG. First, in FIG. 10, the first input codeword (INPUT CODE) is 1, and the letters a, b, and c are already registered in the dictionary as reference numbers 1, 2, and 3 as shown in FIG. Is output by replacing with the character string a of the reference number that matches the code word 1.

【0040】次の符号語2についても同様にして文字b
に置き換えて出力する。このとき前回処理した符号語1
と今回復号した文字列の1番目の文字bとを組合わせた
文字列ωK=1bに新たな参照番号4を付加して辞書に
登録する。
Similarly for the next code word 2, the character b
Replace with and output. Code word 1 processed last time
A new reference number 4 is added to the character string ωK = 1b, which is a combination of the first character b of the character string decoded this time, and registered in the dictionary.

【0041】3番目の符号語4は辞書の検索により求め
た文字列1bから文字列abと置き換えて文字列abを
出力する。同時に前回処理した符号語2と今回復号した
文字列の1番目の文字aとの組合せた文字列ωK=2a
(=ba)に新たな参照番号5を付加して辞書に登録す
る。
The third code word 4 replaces the character string 1b obtained by the dictionary search with the character string ab and outputs the character string ab. At the same time, a character string ωK = 2a obtained by combining the previously processed code word 2 and the first character a of the character string decoded this time
A new reference number 5 is added to (= ba) and registered in the dictionary.

【0042】以下同様に、この処理を繰り返す。上記の
ユニバーサル符号化方式は、情報保存型のデータ圧縮方
式であり、データ圧縮時に、情報源の統計的な性質を仮
定しない。従って、種々のタイプ(文字コード、オブジ
ェクトコ−ド、画像等)のデータに適用できる。
Similarly, this process is repeated. The above universal encoding method is an information storage type data compression method, and does not assume the statistical property of the information source at the time of data compression. Therefore, it can be applied to various types of data (character code, object code, image, etc.).

【0043】しかし、ユニバーサル符号を使用して、2
値画像データを圧縮した場合、ある程度の圧縮率は得ら
れるが、従来使用されていた2値画像専用の圧縮方式
(MMR、予測符号化)の圧縮率を超えることはできな
かった。
However, using the universal code, 2
When the value image data is compressed, a certain degree of compression ratio can be obtained, but the compression ratio of the conventionally used compression method for binary images (MMR, predictive coding) cannot be exceeded.

【0044】そこで従来、2値画像データを、画素パタ
ーンと、そのパターンのランレングスとの組で表現した
中間データに変換し、該中間データをユニバーサル符号
化する方式が考えられていた。以下、その概要を説明す
る。
Therefore, conventionally, a method has been considered in which binary image data is converted into intermediate data represented by a set of a pixel pattern and a run length of the pattern, and the intermediate data is universally encoded. The outline will be described below.

【0045】前記のユニバーサル符号化方式による画像
データの圧縮部及び復元部の構成を、図11に示す。図
11に示すように、圧縮部1には、画素数保持部2、前
処理変換部3、ユニバーサル符号化部4を設ける。前記
画素数保持部2には、外部からの横画素数及び縦画素数
を保持させておき、前処理変換部3で、入力画像データ
の前処理を行って中間データを作成した後、ユニバーサ
ル符号化部4で符号化を行い、符号化データを出力す
る。
FIG. 11 shows the configuration of the compression unit and the decompression unit of the image data according to the universal coding method. As shown in FIG. 11, the compression unit 1 is provided with a pixel number holding unit 2, a preprocessing conversion unit 3, and a universal encoding unit 4. The number-of-pixels holding unit 2 holds the number of horizontal pixels and the number of vertical pixels from the outside, and the preprocessing conversion unit 3 preprocesses the input image data to create intermediate data, and then the universal code. Encoding unit 4 performs encoding and outputs encoded data.

【0046】また、復元部5には、画素数保持部2、ユ
ニバーサル復号化部4A、後処理変換部3Aを設ける。
この復元部5では、外部からの横画素数、及び縦画素数
を、画素数保持部2に保持しておき、入力した符号化デ
ータを、ユニバーサル復号化部4Aで復号化して中間デ
ータに変換した後、後処理変換部3Aで後処理を行っ
て、画像データを復元する。
Further, the restoration unit 5 is provided with a pixel number holding unit 2, a universal decoding unit 4A and a post-processing conversion unit 3A.
In this restoration unit 5, the number of horizontal pixels and the number of vertical pixels from the outside are held in the pixel number holding unit 2, and the input coded data is decoded by the universal decoding unit 4A and converted into intermediate data. After that, the post-processing conversion unit 3A performs post-processing to restore the image data.

【0047】以下、図12〜図14に基づいて詳細に説
明する。先ず、図12に示した圧縮部について説明す
る。図12において、11−i(i=1〜4)は第iラ
インのレジスタであって、画像データから読み取られる
隣接する4ライン中の第iラインの同一画素位置の画素
の白黒情報を保持するもの、10−i(i=1〜4)は
第iラインのシフトレジスタであって、画像データから
読み取られる隣接する4ライン中の第iラインの全画素
の白黒情報を保持するもの、12−i(i=1〜4)は
第iラインのEOR回路(排他的論理和回路)であっ
て、第iラインレジスタ11−iが保持する画素の白黒
情報と第iラインシフトレジスタ10−iの先頭位置の
画素の白黒情報とが両方とも黒あるいは白であるときに
“0”を出力するものである。
The details will be described below with reference to FIGS. First, the compression unit shown in FIG. 12 will be described. In FIG. 12, 11-i (i = 1 to 4) is a register of the i-th line, which holds black-and-white information of pixels at the same pixel position of the i-th line among the four adjacent lines read from the image data. 10-i (i = 1 to 4) is a shift register of the i-th line, which holds black-and-white information of all pixels of the i-th line in the four adjacent lines read from the image data, 12- i (i = 1 to 4) is an EOR circuit (exclusive OR circuit) of the i-th line, which is used for the black-and-white information of the pixel held by the i-th line register 11-i and the i-th line shift register 10-i. When both the black and white information of the pixel at the head position is black or white, "0" is output.

【0048】また、13は、OR回路(論理和回路)で
あって、4個設けられる第iラインのEOR回路12−
iのいずれか1つから“1”が出力されるときに、
“1”を出力するもの、9は否定回路(インバータ)で
あって、第1のOR回路13の出力を反転することで4
個設けられる第iラインのEOR回路12−iのすべて
が“0”を出力するときにカウンタ8の計数端子に
“1”を出力するものである。
Further, 13 is an OR circuit (OR circuit), and four EOR circuits 12- of the i-th line are provided.
When "1" is output from any one of i,
A device that outputs “1”, and 9 is a negation circuit (inverter), which inverts the output of the first OR circuit 13
When all of the i-th line EOR circuits 12-i provided individually output "0", "1" is output to the counting terminal of the counter 8.

【0049】なお、出力セレクタ回路7の一部は、図1
1Aの画素数保持部2に対応し、シフトレジスタ10−
1〜10−4、レジスタ11−1〜11−4、EOR1
2−1〜12−4、OR回路13、否定回路9、カウン
タ8、出力セレクタ回路等は、前処理変換部3に対応す
る。
A part of the output selector circuit 7 is shown in FIG.
The shift register 10-corresponds to the pixel number holding unit 2 of 1A.
1-10-4, registers 11-1-11-4, EOR1
The 2-1 to 12-4, the OR circuit 13, the NOT circuit 9, the counter 8, the output selector circuit, and the like correspond to the preprocessing conversion unit 3.

【0050】以下、上記圧縮部の動作を、図12、図1
3を参照しながら説明する。2値画像データがシフトレ
ジスタ10−4に入力すると、シフトレジスタ10−1
〜10−4に、それぞれ1ラインずつシフトしながら格
納される。まず、シフトレジスタ10−1〜10−4か
ら、それぞれ1画素目が読み出されて、それぞれレジス
タ11−1〜11−4にセットされる。
The operation of the compression section will be described below with reference to FIGS.
This will be described with reference to FIG. When the binary image data is input to the shift register 10-4, the shift register 10-1
The data is stored in each of 10 to 4 while shifting by one line. First, the first pixels are read from the shift registers 10-1 to 10-4 and set in the registers 11-1 to 11-4, respectively.

【0051】以降は、シフトレジスタ10−1〜10−
4の1画素目が読み出されて、読み出された画素の白黒
がそれぞれレジスタ11−1〜11−4内の以前の4ラ
イン分の白黒パターンと比較される。比較は排他的論理
和回路12−1〜12−4で排他的論理和をとることで
行われる。読み出した各ライン分の白黒のパターンが以
前の各ライン分の白黒パターンと一致すれば、対応する
各排他的論理和は0が出力され、もし、一致しなければ
1が出力される。これらの出力は論理和回路13に加え
られる。
After that, the shift registers 10-1 to 10-
The first pixel of No. 4 is read out, and the black-and-white of the read-out pixel is compared with the previous four-line black-and-white pattern in the registers 11-1 to 11-4, respectively. The comparison is performed by taking exclusive OR in the exclusive OR circuits 12-1 to 12-4. If the read black-and-white pattern for each line matches the previous black-and-white pattern for each line, 0 is output for each corresponding exclusive OR, and if not, 1 is output. These outputs are applied to the OR circuit 13.

【0052】(1) もし、4ラインの白黒パターンが以前
の4ラインの白黒パターンと一致すれば、論理和回13
からは0が出力される。この出力は否定回路9でインバ
ートされた後、カウンタ8に加えられ、カウンタ8を1
つカウントアップさせる。カウンタ8ではカウント値が
15になるとキャリィが出力され、この信号は出力セレ
クタ回路7を経て、ユニバーサル符号化部4に符号化を
行うように指示する。
(1) If the 4-line black-and-white pattern matches the previous 4-line black-and-white pattern, the logical sum 13
0 is output from. This output is inverted by the negation circuit 9 and then added to the counter 8 to set the counter 8 to 1
Count up one. When the count value reaches 15 in the counter 8, a carry is output, and this signal passes through the output selector circuit 7 and instructs the universal encoding unit 4 to perform encoding.

【0053】(2) もし、4ラインの白黒パターンが以前
の4ラインの白黒パターンと一致しなければ、排他的論
理和回路12−1〜12−4の内、少なくとも一つは出
力が1になり、論理和回路13からは1が出力される。
この出力信号は出力セレクタ回路7を経て、ユニバーサ
ル符号化部4に符号化を行うように指示する。
(2) If the 4-line black-and-white pattern does not match the previous 4-line black-and-white pattern, at least one of the exclusive OR circuits 12-1 to 12-4 has an output of 1. Therefore, 1 is output from the OR circuit 13.
This output signal passes through the output selector circuit 7 and instructs the universal encoding unit 4 to perform encoding.

【0054】ユニバーサル符号化部4には、前処理回路
より、例えば図13Aのフォーマットに従った図13C
に示す中間データが加えられ、この中間データの系列が
符号化される。図13Cの中間データは、8ビットから
なり、上位4ビットがレジスタ10−1〜10−4の内
容を集めたもの(画素パターン)であり、下位4ビット
にカウンタの値(ランレングス)がセットされる。
The universal encoding unit 4 includes a pre-processing circuit, for example, as shown in FIG. 13C according to the format of FIG. 13A.
The intermediate data shown in is added, and the sequence of this intermediate data is encoded. The intermediate data in FIG. 13C consists of 8 bits, and the upper 4 bits are a collection (pixel pattern) of the contents of the registers 10-1 to 10-4, and the lower 4 bits are set with the counter value (run length). To be done.

【0055】従って、図13Bのように、「1101」
の縦方向の4画素が、横方向に10画素並んでいれば、
ランレングスは「1001」となるから、中間データ
(4bitの画素パターン+4bitのランレングス)
は、13Cのように「11011001」となる。
Therefore, as shown in FIG. 13B, "1101"
If 4 pixels in the vertical direction of 10 are aligned in the horizontal direction,
Since the run length is "1001", intermediate data (4 bit pixel pattern + 4 bit run length)
Becomes "11011001" like 13C.

【0056】次に、1語分の中間データがユニバーサル
符号化部4に入力されたあと、出力セレクタ回路7の出
力はカウンタ8を−1にクリアするよう指示するととも
に、レジスタ11−1〜11−4に、読み出した4ライ
ン分の白黒パターンを新しくセットするように指示す
る。以下、レジスタ10−1〜10−4から1画素ずつ
読み出し、レジスタ10−1〜10−4の全画素を符号
化するまで同様の操作を繰り返す。4ラインの全画素の
符号化が終了したなら、次の4ラインをレジスタ10−
1〜10−4に入力して、画像全体を符号化するまで同
様の動作を繰り返す。
Next, after the intermediate data for one word is input to the universal encoding unit 4, the output of the output selector circuit 7 instructs the counter 8 to be cleared to -1 and the registers 11-1 to 11-11. -4 is instructed to newly set the read black and white pattern for four lines. Hereinafter, the same operation is repeated until each pixel is read from the registers 10-1 to 10-4 and all the pixels in the registers 10-1 to 10-4 are encoded. When the coding of all the pixels of the 4 lines is completed, the next 4 lines are registered in the register 10-
1 to 10-4, and the same operation is repeated until the entire image is encoded.

【0057】次に、上記画像データの復元部について、
図14を参照しながら説明する。図14において、ユニ
バーサル復号化部4Aは、入力した符号化データを復号
化して、中間データ(この例では8ビット)に変換する
もの、レジスタ19は、前記中間データを格納し、画素
パターンの4ビットと、ランレングスの4ビットに分割
するためのレジスタである。
Next, regarding the image data restoration section,
This will be described with reference to FIG. In FIG. 14, a universal decoding unit 4A decodes the input coded data and converts it into intermediate data (8 bits in this example). A register 19 stores the intermediate data and stores a pixel pattern of 4 bits. It is a register for dividing into 4 bits of bit and run length.

【0058】カウンタ16は、ランレングスをカウント
するもの、シフトレジスタ18−1〜18−4は、レジ
スタ17の出力と、カウンタの計数値によりデータをシ
フトして、複製データを作成するためのもの、FIFO
15は、出力用のレジスタである。
The counter 16 counts run lengths, and the shift registers 18-1 to 18-4 shift the data according to the output of the register 17 and the count value of the counter to create duplicated data. , FIFO
Reference numeral 15 is an output register.

【0059】また、出力制御部14はレジスタ19から
のランレングスと、外部からの横画素数及び縦画素数を
入力し、シフトレジスタを制御するものである。以下、
復元部5の処理を簡単に説明する。
The output control section 14 inputs the run length from the register 19 and the numbers of horizontal pixels and vertical pixels from the outside to control the shift register. Less than,
The processing of the restoration unit 5 will be briefly described.

【0060】外部からの符号化データは、ユニバーサル
復号化部4Aにより復号化され、中間データとなる(8
ビット)。この中間データは、一旦、レジスタ19に格
納され、画素パターン(4ビット)とランレングス(4
ビット)とに分割される。
The coded data from the outside is decoded by the universal decoding unit 4A and becomes intermediate data (8
bit). This intermediate data is temporarily stored in the register 19, and the pixel pattern (4 bits) and the run length (4
Bit) and are divided into.

【0061】前記分割された画像データは、レジスタ1
7に入力し、ランレングスはカウンタ16と出力制御部
14に入力する。その後、レジスタ17の画素パターン
は、シフトレジスタ18−1〜18−4に入力し、ここ
で、カウンタ16から出力されるランレングスの計数値
だけシフトする。
The divided image data is stored in the register 1
7, and the run length is input to the counter 16 and the output control unit 14. After that, the pixel pattern of the register 17 is input to the shift registers 18-1 to 18-4, where it is shifted by the count value of the run length output from the counter 16.

【0062】即ち、ランレングスの値だけ、同一パター
ンを複製して元の画像データに復元する。そして、出力
制御部14の指示により、シフトレジスタ18−1〜1
8−4のデータを出力し、FIFOのレジスタ15を介
して、復元した画像データを出力する。
That is, the same pattern is duplicated by the run length value to restore the original image data. Then, according to an instruction from the output control unit 14, the shift registers 18-1 to 18-1
The data 8-4 is output, and the restored image data is output via the register 15 of the FIFO.

【0063】[0063]

【発明が解決しようとする課題】上記のような従来のも
のにおいては、次のような課題があった。 (1) 従来の画像データ圧縮/復元方式(図11〜14参
照)は、処理中に、ハード的なエラーが発生しない前提
のもとで考えられたものである。
SUMMARY OF THE INVENTION The above-mentioned conventional device has the following problems. (1) The conventional image data compression / decompression method (see FIGS. 11 to 14) was conceived on the premise that no hardware error occurs during processing.

【0064】従って、例えば通信路中にエラーが発生す
ると、符号データに影響を及ぼし、正常な処理ができな
くなる。 (2) ユニバーサル符号化では、記憶装置上に確保した領
域に、辞書を作成しながら、その辞書を使用して処理を
行う。
Therefore, for example, if an error occurs in the communication path, it will affect the code data and prevent normal processing. (2) In universal encoding, a dictionary is created in an area secured on a storage device and processing is performed using the dictionary.

【0065】この場合、記憶装置上のデータが外部的な
要因などで破壊されないという前提条件のもとで成立す
る。しかし、画像データの圧縮/復元装置として構成し
た場合、記憶装置が破壊されたり、データが化けるとい
った障害も発生する。
In this case, it is established under the precondition that the data in the storage device will not be destroyed by an external factor or the like. However, when it is configured as an image data compression / decompression device, there are problems such as damage to the storage device and garbled data.

【0066】この時、誤ったデータが読み出されて、処
理に使用されていても、それが正規のデータなのか、誤
ったデータなのかを判断することができなかった。本発
明は、このような従来の課題を解決し、画像データの圧
縮/復元処理に使用されているデータが、正規のデータ
なのか、誤ったデータなのかを、処理の途中で判断でき
るようにして、処理の信頼性を高めることを目的とす
る。
At this time, even if erroneous data was read out and used for processing, it was not possible to determine whether it was legitimate data or erroneous data. The present invention solves such a conventional problem and makes it possible to determine in the middle of processing whether the data used in the compression / decompression processing of image data is legitimate data or erroneous data. The purpose is to improve the reliability of processing.

【0067】[0067]

【課題を解決するための手段】図1は本発明の原理説明
図であり、図1のAの圧縮部の構成、図1のBは復元部
の構成を示す。
FIG. 1 is a diagram for explaining the principle of the present invention, in which the structure of the compression unit of A in FIG. 1 and the structure of the decompression unit in FIG. 1 are shown.

【0068】図中、1〜5は図11と同一のものを示
す。また、20は中間データ保持部、21は計数部、2
2は比較部を示す。本発明は上記の課題を解決するた
め、次のように構成した。
In the figure, 1 to 5 are the same as those in FIG. Further, 20 is an intermediate data holding unit, 21 is a counting unit, 2
2 shows a comparison part. The present invention has the following configuration to solve the above problems.

【0069】(1) 二次元配列の画素から成る画像データ
を圧縮する画像データの圧縮方式において、前記画像デ
ータを、画素パターンと、そのパターンのランレングス
とを組にして表現した中間データに変換する前処理変換
部3と、符号化対象の画像データの横/縦画素数を保持
する画素数保持部2と、前記前処理変換部3で変換した
中間データのランレングスを計数する計数部21と、前
記計数部21で計数した値を、前記画素数保持部2で保
持している値と比較する比較部22と、前記前処理変換
部3で変換した中間データを、ユニバーサル符号化する
ユニバーサル符号化部4とを具備し、入力した画像デー
タを、中間データに変換し、該中間データをユニバーサ
ル符号化して符号化データを出力すると共に、その処理
の過程で、前記比較部22の比較結果に基づいて、誤っ
たデータが使用されたことを検出するようにした。
(1) In the image data compression method for compressing image data composed of pixels in a two-dimensional array, the image data is converted into intermediate data expressed as a set of a pixel pattern and a run length of the pattern. A preprocessing conversion unit 3, a pixel number holding unit 2 that holds the number of horizontal / vertical pixels of the image data to be encoded, and a counting unit 21 that counts the run length of the intermediate data converted by the preprocessing conversion unit 3. And a comparison unit 22 that compares the value counted by the counting unit 21 with the value held by the pixel number holding unit 2, and a universal code that universally encodes the intermediate data converted by the preprocessing conversion unit 3. And an encoding unit 4 for converting input image data into intermediate data, universally encoding the intermediate data to output encoded data, and performing the comparison in the process of the process. Based on the comparison result of the section 22, it is detected that wrong data is used.

【0070】(2) 上記構成(1)のユニバーサル符号化
を、ユニバーサル型ユニバーサル符号化とした。 (3) 上記構成(1)のユニバーサル符号化を、増分分解
型ユニバーサル符号化とした。
(2) The universal coding of the above configuration (1) is called universal type universal coding. (3) The universal coding of the above configuration (1) is called incremental decomposition type universal coding.

【0071】(4) 二次元配列の画素から成る画像データ
の画素パターンと、そのパターンランレングスとを組に
して表現した中間データを、ユニバーサル符号化した符
号化データから、画像データを復元する画像データの復
元方式において、前記符号化データを、ユニバーサル復
号化して、中間データに変換するユニバーサル復号化部
4Aと、復号化対象の画像データの横/縦画素数を保持
する画素数保持部2と、前記ユニバーサル復号化部4A
で変換した中間データのランレングスを計数する計数部
21と、前記計数部21で計数した値を、前記画素数保
持部2で保持している値と比較する比較部22と、前記
ユニバーサル復号化部4Aで変換した中間データから、
該中間データのランレングス分だけの画素パターンを出
力して、画像データに変換する後処理変換部3Aとを具
備し、入力した符号化データを、中間データに変換し、
該中間データを画像データに復元して出力すると共に、
その処理の過程で、前記比較部22の比較結果に基づい
て、誤ったデータが使用されたことを検出するようにし
た。
(4) Image data for restoring image data from universally encoded data of intermediate data represented by a set of a pixel pattern of image data composed of pixels in a two-dimensional array and its pattern run length In the data restoration method, a universal decoding unit 4A that universally decodes the coded data and converts it into intermediate data, and a pixel number holding unit 2 that holds the number of horizontal / vertical pixels of the image data to be decoded. , The universal decoding unit 4A
A counting unit 21 for counting the run length of the intermediate data converted in step 1, a comparing unit 22 for comparing the value counted by the counting unit 21 with a value held by the pixel number holding unit 2, and the universal decoding From the intermediate data converted in part 4A,
A post-processing conversion unit 3A for outputting a pixel pattern corresponding to the run length of the intermediate data and converting the pixel data into image data, converting the input encoded data into intermediate data,
While restoring the intermediate data to image data and outputting the image data,
In the process of the processing, it is detected based on the comparison result of the comparison unit 22 that wrong data is used.

【0072】(5) 上記構成(4)のユニバーサル符号化
を、ユニバーサル型ユニバーサル符号化とした。 (6) 上記構成(4)のユニバーサル符号化を、増分分解
型ユニバーサル符号化とした。
(5) The universal encoding of the above configuration (4) is called universal type universal encoding. (6) The universal encoding of the above configuration (4) is set to incremental decomposition type universal encoding.

【0073】[0073]

【作用】上記構成に基づき本発明の作用を、図1を参照
しながら説明する。 (圧縮部)・・・図1のA参照 予め、外部から与えられた横画素数及び縦画素数を、画
素数保持部2に保持しておく。この状態で、前処理変換
部3に画像データが入力すると、前処理を行って、中間
データ(画素パターン+パターンランレングス)に変換
し、中間データ保持部20に保持する。
The operation of the present invention based on the above construction will be described with reference to FIG. (Compressor) ... See A of FIG. 1. In advance, the number of horizontal pixels and the number of vertical pixels provided from the outside are held in the pixel number holding unit 2. In this state, when the image data is input to the preprocessing conversion unit 3, preprocessing is performed to convert the data into intermediate data (pixel pattern + pattern run length), and the intermediate data holding unit 20 holds the intermediate data.

【0074】前記中間データのランレングス(パターン
ランレングス)は、計数部21で計数され、その計数値
は比較部22へ送る。比較部22では、前記計数値を、
画素数保持部2に保持している値と比較し、その結果に
応じてエラー情報を出力する。
The run length (pattern run length) of the intermediate data is counted by the counter 21, and the count value is sent to the comparator 22. In the comparison unit 22, the count value is
The value stored in the pixel number storage unit 2 is compared, and error information is output according to the result.

【0075】又、中間データ保持部20に保持されてい
る中間データは、ユニバーサル符号化部4へ送られ、こ
こでユニバーサル符号化されて、符号化データ、即ち圧
縮されたデータに変換されて出力する。
The intermediate data held in the intermediate data holding unit 20 is sent to the universal coding unit 4, where it is universally coded and converted into coded data, that is, compressed data and output. To do.

【0076】このようにすれば、通信装置、あるいは記
憶装置等のハード障害により、誤ったデータが読み出さ
れ、処理に使用された場合には、処理の途中で、検出さ
れる(エラー情報)。
In this way, when erroneous data is read and used for processing due to a hardware failure of the communication device or the storage device, it is detected during the processing (error information). ..

【0077】(復元部)・・・図1のB参照 この場合にも、画素数保持部2に横画素数及び縦画素数
を保持しておく。ユニバーサル復号化部4Aに、符号化
データが入力すると、ここでユニバーサル復号化されて
中間データに変換される。
(Restoring Unit) ... See B in FIG. 1 In this case as well, the pixel number holding unit 2 holds the number of horizontal pixels and the number of vertical pixels. When the encoded data is input to the universal decoding unit 4A, it is universally decoded here and converted into intermediate data.

【0078】前記中間データは、中間データ保持部20
に保持された後、そのランレングスが計数部21で計数
され、その計数値が比較部22へ送られる。比較部22
では、前記計数値を、画素数保持部2に保持されている
値と比較し、その結果に応じてエラー情報を出力する。
The intermediate data is stored in the intermediate data holding unit 20.
The run length is counted by the counter 21, and the count value is sent to the comparator 22. Comparison unit 22
Then, the count value is compared with the value held in the pixel number holding unit 2, and error information is output according to the result.

【0079】又、中間データ保持部20に保持されてい
る中間データは、後処理変換部3Aに送られ、ここで元
の画像データに復元される。このようにすれば、圧縮部
と同様に、誤ったデータが読み出され、処理に使用され
た場合には、処理の途中で検出される。従って、画像デ
ータの圧縮/復元処理の信頼性を高めることが可能とな
る。
Further, the intermediate data held in the intermediate data holding unit 20 is sent to the post-processing conversion unit 3A, where it is restored to the original image data. In this way, similar to the compression unit, when erroneous data is read and used for processing, it is detected during processing. Therefore, the reliability of the image data compression / decompression process can be improved.

【0080】[0080]

【実施例】以下、本発明の実施例を図面に基づいて説明
する。図2〜図5は、本発明の実施例を示した図であ
り、図2は処理説明図(圧縮時)、図3は処理説明図
(復元時)、図4は圧縮部の構成図、図5は復元部の構
成図である。
Embodiments of the present invention will be described below with reference to the drawings. 2 to 5 are diagrams showing an embodiment of the present invention, FIG. 2 is a process explanatory diagram (during compression), FIG. 3 is a process explanatory diagram (during restoration), FIG. FIG. 5 is a block diagram of the restoration unit.

【0081】図中、図1、図12、図14と1〜5の記
号は同一のものを示す。また、23は画素アダー、2
4、27は比較器、25、26はレジスタ、28はライ
ンアダーを示す。
In the figure, the symbols 1 to 5 in FIG. 1, FIG. 12 and FIG. 14 are the same. In addition, 23 is a pixel adder, 2
Reference numerals 4 and 27 denote comparators, 25 and 26 denote registers, and 28 denotes a line adder.

【0082】(1) 画像データの圧縮/復元処理の概要説
明 先ず、図2、図3に基づいて、本実施例の処理の概要を
説明する。 (画像データの圧縮処理)・・・図2参照 この実施例では、処理対象の画像データは、白黒2値の
画像データとする。
(1) Description of Outline of Image Data Compression / Decompression Process First, the outline of the process of this embodiment will be described with reference to FIGS. (Image data compression processing) ... See FIG. 2. In this embodiment, the image data to be processed is binary black and white image data.

【0083】例えば、図2に示したように、原画(原画
像データ)を、横55ビット、縦4ビットとして説明す
る。この原画から、前処理を行って中間データを作成す
る。
For example, as shown in FIG. 2, the original image (original image data) will be described as having 55 bits horizontally and 4 bits vertically. Preprocessing is performed from this original image to create intermediate data.

【0084】この場合、中間データのフォーマットは、
画素パターン4ビット+カウント数(ランレングス)4
ビットの構成で、合計8ビットとする。このフォーマッ
トでは、ランレングスは最大16の範囲でカウントされ
る。
In this case, the format of the intermediate data is
Pixel pattern 4 bits + count number (run length) 4
The total bit structure is 8 bits. In this format, run lengths are counted in a range of up to 16.

【0085】前記中間データは、(縦4ビット)×(横
55ビット)の原画から、縦4ビットを切り出し、この
画素パターンと、該パターンのランレングスとを一緒に
して8ビットの中間データにする。
For the intermediate data, vertical 4 bits are cut out from an original image of (vertical 4 bits) × (horizontal 55 bits), and the pixel pattern and the run length of the pattern are combined to form 8-bit intermediate data. To do.

【0086】例えば図の黒を「1」、白を「0」とする
と、原画の左側から、縦4bitは「1000」、「0
001」、「0011」、「0011」、「011
1」、「0111」、「1110」、「1100」、
「1100」、「1000」、「1000」、「100
0」・・・のようになる。
For example, assuming that black is "1" and white is "0" in the figure, the vertical 4 bits are "1000" and "0" from the left side of the original image.
"001", "0011", "0011", "011"
1 ”,“ 0111 ”,“ 1110 ”,“ 1100 ”,
"1100", "1000", "1000", "100"
0 ”...

【0087】従って、図の左側から「1000」のラン
レングスは1、「0001」のランレングスは1、「0
011」のランレングスは2、「0111のランレング
スは2、「1110」のランレングスは1、「110
0」のランレングスは2、「1000」のランレングス
は3・・・のようになる。
Therefore, from the left side of the figure, the run length of "1000" is 1, the run length of "0001" is 1, and the run length is "0".
"011" has a run length of 2, "0111 has a run length of 2," 1110 "has a run length of 1," 110 "
The run length of "0" is 2, the run length of "1000" is 3, and so on.

【0088】そこで、同一の画像パターンは、1つだけ
として、この画素パターンにランレングスを付加して中
間データにすると、図の左側から、順次次のような中間
データとなる。
Therefore, if there is only one identical image pattern and the run length is added to this pixel pattern to form intermediate data, the following intermediate data is obtained from the left side of the drawing.

【0089】なお、画素パターンのランレングスを4ビ
ットで表わす際、ランレングス1を「0000」、ラン
レングス2を「0001」、ランレングス3を「001
0」、ランレングス4を「0011」・・・ランレング
ス16を「1111」のようにする。これにより、4ビ
ットで16通りのランレングスが表わせる。
When the run length of the pixel pattern is represented by 4 bits, the run length 1 is "0000", the run length 2 is "0001", and the run length 3 is "001".
0 ”, the run length 4 is“ 0011 ”, and the run length 16 is“ 1111 ”. As a result, 16-bit run length can be represented by 4 bits.

【0090】即ち、図の左側から、「1000000
0」、「00010000」、「00110001」、
「01110001」、「11100000」、「11
000001」、「10000010」・・・のような
中間データが得られる。
That is, from the left side of the figure, "1000000
0 "," 00010000 "," 00110001 ",
"01110001", "11100000", "11"
Intermediate data such as "000001", "10000010" ... Is obtained.

【0091】前記中間データでは、ランレングスを付加
することにより、同一パターンの画像データを省いてお
り、その分、原画より少ないデータ量となる。従って、
前処理によりデータ量を少なくしてから符号化処理をす
るので、その分、圧縮処理が高速化できる。
In the intermediate data, by adding the run length, the image data of the same pattern is omitted, and the amount of data is smaller than that of the original image by that amount. Therefore,
Since the amount of data is reduced by the preprocessing before the encoding process, the compression process can be speeded up accordingly.

【0092】次に、前記の中間データのランレングスを
計数して、誤ったデータが使用されたことをチェックす
ると共に、ユニバーサル符号化して、符号化データとす
る。以後、図の(縦4ビット)×(横55ビット)のデ
ータ(4ラインのデータ)を1つの単位として、順次符
号化処理を行い、画像データを圧縮処理する。
Next, the run length of the intermediate data is counted to check that incorrect data has been used, and universally encoded to obtain encoded data. After that, the data of (vertical 4 bits) × (horizontal 55 bits) (4 lines of data) in the figure is used as one unit for sequential encoding processing and image data compression processing.

【0093】なお、前記第1番目4ライン分のランレン
グスを合計すると、55になる。この計数値を、外部か
ら与えられた原画の画素数と比較して、符号化処理に、
誤ったデータが使用されたか否かをチェックする。
It should be noted that the run lengths for the first and fourth lines are summed to 55. This count value is compared with the number of pixels of the original image given from the outside, and in the encoding process,
Check if incorrect data was used.

【0094】(画像データの復元処理)・・・図3参照 一度ユニバーサル符号化処理により圧縮された符号化デ
ータは、ユニバーサル復号化により、復号化され、中間
データに変換される。
(Image Data Restoration Processing) ... See FIG. 3. The encoded data once compressed by the universal encoding processing is decoded by universal decoding and converted into intermediate data.

【0095】その後、中間データは、後処理によって復
元画像となる。この場合にも、中間データは、4ビット
の画素パターンと、4ビットのランレングスで構成され
る。また、前記ランレングスの計数値を用いて、誤った
データが使用されたか否かをチェックする。
After that, the intermediate data becomes a restored image by post-processing. Also in this case, the intermediate data is composed of a 4-bit pixel pattern and a 4-bit run length. Further, it is checked whether or not incorrect data is used by using the run length count value.

【0096】(2) 圧縮部の詳細な説明 (圧縮部の構成)・・・図4参照 本実施例において、画像データの圧縮処理を行う際、図
4に示した構成の圧縮部を用いる。
(2) Detailed Description of Compressing Unit (Structure of Compressing Unit) ... See FIG. 4 In the present embodiment, when compressing image data, the compressing unit having the structure shown in FIG. 4 is used.

【0097】この圧縮部1は、シフトレジスタ10−1
〜10−4、レジスタ11−1〜11−4、EOR(排
他的論理和回路)12−1〜12−4、OR(論理和回
路)13、否定回路(インバータ)9、カウンタ8、出
力セレクタ回路7、バッファ6、ユニバーサル符号化部
4、画素アダー(画素加算器)23、ラインアダー(ラ
イン加算器)28、比較器24、27、レジスタ25、
26等で構成する。
The compression unit 1 includes a shift register 10-1.
-10-4, registers 11-1 to 11-4, EOR (exclusive OR circuit) 12-1 to 12-4, OR (OR circuit) 13, NOT circuit (inverter) 9, counter 8, output selector Circuit 7, buffer 6, universal encoding unit 4, pixel adder (pixel adder) 23, line adder (line adder) 28, comparators 24, 27, register 25,
It is composed of 26 etc.

【0098】前記構成において、シフトレジスタ10−
1〜10−4、レジスタ11−1〜11−4、EOR1
2−1〜12−4、OR13、否定回路9、カウンタ
8、出力セレクタ回路7は、図1の前処理変換部3に対
応し、バッファ6は中間データ保持部20に対応する。
In the above structure, the shift register 10-
1-10-4, registers 11-1-11-4, EOR1
2-1 to 12-4, OR 13, NOT circuit 9, counter 8, and output selector circuit 7 correspond to the preprocessing conversion unit 3 of FIG. 1, and the buffer 6 corresponds to the intermediate data holding unit 20.

【0099】また、画素アダー23、ラインアダー28
は、図1の計数部21に対応し、比較器24、27は、
図1の比較部22に対応する。更に、出力セレクタ回路
7の一部と、レジスタ25、26は、図1の画素数保持
部2に対応する。
Further, the pixel adder 23 and the line adder 28
Corresponds to the counting unit 21 in FIG. 1, and the comparators 24 and 27 are
This corresponds to the comparison unit 22 in FIG. Further, a part of the output selector circuit 7 and the registers 25 and 26 correspond to the pixel number holding unit 2 of FIG.

【0100】なお、画素アダー23、ラインアダー2
8、比較器24、27、レジスタ25、26以外の構成
は、従来例と同じ構成である。シフトレジスタ10−1
〜10−4は、入力した画像データを順次シフトしなが
ら格納するものであり、図2に示した4ビット×55ビ
ットの4ライン分の原画を格納する。
The pixel adder 23 and the line adder 2
The configuration other than 8, the comparators 24 and 27, and the registers 25 and 26 is the same as that of the conventional example. Shift register 10-1
Numerals 10 to 4 are for sequentially storing the input image data while shifting them, and for storing the original image for 4 lines of 4 bits × 55 bits shown in FIG.

【0101】この場合、シフトレジスタ10−1には、
1ライン目の55ビットの画像データ、シフトレジスタ
10−2には2ライン目の55ビットの画像データ、シ
フトレジスタ10−3には3ライン目の55ビットの画
像データ、シフトレジスタ10−4には4ライン目の5
5ビットの画像データがそれぞれ格納される。
In this case, the shift register 10-1 has
55-bit image data on the first line, 55-bit image data on the second line in the shift register 10-2, 55-bit image data on the third line in the shift register 10-3, shift register 10-4 Is 5 on the 4th line
5-bit image data is stored therein.

【0102】レジスタ11−1〜11−4はシフトレジ
スタ10−1〜10−4から出力された1画素(1ビッ
ト)のデータを格納するものであり、図2の縦方向の4
ビットの画像データを順次格納する。
The registers 11-1 to 11-4 store the data of one pixel (1 bit) output from the shift registers 10-1 to 10-4, and are arranged in the vertical direction of FIG.
Bit image data is sequentially stored.

【0103】EOR12−1〜12−4は、レジスタ1
1−1〜11−4に格納されているデータ(1ビット)
と、シフトレジスタ10−1〜10−4に格納されてい
る次のデータ(1ビット)との排他的論理和演算を行う
回路(ランレングスを求めるための演算を行う回路)で
ある。
EOR 12-1 to 12-4 are register 1
Data stored in 1-1 to 11-4 (1 bit)
And a next data (1 bit) stored in the shift registers 10-1 to 10-4 (exclusive OR operation) (a circuit for performing a run length calculation).

【0104】カウンタ8は、EOR12−1〜12−4
の出力データをカウントしてランレングスを計数するも
のである。この例では、中間データのランレングスは4
ビット構成であるから、カウンタ8のLSBから4ビッ
トを取り出し、バッファ6へセットするように構成され
ている。
The counter 8 has EORs 12-1 to 12-4.
The output data of is counted and the run length is counted. In this example, the run length of the intermediate data is 4
Because of the bit configuration, 4 bits are taken out from the LSB of the counter 8 and set in the buffer 6.

【0105】また、4ビットのランレングスでは、「0
000」〜「1111」の範囲(最大16)であるか
ら、カウンタ8のカウント値が15を超えた時のキャリ
ィ(cry)信号を取り出して、出力セレクタ回路7に
入力するようにしている。
In the 4-bit run length, "0
Since it is in the range of 000 "to" 1111 "(maximum 16), a carry signal when the count value of the counter 8 exceeds 15 is taken out and input to the output selector circuit 7.

【0106】出力セレクタ回路7では、外部から与えら
れた横画素数(この例では55)、縦画素数(この例で
は4)を内部にセットしておくと共に、レジスタ11−
1〜11−4のデータ(4ビットの縦方向のデータ)、
OR13の出力データ等を入力し、レジスタ11−1〜
11−4やカウンタ8を制御する。
In the output selector circuit 7, the number of horizontal pixels (55 in this example) and the number of vertical pixels (4 in this example) given from the outside are set inside and the register 11-
1 to 11-4 data (4-bit vertical data),
Input the output data of OR13, etc., register 11-1 ~
11-4 and the counter 8 are controlled.

【0107】バッファ6は、中間データ(4ビットの画
素パターン+4ビットのランレングス)を一時格納して
おくものであり、ユニバーサル符号化部4は、前記中間
データをユニバーサル符号化処理して、符号化データに
変換するものである。
The buffer 6 temporarily stores the intermediate data (4-bit pixel pattern + 4-bit run length), and the universal encoder 4 universally encodes the intermediate data to encode the intermediate data. It is to be converted into digitized data.

【0108】画素アダー23は、バッファ6内に格納さ
れている中間データの下4ビットに付加されているラン
レングスを入力して、画素の加算を行う加算器である。
ラインアダー28は、画素アダーのキャリィ(cry)
信号を加算して、ライン数(4ライン単位)を加算する
加算器である。
The pixel adder 23 is an adder that inputs the run length added to the lower 4 bits of the intermediate data stored in the buffer 6 and adds the pixels.
The line adder 28 is a pixel adder carry.
It is an adder that adds signals and adds the number of lines (in units of 4 lines).

【0109】レジスタ25は、外部から与えられた横画
素数(この例では55)を格納しておくレジスタであ
り、レジスタ26は、外部から与えられた総縦画素数の
1/4の値(4ライン単位で処理するため、1/4にし
ておく)を格納しておくレジスタである。
The register 25 is a register for storing the number of horizontal pixels (55 in this example) given from the outside, and the register 26 has a value (1/4) of the total number of vertical pixels given from the outside ( This is a register for storing 1/4 because it is processed in units of 4 lines.

【0110】比較器24は、画素アダー23の加算値と
レジスタ25の値を比較する比較器であり、比較器27
は、ラインアダー28の加算値と、レジスタ26の値を
比較する比較器である。
The comparator 24 is a comparator for comparing the added value of the pixel adder 23 and the value of the register 25, and the comparator 27
Is a comparator for comparing the added value of the line adder 28 and the value of the register 26.

【0111】(圧縮部の動作)・・・図2、図4参照 2値画像データがシフトレジスタ10−4に入力する
と、シフトレジスタ10−1〜10−4に、それぞれ1
ラインずつシフトしながら格納される。まず、シフトレ
ジスタ10−1〜10−4から、それぞれ1画素目が読
み出されて、それぞれレジスタ11−1〜11−4にセ
ットされる。
(Operation of Compressing Unit) ... See FIGS. 2 and 4. When binary image data is input to the shift register 10-4, 1 is input to each of the shift registers 10-1 to 10-4.
It is stored while shifting line by line. First, the first pixels are read from the shift registers 10-1 to 10-4 and set in the registers 11-1 to 11-4, respectively.

【0112】以降は、シフトレジスタ10−1〜10−
4の1画素目が読み出されて、読み出された画素の白黒
がそれぞれレジスタ11−1〜11−4内の以前の4ラ
イン分の白黒パターンと比較される。比較はEOR(排
他的論理和回路)12−1〜12−4で排他的論理和を
とることで行われる。
After that, the shift registers 10-1 to 10-
The first pixel of No. 4 is read out, and the black-and-white of the read-out pixel is compared with the previous four-line black-and-white pattern in the registers 11-1 to 11-4, respectively. The comparison is performed by taking an exclusive OR with EOR (exclusive OR circuit) 12-1 to 12-4.

【0113】読み出した各ライン分の白黒のパターンが
以前の各ライン分の白黒パターンと一致すれば、対応す
る各排他的論理和は0が出力され、もし、一致しなけれ
ば1が出力される。これらの出力はOR(論理和回路)
13に加えられる。
If the read black-and-white pattern for each line matches the previous black-and-white pattern for each line, 0 is output for each corresponding exclusive OR, and if they do not match, 1 is output. .. These outputs are OR (OR circuit)
Added to 13.

【0114】(1) もし、4ラインの白黒パターンが以前
の4ラインの白黒パターンと一致すれば、論理和回13
からは0が出力される。この出力は否定回路9でインバ
ートされた後、カウンタ8に加えられ、カウンタ8を1
つカウントアップさせる。カウンタ8ではカウント値が
15になるとキャリィが出力され、この信号は出力セレ
クタ回路7を経て、ユニバーサル符号化部4に符号化を
行うように指示する。
(1) If the 4-line black-and-white pattern matches the previous 4-line black-and-white pattern, the logical sum 13
0 is output from. This output is inverted by the NOT circuit 9 and then added to the counter 8 to set the counter 8 to 1
Count up one. The counter 8 outputs a carry when the count value reaches 15, and this signal instructs the universal encoder 4 via the output selector circuit 7 to perform encoding.

【0115】(2) もし、4ラインの白黒パターンが以前
の4ラインの白黒パターンと一致しなければ、排他的論
理和回路12−1〜12−4の内、少なくとも一つは出
力が1になり、論理和回路13からは1が出力される。
この出力信号は出力セレクタ回路7を経て、ユニバーサ
ル符号化部4に符号化を行うように指示する。
(2) If the black-and-white pattern of four lines does not match the previous black-and-white pattern of four lines, at least one of the exclusive OR circuits 12-1 to 12-4 has an output of 1. Therefore, 1 is output from the OR circuit 13.
This output signal passes through the output selector circuit 7 and instructs the universal encoding unit 4 to perform encoding.

【0116】ユニバーサル符号化部4には、前処理回路
で作成された中間データが入力され、ここで、ユニバー
サル符号化処理されて、符号化データに変換される。次
に、1語分の中間データがユニバーサル符号化部4に入
力されたあと、出力セレクタ回路7の出力はカウンタ8
を−1にクリアするよう指示するとともに、レジスタ1
1−1〜11−4に、読み出した4ライン分の白黒パタ
ーンを新しくセットするように指示する。
The universal encoding unit 4 receives the intermediate data created by the preprocessing circuit, where it is subjected to universal encoding processing and converted into encoded data. Next, after the intermediate data for one word is input to the universal encoding unit 4, the output of the output selector circuit 7 is the counter 8
To clear to -1 and register 1
It instructs 1-1 to 11-4 to newly set the read black and white patterns for four lines.

【0117】以下、レジスタ10−1〜10−4から1
画素ずつ読み出し、レジスタ10−1〜10−4の全画
素を符号化するまで同様の操作を繰り返す。4ラインの
全画素の符号化が終了したなら、次の4ラインをレジス
タ10−1〜10−4に入力して、画像全体を符号化す
るまで同様の動作を繰り返す。
Below, from registers 10-1 to 10-4 to 1
The pixels are read out pixel by pixel, and the same operation is repeated until all the pixels in the registers 10-1 to 10-4 are encoded. When the coding of all the pixels of four lines is completed, the next four lines are input to the registers 10-1 to 10-4 and the same operation is repeated until the entire image is coded.

【0118】前記のようにして符号化処理を実行する
が、その過程において、処理しているデータが正規のデ
ータか、誤ったデータかの判断をしている。以下、この
処理について説明する。
The encoding process is executed as described above. In the process, it is judged whether the data being processed is regular data or erroneous data. Hereinafter, this process will be described.

【0119】先ず、処理を開始する前に、レジスタ25
に、外部から与えられた横画素数(図2の例では55)
を格納しておき、レジスタ26に、総縦画素数の1/4
(図2の例では、4ライン単位で処理するので1/4と
している)を格納しておく。
First, before starting the processing, the register 25
, The number of lateral pixels given from the outside (55 in the example of FIG. 2)
Is stored in the register 26, and 1/4 of the total vertical pixel number
(In the example of FIG. 2, since it is processed in units of 4 lines, it is set to 1/4).

【0120】処理が開始されると、前処理で変換された
中間データ(4ビットの画素パターン+4ビットのラン
レングス)がバッファ6に格納される。そこで、前記中
間データのランレングス(下位4ビット)を取り出し、
画素アダー23で加算する。この加算値は、比較器24
で、レジスタ25の値(55)と比較される。
When the processing is started, the intermediate data (4-bit pixel pattern + 4-bit run length) converted in the pre-processing is stored in the buffer 6. Therefore, the run length (lower 4 bits) of the intermediate data is extracted,
The pixel adder 23 adds. This added value is calculated by the comparator 24.
Is compared with the value (55) of the register 25.

【0121】この比較で、画素アダー23の加算値が、
レジスタ25の値よりも小さければ、順次ランレングス
の加算を続ける。図2に示した(縦4ビット)×(横5
5ビット)の4ライン分の処理が終了すると、エラーが
なければ画素アダー23の値と、レジスタ25の値が等
しくなる(55になる)。
In this comparison, the added value of the pixel adder 23 is
If it is smaller than the value of the register 25, the run lengths are continuously added. 2 (vertical 4 bits) x (horizontal 5) shown in FIG.
When the processing of 4 lines (5 bits) is completed, the value of the pixel adder 23 becomes equal to the value of the register 25 (becomes 55) if there is no error.

【0122】このように、画素アダー23の値とレジス
タ25の値が等しくなると、画素アダー23をクリア
(clr)すると共に、ラインアダー28にキャリィ信
号(cry)を入力する(ラインアダーを+1する)。
In this way, when the value of the pixel adder 23 and the value of the register 25 become equal, the pixel adder 23 is cleared (clr) and the carry signal (cry) is input to the line adder 28 (the line adder is incremented by 1). ).

【0123】その後、画素アダー23では、再び次の4
ライン分について加算を開始し、前記の動作を繰り返
す。また、データに誤りが発生して、4ライン分の処理
が終了した時点で、画素アダー23の値とレジスタ25
の値が等しくならないことがある。
Then, in the pixel adder 23, the next 4
The addition is started for the line portion and the above operation is repeated. Further, when an error occurs in the data and the processing for four lines is completed, the value of the pixel adder 23 and the register 25
The values of may not be equal.

【0124】このような場合、比較器24では、画素ア
ダー23の値が、レジスタ25の値よりも大きければ、
エラー信号を出力するが、画素アダー23の値がレジス
タ25の値よりも小さければ何もしない。
In such a case, in the comparator 24, if the value of the pixel adder 23 is larger than the value of the register 25,
An error signal is output, but if the value of the pixel adder 23 is smaller than the value of the register 25, nothing is done.

【0125】しかし、画素アダー23の値が、レジスタ
25の値よりも小さい場合は、4ライン分の処理が終了
しても画素アダー23はクリアされない。このため、次
の4ライン分の処理が開始されても、前の4ライン分の
加算値に、加算を続けていく。そのため、次の4ライン
分の処理中に、画素アダー23の値がレジスタ25の値
よりも大きくなり、エラー信号を出力する。
However, when the value of the pixel adder 23 is smaller than the value of the register 25, the pixel adder 23 is not cleared even after the processing for four lines is completed. Therefore, even if the processing for the next four lines is started, the addition is continued to the added value for the previous four lines. Therefore, during processing of the next four lines, the value of the pixel adder 23 becomes larger than the value of the register 25, and an error signal is output.

【0126】前記のようにして、4ライン単位で処理を
行い、ラインアダー28で加算を続ける。比較器27で
は、ラインアダー28の値を、レジスタ26の値と比較
を行い、総縦画素数分の処理が正常に終了すると、両者
の値が等しくなるので、何も出力しないが、両者が等し
くなければエラー信号を出力する。
As described above, the processing is performed in units of four lines, and the line adder 28 continues the addition. In the comparator 27, the value of the line adder 28 is compared with the value of the register 26, and when the processing for the total number of vertical pixels is normally completed, both values become equal, so nothing is output, but both are If they are not equal, an error signal is output.

【0127】以上のようにして、正規のデータで符号化
処理しているのか、誤ったデータで符号化処理している
のかを、エラー信号を検出することで知ることが可能と
なる 。 (3) 復元部の詳細な説明 (復元部の構成)・・・図5参照 上記の圧縮部で符号化された符号化データは、図5に示
した復元部5により、復元されて元の画像(原画)とな
る。
As described above, by detecting the error signal, it is possible to know whether the coding process is performed with the regular data or the erroneous data. (3) Detailed description of decompression unit (configuration of decompression unit) ... See FIG. 5. The encoded data encoded by the compression unit is decompressed by the decompression unit 5 shown in FIG. It becomes an image (original picture).

【0128】この復元部5は、ユニバーサル復号化部4
A、レジスタ17、19、カウンタ16、シフトレジス
タ18−1〜18−4、FIFOのレジスタ15、出力
制御部14、画素アダー23、ラインアダー28、比較
器24、27、レジスタ25、26等で構成される。
The restoring unit 5 is a universal decoding unit 4
A, registers 17, 19, counter 16, shift registers 18-1 to 18-4, FIFO register 15, output control unit 14, pixel adder 23, line adder 28, comparators 24, 27, registers 25, 26, etc. Composed.

【0129】前記構成と、図1Bとの対応関係は次のと
おりである。レジスタ19は中間データ保持部20に対
応し、レジスタ17、カウンタ16、出力制御部14、
シフトレジスタ18−1〜18−4、FIFOのレジス
タ15は、後処理変換部3Aに対応する。
The correspondence relationship between the above configuration and FIG. 1B is as follows. The register 19 corresponds to the intermediate data holding unit 20, and includes a register 17, a counter 16, an output control unit 14,
The shift registers 18-1 to 18-4 and the FIFO register 15 correspond to the post-processing conversion unit 3A.

【0130】また、画素アダー23、ラインアダー28
は計数部21に対応し、比較器24、27は比較部22
に対応し、レジスタ25、26、と出力制御部14の一
部は画素数保持部2に対応する。
In addition, the pixel adder 23 and the line adder 28
Corresponds to the counting unit 21, and the comparators 24 and 27 include the comparing unit 22.
The registers 25 and 26 and a part of the output control unit 14 correspond to the pixel number holding unit 2.

【0131】なお、前記ユニバーサル復号化部4A、レ
ジスタ19、レジスタ17、カウンタ16、出力制御部
14、シフトレジスタ18−1〜18−4、FIFOの
レジスタ15は、従来例と同じなので説明は省略する。
The universal decoding unit 4A, the register 19, the register 17, the counter 16, the output control unit 14, the shift registers 18-1 to 18-4, and the FIFO register 15 are the same as those in the conventional example, and the description thereof is omitted. To do.

【0132】また、画素アダー23、ラインアダー2
8、比較器24、27、レジスタ25、26は、図4と
同じなので説明は省略する。 (復元部の動作)・・・図3、図5参照 外部からの符号化データ(圧縮部で圧縮したデータ)
は、ユニバーサル復号化部4Aにより復号化され中間デ
ータ(4ビットの画素パターン+4ビットのランレング
ス)となり、レジスタ19に格納される。
Further, the pixel adder 23 and the line adder 2
8, the comparators 24 and 27, and the registers 25 and 26 are the same as those in FIG. (Operation of decompression unit) ... See FIGS. 3 and 5 Encoded data from outside (data compressed by compression unit)
Is decoded by the universal decoding unit 4A to become intermediate data (4-bit pixel pattern + 4-bit run length) and stored in the register 19.

【0133】その後、中間データは2つに分割され、4
ビットの画素パターンはレジスタ17に入力し、4ビッ
トのランレングスは、カウンタ16、出力制御部14、
画素アダー23に入力する。
After that, the intermediate data is divided into two and divided into four.
The bit pixel pattern is input to the register 17, and the 4-bit run length is stored in the counter 16, the output control unit 14,
Input to the pixel adder 23.

【0134】この時、すでに、出力制御部14には、外
部から与えられた横画素数と縦画素数が格納されてい
る。また、レジスタ25には横画素数、レジスタ26に
は総縦画素数の1/4が格納されている。
At this time, the output control unit 14 has already stored the number of horizontal pixels and the number of vertical pixels given from the outside. The register 25 stores the number of horizontal pixels, and the register 26 stores 1/4 of the total number of vertical pixels.

【0135】レジスタ17に入力した画像パターンは、
図3の縦方向4ビットの画素のパターンであり、各画素
のパターンは、それぞれシフトレジスタ18−1〜18
−4に送られる(1ビットづつ)。
The image pattern input to the register 17 is
It is a vertical 4-bit pixel pattern of FIG. 3, and the patterns of the respective pixels are shift registers 18-1 to 18-18, respectively.
-4 (1 bit at a time).

【0136】ここで、カウンタ16のカウント値はラン
レングスであるから、このランレングスをシフトレジス
タ18−1〜18−4に送り、前記入力した画素のパタ
ーン(1または0)をランレングス分だけシフトして、
パターンの複製を行う。
Here, since the count value of the counter 16 is the run length, this run length is sent to the shift registers 18-1 to 18-4, and the pattern (1 or 0) of the input pixel is equal to the run length. Shift
Duplicate the pattern.

【0137】この処理を、各中間データ毎に順次行い、
シフトレジスタ18−1〜18−4に原画像の4ライン
分を復元する。そして、出力制御部14でシフトレジス
タ18−1〜18−4の出力制御を行い、FIFOのレ
ジスタ15を介して、復元した画像データを出力する。
This processing is sequentially performed for each intermediate data,
Four lines of the original image are restored in the shift registers 18-1 to 18-4. Then, the output control unit 14 controls the output of the shift registers 18-1 to 18-4, and outputs the restored image data via the register 15 of the FIFO.

【0138】このような復元処理の過程で、正規のデー
タにより復元されたのか、あるいは誤ったデータにより
復元されたのかをチェックしている。この処理は、画素
アダー23、ラインアダー28、比較器24、27、レ
ジスタ25、26で行うが、図4に示した圧縮部の処理
と同じなので、説明を省略する。
In the process of such a restoration process, it is checked whether the data is restored by the regular data or the incorrect data. This processing is performed by the pixel adder 23, the line adder 28, the comparators 24 and 27, and the registers 25 and 26, but since it is the same as the processing of the compression unit shown in FIG. 4, description thereof will be omitted.

【0139】この場合にも、比較器24、27から出力
されるエラー信号を検出することで、正規のデータで復
元処理されたのか、誤ったデータで復元処理されたのか
を知ることが可能となる。
Also in this case, by detecting the error signals output from the comparators 24 and 27, it is possible to know whether the restoration processing is performed with the normal data or the restoration processing with the incorrect data. Become.

【0140】[0140]

【発明の効果】以上説明したように、本発明によれば次
のような効果がある。 (1) 符号化/ 復号化による画像データの圧縮/ 復元処理
の途中で、処理しているデータが正規のデータか、誤っ
たデータかを判断することができる。
As described above, the present invention has the following effects. (1) During the compression / decompression process of image data by encoding / decoding, it is possible to determine whether the data being processed is legitimate data or erroneous data.

【0141】(2) 前記(1)の結果により、符号化/復
号化の動作の無効を、処理の途中で判定することが可能
となる。 (3) 画像データの圧縮/復元処理の信頼性が向上する。
(2) From the result of (1) above, it is possible to determine the invalidity of the encoding / decoding operation during the processing. (3) The reliability of image data compression / decompression processing is improved.

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

【図1】本発明の原理図である。FIG. 1 is a principle diagram of the present invention.

【図2】本発明の実施例における処理説明図(圧縮時)
である。
FIG. 2 is an explanatory diagram of processing in the embodiment of the present invention (when compressed)
Is.

【図3】実施例の処理説明図(復元時)である。FIG. 3 is a diagram for explaining the processing of the embodiment (at the time of restoration).

【図4】実施例における圧縮部の構成図である。FIG. 4 is a configuration diagram of a compression unit in the embodiment.

【図5】実施例における復元部の構成図である。FIG. 5 is a configuration diagram of a restoration unit in the embodiment.

【図6】ユニバーサル型の説明図であり、Aはユニバー
サル型のアルゴリズム説明図、Bはユニバーサル型の符
号形式説明図である。
FIG. 6 is an explanatory diagram of a universal type, A is an explanatory diagram of a universal type algorithm, and B is an explanatory diagram of a universal type code format.

【図7】従来のLZW符号化処理のフローチャートであ
る。
FIG. 7 is a flowchart of a conventional LZW encoding process.

【図8】従来のLZW復号化処理のフローチャートであ
る。
FIG. 8 is a flowchart of a conventional LZW decoding process.

【図9】図9のAは、従来のLZW符号化の具体的説明
図、図9のBは辞書構成例の説明図である。
9A is a concrete explanatory diagram of conventional LZW encoding, and FIG. 9B is an explanatory diagram of a dictionary configuration example.

【図10】従来のLZW復号化の具体的説明図である。FIG. 10 is a specific explanatory diagram of conventional LZW decoding.

【図11】従来の圧縮部及び復元部の構成図である。FIG. 11 is a configuration diagram of a conventional compression unit and decompression unit.

【図12】従来の圧縮部の構成図である。FIG. 12 is a configuration diagram of a conventional compression unit.

【図13】中間データの説明図であり、Aは中間データ
のフォーマット、Bはレジスタ内のデータ、Cは中間デ
ータである。
FIG. 13 is an explanatory diagram of intermediate data, where A is the format of the intermediate data, B is the data in the register and C is the intermediate data.

【図14】従来の復元部の構成図である。FIG. 14 is a configuration diagram of a conventional restoration unit.

【符号の説明】 1 圧縮部 2 画素数保持部 3 前処理変換部 4 ユニバーサル符号化部 20 中間データ保持部 21 計数部 22 比較部 3A 後処理変換部 4A ユニバーサル復号化部[Description of Codes] 1 compression unit 2 pixel number holding unit 3 pre-processing conversion unit 4 universal coding unit 20 intermediate data holding unit 21 counting unit 22 comparison unit 3A post-processing conversion unit 4A universal decoding unit

───────────────────────────────────────────────────── フロントページの続き (72)発明者 吉田 茂 神奈川県川崎市中原区上小田中1015番地 富士通株式会社内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Shigeru Yoshida 1015 Kamiodanaka, Nakahara-ku, Kawasaki-shi, Kanagawa Fujitsu Limited

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 二次元配列の画素から成る画像データを
圧縮する画像データの圧縮方式において、 前記画像データを、画素パターンと、そのパターンのラ
ンレングスとを組にして表現した中間データに変換する
前処理変換部(3)と、 符号化対象の画像データの横/縦画素数を保持する画素
数保持部(2)と、 前記前処理変換部(3)で変換した中間データのランレ
ングスを計数する計数部(21)と、 前記計数部(21)で計数した値を、前記画素数保持部
(2)で保持している値と比較する比較部(22)と、 前記前処理変換部(3)で変換した中間データを、ユニ
バーサル符号化するユニバーサル符号化部(4)とを具
備し、 入力した画像データを、中間データに変換し、該中間デ
ータをユニバーサル符号化して符号化データを出力する
と共に、その処理の過程で、 前記比較部(22)の比較結果に基づいて、誤ったデー
タが使用されたことを検出することを特徴とした画像デ
ータの圧縮方式。
1. A method of compressing image data for compressing image data composed of pixels in a two-dimensional array, wherein the image data is converted into intermediate data expressed as a set of a pixel pattern and a run length of the pattern. A pre-processing conversion unit (3), a pixel number holding unit (2) that holds the number of horizontal / vertical pixels of image data to be encoded, and a run length of the intermediate data converted by the pre-processing conversion unit (3). A counting unit (21) for counting, a comparing unit (22) for comparing the value counted by the counting unit (21) with a value held by the pixel number holding unit (2), and the preprocessing conversion unit A universal encoding unit (4) that universally encodes the intermediate data converted in (3), converts the input image data into intermediate data, universally encodes the intermediate data, and encodes the encoded data. output A compression method of image data, characterized in that, in the course of the processing, it is detected that erroneous data has been used based on the comparison result of the comparison unit (22).
【請求項2】 上記ユニバーサル符号化が、ユニバーサ
ル型ユニバーサル符号化であることを特徴とした請求項
1記載の画像データの圧縮方式。
2. The image data compression method according to claim 1, wherein the universal encoding is universal universal encoding.
【請求項3】 上記ユニバーサル符号化が、増分分解型
ユニバーサル符号化であることを特徴とした請求項1記
載の画像データの圧縮方式。
3. The image data compression method according to claim 1, wherein the universal encoding is an incremental decomposition type universal encoding.
【請求項4】 二次元配列の画素から成る画像データの
画素パターンと、そのパターンのランレングスとを組に
して表現した中間データを、ユニバーサル符号化した符
号化データから、画像データを復元する画像データの復
元方式において、 前記符号化データを、ユニバーサル復号化して、中間デ
ータに変換するユニバーサル復号化部(4A)と、 復号化対象の画像データの横/縦画素数を保持する画素
数保持部(2)と、 前記ユニバーサル復号化部(4A)で変換した中間デー
タのランレングスを計数する計数部(21)と、 前記計数部(21)で計数した値を、前記画素数保持部
(2)で保持している値と比較する比較部(22)と、 前記ユニバーサル復号化部(4A)で変換した中間デー
タから、該中間データのランレングス分だけの画素パタ
ーンを出力して、画像データに変換する後処理変換部
(3A)とを具備し、 入力した符号化データを、中間データに変換し、該中間
データを画像データに復元して出力すると共に、その処
理の過程で、 前記比較部(22)の比較結果に基づいて、誤ったデー
タが使用されたことを検出することを特徴とした画像デ
ータの復元方式。
4. An image for reconstructing image data from universally encoded data, which is universal data of intermediate data represented by a set of a pixel pattern of image data composed of pixels in a two-dimensional array and a run length of the pattern. In the data restoration method, a universal decoding unit (4A) that universally decodes the coded data and converts it into intermediate data, and a pixel number holding unit that holds the number of horizontal / vertical pixels of the image data to be decoded (2), a counting unit (21) for counting the run length of the intermediate data converted by the universal decoding unit (4A), and a value counted by the counting unit (21) for the pixel number holding unit (2 ) Of the intermediate data converted by the universal decoding unit (4A) and the comparison unit (22) for comparing the value held in) with the run length of the intermediate data. A post-processing conversion unit (3A) for outputting a pixel pattern and converting it into image data, converting input coded data into intermediate data, restoring the intermediate data into image data, and outputting the image data. A method of restoring image data, characterized in that, in the process of the processing, it is detected that erroneous data is used based on the comparison result of the comparison unit (22).
【請求項5】 上記ユニバーサル復号化が、ユニバーサ
ル型ユニバーサル復号化であることを特徴とした請求項
4記載の画像データの復元方式。
5. The image data restoration method according to claim 4, wherein the universal decoding is universal type universal decoding.
【請求項6】 上記ユニバーサル復号化が、増分分解型
ユニバーサル復号化であることを特徴とした請求項4記
載の画像データの復元方式。
6. The image data restoration method according to claim 4, wherein the universal decoding is an incremental decomposition type universal decoding.
JP04035308A 1992-02-21 1992-02-21 Image data compression / decompression method Expired - Fee Related JP3105330B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP04035308A JP3105330B2 (en) 1992-02-21 1992-02-21 Image data compression / decompression method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP04035308A JP3105330B2 (en) 1992-02-21 1992-02-21 Image data compression / decompression method

Publications (2)

Publication Number Publication Date
JPH05236283A true JPH05236283A (en) 1993-09-10
JP3105330B2 JP3105330B2 (en) 2000-10-30

Family

ID=12438166

Family Applications (1)

Application Number Title Priority Date Filing Date
JP04035308A Expired - Fee Related JP3105330B2 (en) 1992-02-21 1992-02-21 Image data compression / decompression method

Country Status (1)

Country Link
JP (1) JP3105330B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011239106A (en) * 2010-05-07 2011-11-24 Ricoh Co Ltd Image processing system and image processing method
US10445450B2 (en) 2016-09-01 2019-10-15 Nuflare Technology, Inc. Generating method of drawing data and charged particle beam drawing method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011239106A (en) * 2010-05-07 2011-11-24 Ricoh Co Ltd Image processing system and image processing method
US8699805B2 (en) 2010-05-07 2014-04-15 Ricoh Company, Limited Image processing apparatus and image processing method
US10445450B2 (en) 2016-09-01 2019-10-15 Nuflare Technology, Inc. Generating method of drawing data and charged particle beam drawing method

Also Published As

Publication number Publication date
JP3105330B2 (en) 2000-10-30

Similar Documents

Publication Publication Date Title
US5208593A (en) Method and structure for decoding Huffman codes using leading ones detection
JP3258552B2 (en) Data compression device and data decompression device
US20010051941A1 (en) Searching method of block sorting lossless compressed data, and encoding method suitable for searching data in block sorting lossless compressed data
US5177622A (en) Method and apparatus for detecting run length of two successive pixels and subjecting run length to universal coding
US5488366A (en) Segmented variable length decoding apparatus for sequentially decoding single code-word within a fixed number of decoding cycles
JP3105330B2 (en) Image data compression / decompression method
US6947606B2 (en) Skim encoding method for compression of a two dimensional array of data
JPH05236284A (en) Compression decoding system for picture data
JP3199292B2 (en) Run-length extraction method, Huffman code conversion method, and MH coding processing method in Huffman code coding
JP3038233B2 (en) Data compression and decompression device
JP3130324B2 (en) Data compression method
JPH0628149A (en) Method for compressing plural kinds of data
JP2840420B2 (en) Image data compression and decompression method
JPH06161705A (en) Data encoding system and data decoding system
JPH0723238A (en) Picture data compression and decoding device
CN115514967B (en) Image compression method and image decompression method based on binary block bidirectional coding
JPH06168097A (en) Data encoding system and data decoding system
JPH05152971A (en) Data compressing/restoring method
JP2999561B2 (en) Data compression and decompression device
JPH05176187A (en) Data compression decoding device
JP3034016B2 (en) Data compression and decompression method
JP3051501B2 (en) Data compression method
JP2952068B2 (en) Data compression and decompression method
JP3083329B2 (en) Data compression / decompression method
JP3132836B2 (en) Image data compression / decompression method

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20000815

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080901

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080901

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090901

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090901

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100901

Year of fee payment: 10

LAPS Cancellation because of no payment of annual fees