JP2684887B2 - Encoding / decoding device - Google Patents

Encoding / decoding device

Info

Publication number
JP2684887B2
JP2684887B2 JP3213922A JP21392291A JP2684887B2 JP 2684887 B2 JP2684887 B2 JP 2684887B2 JP 3213922 A JP3213922 A JP 3213922A JP 21392291 A JP21392291 A JP 21392291A JP 2684887 B2 JP2684887 B2 JP 2684887B2
Authority
JP
Japan
Prior art keywords
code
data
decoding
address
bit
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.)
Expired - Fee Related
Application number
JP3213922A
Other languages
Japanese (ja)
Other versions
JPH0556283A (en
Inventor
里佳 薮井
勝己 三浦
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.)
NEC Corp
Original Assignee
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP3213922A priority Critical patent/JP2684887B2/en
Publication of JPH0556283A publication Critical patent/JPH0556283A/en
Application granted granted Critical
Publication of JP2684887B2 publication Critical patent/JP2684887B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • G06T9/005Statistical coding, e.g. Huffman, run length coding

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、ファクシミリ装置にお
ける符号化復号化装置に利用され、特に、符号化および
復号化処理におけるテーブル引用方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention is used in a coding / decoding device in a facsimile machine, and more particularly to a table reference system in a coding / decoding process.

【0002】[0002]

【従来の技術】ファクシミリ装置において、伝送する情
報量を圧縮し伝送時間を短縮するためにデータの圧縮、
伸長ということが行われる。
2. Description of the Related Art In a facsimile machine, data compression is performed in order to compress the amount of information to be transmitted and shorten the transmission time.
This is called extension.

【0003】圧縮符号化方式には、CCITTの勧告
T.4でG3ファクシミリの符号化方式、勧告T.6で
G4ファクシミリの符号化方式を標準化している。G3
では1次元符号化方式のMH方式と2次元逐次符号化方
式のMR方式を規定している。G4ファクシミリでは2
次元逐次符号化方式のMMR方式を規定している。
As a compression encoding method, CCITT Recommendation T. G3 facsimile encoding method, Recommendation T.4. 6 standardizes the G4 facsimile encoding method. G3
Defines the MH method, which is a one-dimensional coding method, and the MR method, which is a two-dimensional sequential coding method. 2 for G4 facsimile
It defines the MMR method which is a dimensional sequential encoding method.

【0004】これらの方式に従い、画像データを符号に
変換する圧縮処理(符号化処理)および符号データを画
像データに変換する伸長処理(復号化処理)は、専用の
ハードウェアまたはソフトウェアにより実現される。
In accordance with these methods, compression processing (encoding processing) for converting image data into codes and decompression processing (decoding processing) for converting code data into image data are realized by dedicated hardware or software. .

【0005】一般的には、圧縮率の高いMR方式、MM
R方式は伝送時間が短く圧縮、伸長の処理の高速性が要
求されるためハードウェアにより実現され、MR方式、
MMR方式に比べ圧縮率の低いMH方式は、比較的伝送
時間が長く高速性がそれほど要求されないため、ソフト
ウェアにより実現される傾向がある。
Generally, the MM, which has a high compression ratio, is used.
The R method is realized by hardware because the transmission time is short and high speed compression and decompression processing is required.
The MH method, which has a lower compression rate than the MMR method, tends to be realized by software because it has a relatively long transmission time and does not require high speed.

【0006】以下に、ファクシミリ装置におけるMH方
式を利用した圧縮処理、および伸長処理の従来の一例を
述べる。
A conventional example of compression processing and decompression processing using the MH system in a facsimile machine will be described below.

【0007】符号化処理時に、画素データから白あるい
は黒の色の連続する画素の長さであるランレングス値を
求めるラングレンス計数手段により符号化を行う。
At the time of encoding processing, encoding is performed by the run length counting means for obtaining the run length value which is the length of consecutive pixels of white or black color from the pixel data.

【0008】MH方式では、そのコードは白あるいは黒
の色の連続する画素の長さであるラングレンスに応じて
表1に示すようなメークアップ符号および、表2に示す
ようなターミネーション符号の2系統の符号を用いてい
る。これは、ランレングスを64で割ったときの商と余
りとで表す方式で、商に相当するのがメークアップ符号
であり、余りに相当するのがターミネーション符号であ
る。従って、商をM、余りをTとすると、ランレングス
RLは、 RL=64×M+T で表すことができ、ターミネーション符号は0〜63ま
でのランレングスに応じており、メークアップ符号は6
4の整数倍で最大2560のランレングスに応じている
ものである。また、符号コードには、「白」を表現する
ものと、「黒」を表現するものとに分かれている。
In the MH system, the code is either a make-up code as shown in Table 1 or a termination code as shown in Table 2 depending on the run length which is the length of consecutive pixels of white or black color. The system code is used. This is a system in which the run length is divided by 64 and represented by a quotient and a remainder. The quotient corresponds to a make-up code, and the remainder corresponds to a termination code. Therefore, when the quotient is M and the remainder is T, the run length RL can be represented by RL = 64 × M + T, the termination code corresponds to the run length from 0 to 63, and the makeup code is 6
It is an integer multiple of 4 and corresponds to a maximum run length of 2560. Further, the code code is divided into one that expresses “white” and one that expresses “black”.

【0009】ところで、ラインごとの符号化を行う際、
最初のコードとして必ず白の符号を出す約束になってい
る。すなわち、ラインの最初に参照する符号の色は、
「白」と決めてある。従って、「黒」の画素から始まる
場合には、最初にランレングス0の白の符号を伝送す
る。
By the way, when performing encoding for each line,
The promise is to always give the white code as the first code. That is, the color of the code referenced at the beginning of the line is
It is decided to be "white". Therefore, when starting from a "black" pixel, the white code of run length 0 is transmitted first.

【0010】[0010]

【表1】 [Table 1]

【0011】[0011]

【表2】 図6は、ファクシミリ装置における圧縮処理および伸長
処理を行う従来の符号化復号化装置の一例の要部を示す
ブロック構成図である。演算処理、データ処理、および
各部の制御処理等を行うCPU(中央演算処理装置)1
00と、送信時に読み取った原稿を2値画像データ(画
データ)にしたものを蓄える画データメモリ300と、
受信時に受信したデータをパラレル符号にしたものを貯
える符号データメモリ400と、画データを符号データ
に変換するための表3に示す符号化テーブル201、お
よび符号データを画データに変換するための表4に示す
復号化テーブル202が配置格納されるテーブルROM
200と、変換された結果である符号データあるいは画
データをFIFO(ファーストインファートアウト)管
理されるFIFOメモリ500とがバス600で接続さ
れている。
[Table 2] FIG. 6 is a block diagram showing a main part of an example of a conventional coding / decoding apparatus that performs compression processing and decompression processing in a facsimile apparatus. CPU (Central Processing Unit) 1 which performs arithmetic processing, data processing, control processing of each part, and the like
00, and an image data memory 300 for storing a binary image data (image data) of the original read at the time of transmission,
A code data memory 400 for storing parallel data of received data at the time of reception, an encoding table 201 shown in Table 3 for converting image data into code data, and a table for converting code data into image data. Table ROM in which the decoding table 202 shown in FIG.
200 is connected to a FIFO memory 500 in which code data or image data obtained as a result of conversion is FIFO (first-infer-out) managed.

【0012】テーブルROM200内には、あらかじ
め、送信する原稿の画データを基に後述する符号化方式
によって求めるべき符号の情報と、受信した符号の種類
により後述する復号化方式によって求めるべき画データ
の情報を得るための情報を記憶させてある。
In the table ROM 200, information on a code to be obtained in advance by the encoding method described later based on the image data of the original to be transmitted and image data to be obtained by the decoding method described later according to the type of the received code are stored. The information for obtaining information is stored.

【0013】[0013]

【表3】 [Table 3]

【0014】[0014]

【表4】 まず、圧縮処理について、図7、図8(a)、(b)お
よび(c)、ならびに図9(a)および(b)を参照し
て説明する。
[Table 4] First, the compression process will be described with reference to FIGS. 7, 8A, 8B and 8C, and 9A and 9B.

【0015】まず、スキャナ等で原稿を読み取る。読み
取ったデータを2値画像データ(画データ)に変換し、
画データメモリ300に貯える。
First, a document is read by a scanner or the like. Convert the read data into binary image data (image data),
It is stored in the image data memory 300.

【0016】以降、図7に示した符号化処理の流れ図の
通りの処理を行い、以下のようになる。
Thereafter, the processing as shown in the flow chart of the encoding processing shown in FIG. 7 is performed, and the processing is as follows.

【0017】始めに、CPU100は、画データメモリ
300内から画データを読み出し、ランレングスRLを
求める(ステップS11)。
First, the CPU 100 reads the image data from the image data memory 300 and obtains the run length RL (step S11).

【0018】次に、CPU100は、ランレングスRL
の情報から図8(a)に示すように、画データが白であ
るか黒であるか示すビットAD7と、メークアップ符号
の生成かターミネーション符号の生成かを示すビットA
D8と、メークアップ符号であればランレングスRLを
64で割った商を、ターミネーション符号であればラン
レングスRLを64で割った余りを表すビットフィール
ドAD9と、最下位ビットに「0」とで構成する値を生
成する。そして、この値に符号化テーブル201のベー
スアドレスを加算してアドレスADR3を生成する(ス
テップS12)。
Next, the CPU 100 determines the run length RL.
8A, a bit AD7 indicating whether the image data is white or black, and a bit A indicating whether the makeup code or the termination code is generated, as shown in FIG.
D8, a bit field AD9 representing the quotient of the run length RL divided by 64 for a make-up code, a remainder obtained by dividing the run length RL by 64 for a termination code, and "0" for the least significant bit. Generate the value to configure. Then, the base address of the encoding table 201 is added to this value to generate the address ADR3 (step S12).

【0019】次に、CPU100は、テーブルROM2
00のアドレスADR3の指す領域の符号情報データD
T3を参照する(ステップS13)。
Next, the CPU 100 uses the table ROM 2
Code information data D in the area indicated by the address ADR3 of 00
Reference is made to T3 (step S13).

【0020】そして、参照したデータDT3の情報を基
に符号データを生成し、FIFOメモリ500に順次貯
える。
Then, code data is generated based on the information of the referred data DT3, and is sequentially stored in the FIFO memory 500.

【0021】次に、図7のステップS12のアドレスA
DR3の生成について、図8(b)および(c)を参照
して説明する。
Next, address A in step S12 of FIG.
Generation of DR3 will be described with reference to FIGS. 8B and 8C.

【0022】メークアップ符号を生成する場合には、図
8(b)に示すように、ビット8にメークアップ符号で
あることを示す「1」をセットする。
When a make-up code is generated, "1" indicating that it is a make-up code is set in bit 8 as shown in FIG. 8 (b).

【0023】そして、ランレングスRLを64で割った
商をビット2からビット7にセットする。つまり、2進
数で表現されるランレングスRLのビット6からビット
11をセットするものである。これは、CCITTの勧
告T.4では最大2560のランレングスまで対応すれ
ばよいことから、ランレングスRLのビット12からビ
ット15は常に「0000」であるため、6ビットあれ
ば表現可能である。
Then, the quotient obtained by dividing the run length RL by 64 is set in bit 2 to bit 7. That is, the bits 6 to 11 of the run length RL expressed by a binary number are set. This is CCITT Recommendation T. In the case of 4, the maximum run length of 2560 is required. Therefore, since bits 12 to 15 of the run length RL are always "0000", 6 bits can be used for expression.

【0024】さらに、ビット1に対象となる画データが
白ならば「0」をセットし、黒ならば「1」をセットす
る。そして、ビット0を「0」として、前述したように
セットされ生成された値にテーブルROM200内の符
号化テーブル201のベースアドレスを加算し、これを
アドレスADR3とするものである。
Furthermore, if the target image data is white, "0" is set in bit 1, and if it is black, "1" is set. Then, with bit 0 set to "0", the base address of the encoding table 201 in the table ROM 200 is added to the value set and generated as described above, and this is made the address ADR3.

【0025】また、ターミネーション符号を生成する場
合には、図8(c)に示すように、ビット8にターミネ
ーション符号であることを示す「0」をセットする。そ
して、ランレングスRLを64で割った余りをビット2
からビット7にセットする。つまり、2進数で表現され
るランレングスRLのビット0からビット5をセットす
るものである。これは、ターミネーション符号は最大6
3のランレングスRLまで対応することから6ビットあ
れば表現可能である。
When a termination code is generated, bit 0 is set to "0" indicating the termination code, as shown in FIG. 8 (c). Then, the remainder obtained by dividing the run length RL by 64 is bit 2
Set to bit 7. That is, bit 0 to bit 5 of the run length RL represented by a binary number are set. This has a maximum termination code of 6
Since up to 3 run lengths RL are supported, 6 bits can be used for expression.

【0026】さらに、ビット1に対象となる画データが
白ならば「0」をセットし、黒ならば「1」をセットす
る。そして、ビット0を「0」として、前述したように
セットされ生成された値にテーブルROM200内の符
号化テーブル201のベースアドレスを加算し、これを
アドレスADR3とするものである。
Furthermore, if bit 1 is white, the bit 1 is set to "0", and if black, it is set to "1". Then, with bit 0 set to "0", the base address of the encoding table 201 in the table ROM 200 is added to the value set and generated as described above, and this is made the address ADR3.

【0027】次に、図7のステップS13で読み出され
るデータDT3について説明する。
Next, the data DT3 read in step S13 of FIG. 7 will be described.

【0028】ここで、参照されるテーブルROM200
内の符号データ情報は1ワードで、図9(a)および
(b)に示すように1バイト目に符号長、2バイト目に
符号が最下位ビットから順に右詰めで記憶されている。
Here, the table ROM 200 to be referred to
The code data information therein is one word, and as shown in FIGS. 9A and 9B, the code length is stored in the first byte and the code is stored in the second byte, right-justified in order from the least significant bit.

【0029】ここで、CCITTの勧告T.4における
ランレングスコードは、符号が8ビット以上であっても
その9ビット目以上は常に0となっていることから、1
バイト目には他の場合と同様に符号長を、2バイト目に
は8ビット目までの符号を記憶させておく。そしてテー
ブルのこの領域を参照する場合には、2バイト目の符号
データに1バイト目の符号長から8減算した値のビット
数分の「0」を付加して符号とするものである。
CCITT Recommendation T. The run-length code in 4 is always 0 for the 9th bit and above even if the code is 8 bits or above, so 1
As in the other cases, the code length is stored in the byte, and the code up to the 8th bit is stored in the second byte. When referring to this area of the table, "0" for the number of bits of the value obtained by subtracting 8 from the code length of the first byte is added to the code data of the second byte to form a code.

【0030】例として、画データが「00000000
0000001100111・・」の場合の符号化処理
について説明する。符号化のためのテーブルベースアド
レスは0000Hとする。
As an example, the image data is "00000000".
The encoding process in the case of "000000100111111 ..." will be described. The table base address for encoding is 0000H.

【0031】まず、CPU100は、画データメモリ3
00から読み出した画データの最初の白の連続する画素
数を計数すると「14」であるので、ランレングスRL
は、2進数16ビットで表現すると、 RL=0000 0000 0000 1110 となる(ステップS11)。
First, the CPU 100 operates the image data memory 3
When the number of consecutive pixels of the first white of the image data read out from 00 is counted, it is "14", so the run length RL
When expressed by a binary number of 16 bits, RL = 0000 0000 0000 1110 (step S11).

【0032】次に、CPU100は、ランレングスRL
が64以下であるのでターミネーション符号のみを生成
する。従って、画素の色が白であるのでビット8を
「0」に、符号の種類を示すビット7を「0」に、ラン
レングスRLのビット0からビット5をビット1からビ
ット6に、ビット0を「0」にセットした値 0000 0000 0001 1100(001C
H) に符号化テーブルベースアドレス(0000H)を加算
し、テーブル参照アドレスとして 001CH+0000H=001CH を生成する(ステップS12)。
Next, the CPU 100 determines the run length RL.
Is 64 or less, only the termination code is generated. Therefore, since the pixel color is white, bit 8 is set to "0", bit 7 indicating the type of code is set to "0", bit 0 to bit 5 of run length RL is changed from bit 1 to bit 6, and bit 0 Set to "0" 0000 0000 0001 1100 (001C
H) is added with the encoding table base address (0000H) to generate 001CH + 0000H = 001CH as a table reference address (step S12).

【0033】次に、CPU100は、テーブルROM2
00のアドレス001CHの領域の符号情報データを参
照する(ステップS13)。
Next, the CPU 100 uses the table ROM 2
The code information data of the area of address 001CH of 00 is referred to (step S13).

【0034】参照したデータは、表3より、「060B
H」であることより、符号長は上位8ビットで表されて
いる通り「6」であり、符号は下位8ビットで表されて
いる「0BH=0000 1011」のうち下位ビット
から順に6ビット分、つまり「110100」である。
この符号「110100」をFIFOメモリ500に送
出する(ステップS14)。
The data referred to is "060B" from Table 3.
Since it is “H”, the code length is “6” as represented by the upper 8 bits, and the code is 6 bits in order from the lower bit of “0BH = 0000 1011” represented by the lower 8 bits. , That is, “110100”.
This code "110100" is sent to the FIFO memory 500 (step S14).

【0035】以降、次に続く画データの黒の画素に対し
符号化を行い、次に白の符号化を行いという具合に順次
符号化を行っていけばよい。
After that, the black pixels of the following image data are coded, then the white pixels are coded, and so on.

【0036】次に、伸長処理について図10ならびに図
11(a)、(b)および(c)を参照して説明する。
Next, the decompression process will be described with reference to FIGS. 10 and 11 (a), (b) and (c).

【0037】まず図外のモデム等により受信したシリア
ル符号データをパラレル符号データ(符号データ)に変
換し、符号データメモリ400に貯える。
First, serial code data received by a modem (not shown) is converted into parallel code data (code data) and stored in the code data memory 400.

【0038】以降、図10に示した復号化処理のフロー
の示す通り、以下のようになる。
After that, as shown in the flow of the decoding process shown in FIG.

【0039】はじめに、CPU100は、符号データメ
モリ400から符号データを読み出す。そして、読み出
した符号データの先頭から連続した「0」の数をnと
し、連続する「0」の後に検出される「1」の次の符号
(0または1)をmとして、「2×n+m」の値に復号
化テーブル202のベースアドレスを加算してアドレス
ADR4を生成する(ステップS21)。
First, the CPU 100 reads code data from the code data memory 400. Then, the number of consecutive "0" s from the beginning of the read code data is n, and the code (0 or 1) next to "1" detected after the consecutive "0" s is m, and "2 × n + m" The base address of the decoding table 202 is added to the value of “” to generate the address ADR4 (step S21).

【0040】次に、テーブルROM200内のアドレス
ADR4の指す領域からデータDT4を参照する(ステ
ップS22)。
Next, the data DT4 is referenced from the area indicated by the address ADR4 in the table ROM 200 (step S22).

【0041】次に、CPU100は、このステップS2
3の処理に入る直前に参照したデータの情報が最終的に
得たい画データ情報であるか、次に参照すべきテーブル
ROM200のアドレスを生成するためのインデックス
データであるかを、データの第8ビットの値により判定
する。例えば、ステップS22の処理からこのステップ
S23の処理に移ってきた場合にはステップS22で参
照したデータDT4を判定対象とし、後述するステップ
S28からこのステップS23の処理に移ってきた場合
にはステップS28で参照したデータDT6を判定対象
とする。そして、判定した結果、最終的な画データ情報
であればステップS25の処理に移り、違う場合にはス
テップS24の処理に移る(ステップS23)。
Next, the CPU 100 executes this step S2.
It is determined whether the information of the data referred to immediately before the processing of No. 3 is the image data information to be finally obtained or the index data for generating the address of the table ROM 200 to be referred to next, in the eighth data. Judge by the bit value. For example, when the process of step S22 is shifted to the process of step S23, the data DT4 referred to in step S22 is set as the determination target, and when the process of step S23 described later is shifted to the process of step S23, step S28 is performed. The data DT6 referred to in step 1 is set as the determination target. As a result of the determination, if it is the final image data information, the process proceeds to step S25, and if not, the process proceeds to step S24 (step S23).

【0042】次に、CPU100は、参照したデータD
T4がインデックスデータであるのでこのデータDT4
の情報を基に、次に参照すべきテーブルのアドレスAD
R5を生成する(ステップS24)。
Next, the CPU 100 refers to the data D referred to.
Since T4 is index data, this data DT4
Address AD of the table to be referred to next based on the information of
R5 is generated (step S24).

【0043】次に、ステップS24で生成されたアドレ
スADR5の指すテーブルROM200内の領域から、
次の画データ情報を参照するアドレス生成のためのイン
デックスデータとなるデータDT5を参照する(ステッ
プS26)。
Next, from the area in the table ROM 200 indicated by the address ADR5 generated in step S24,
Next, the data DT5 which is the index data for generating the address for referring to the next image data information is referred to (step S26).

【0044】次に、CPU100は、ステップS26で
参照したインデックスデータであるデータDT5の情報
を基に、次に参照すべきテーブルROM200のアドレ
スADR6を生成する(ステップS27)。
Next, the CPU 100 generates the address ADR6 of the table ROM 200 to be referred to next based on the information of the data DT5 which is the index data referred to in step S26 (step S27).

【0045】そして、ステップS27で生成されたアド
レスADR6の指すテーブルROM200の領域から、
画データ情報DT6を参照する(ステップS28)。そ
して、この画データ情報DT6を新たにステップS23
の処理における最終的な画データ情報であることを判定
する対象データとしてステップS23の処理に移り、以
降ステップS23において最終的な画データ情報が検出
されるまでステップS23からステップS28の処理を
繰り返す。
Then, from the area of the table ROM 200 pointed to by the address ADR6 generated in step S27,
The image data information DT6 is referred to (step S28). Then, this image data information DT6 is newly added in step S23.
In step S23, the process proceeds to step S23 as the target data for determining that the image data information is the final image data information, and steps S23 to S28 are repeated until the final image data information is detected in step S23.

【0046】そして、ステップS23で、最終的な画デ
ータ情報であると判定されたデータを基に、画データを
生成し、FIFOメモリ500に順次貯える(ステップ
S25)。
Then, in step S23, the image data is generated based on the data determined to be the final image data information, and is sequentially stored in the FIFO memory 500 (step S25).

【0047】次に、図10のステップS22、S26お
よびS28で参照されるテーブルROM200内のデー
タについて、図11(a)、(b)および(c)を参照
して説明する。
Next, the data in the table ROM 200 referred to in steps S22, S26 and S28 of FIG. 10 will be described with reference to FIGS. 11 (a), 11 (b) and 11 (c).

【0048】テーブルROM200内の復号化テーブル
202から参照されるデータはバイトデータで、図11
(a)、(b)および(c)に示すように、ビット7に
最終的な画データ情報であるか否かを判定する構成をと
っている。図11(a)および(b)のように、ビット
7が「1」の場合には最終データであることを示し、図
11(c)のように「0」の場合にはインデックスデー
タであることを示している。
The data referred from the decoding table 202 in the table ROM 200 is byte data, and the data shown in FIG.
As shown in (a), (b) and (c), bit 7 has a configuration for determining whether or not it is the final image data information. As shown in FIGS. 11A and 11B, when the bit 7 is “1”, it indicates the final data, and when it is “0” as shown in FIG. 11C, it is the index data. It is shown that.

【0049】データが画データ情報である場合には、図
11(a)および(b)に示すように、ビット6が
「0」ならばターミネーション符号、「1」ならばメー
クアップ符号であることを示し、ビット0からビット5
にメークアップであれば対応する画データのランレング
スRLを64で割った商を、ターミネーション符号であ
ればその余りを示す。
When the data is image data information, as shown in FIGS. 11A and 11B, if bit 6 is "0", it is a termination code, and if it is "1", it is a make-up code. Indicates bit 0 to bit 5
In case of makeup, the run length RL of the corresponding image data is divided by 64, and in case of the termination code, the remainder is shown.

【0050】一方、データがインデックスデータである
場合には、図11(c)に示すように、ビット0からビ
ット6のデータは図10のステップS24およびS27
で生成されるアドレスのためのインデックスデータとす
る。
On the other hand, when the data is index data, as shown in FIG. 11 (c), the data of bits 0 to 6 are processed in steps S24 and S27 of FIG.
It is used as index data for the address generated in.

【0051】次に、図10のステップS24とステップ
S27でのアドレス生成方法を述べる。
Next, the address generation method in steps S24 and S27 of FIG. 10 will be described.

【0052】ステップS24においては、ステップS2
2またはステップS28で参照した図11(c)の形式
をとるインデックスデータのビット0からビット7の値
を、テーブル参照の現アドレスADR4と加算して次の
アドレスADR5を生成する。
In step S24, step S2
2 or the value of bits 0 to 7 of the index data having the format of FIG. 11C referenced in step S28 is added to the current address ADR4 of the table reference to generate the next address ADR5.

【0053】ステップS27においては、ステップS2
6で参照した図11(c)の形式をとるデータのビット
0からビット7の値分の符号を読み出し、その値に1加
算してテーブル参照の現アドレスADR5に加え次のア
ドレスADR6を生成する。
In step S27, step S2
The code corresponding to the value of bit 0 to bit 7 of the data having the format of FIG. 11 (c) referred to in FIG. .

【0054】例として、符号データ「11010011
0111・・・」を復号化する場合について説明する。
復号化のための白用テーブルベースアドレスは「020
0H」、黒用テーブルベースアドレスは「0300H」
とする。
As an example, code data “11010011”
The case of decoding "0111 ..." Will be described.
The white table base address for decryption is "020
0H ", black table base address is" 0300H "
And

【0055】まず、符号データの先頭から「0」を計数
するがこの場合には「0」は無いのでn=0となる。そ
して、最初に検出する「1」の次の符号は「1」である
のでm=1となる。また、符号の先頭は白から始まるこ
とから生成アドレスは、 2×0+1+0200H=0201H となる(ステップS21)。
First, "0" is counted from the beginning of the code data. In this case, since "0" does not exist, n = 0. Since the code next to the first detected "1" is "1", m = 1. Further, since the head of the code starts from white, the generated address is 2 × 0 + 1 + 0200H = 0201H (step S21).

【0056】次に、表4に示すテーブルROM200内
のアドレス「0201H」の指す領域からデータ「14
H」を参照する(ステップS22)。
Next, data "14" is read from the area indicated by the address "0201H" in the table ROM 200 shown in Table 4.
"H" is referred to (step S22).

【0057】次に、CPU100は、参照したデータ
「14H」のビット8は「0」であることから、このデ
ータはインデックスデータであると判定する(ステップ
S23)。
Next, since the bit 8 of the referred data "14H" is "0", the CPU 100 determines that this data is index data (step S23).

【0058】CPU100は、データ「14H」と現テ
ーブル参照アドレスである「0201H」とを加算す
る。従って、加算結果である 14H+0201H=0215H が次のテーブルROM200の参照用アドレスとなる
(ステップS24)。
The CPU 100 adds the data "14H" and the current table reference address "0201H". Therefore, 14H + 0201H = 0215H, which is the addition result, becomes the reference address of the next table ROM 200 (step S24).

【0059】次に、アドレス「0215H」の指すテー
ブルROM200内の領域を参照する。この参照したデ
ータ「02H」が次のアドレス生成のためのインデック
スデータとなる(ステップS26)。
Next, the area in the table ROM 200 indicated by the address "0215H" is referred to. The referenced data "02H" becomes index data for generating the next address (step S26).

【0060】CPU100は参照したインデックスデー
タが「02H」であるので、符号データのmの次にある
3番目と4番目の2ビット分の符号データ「01」に1
加算して、「10=2H」を得る。そして、現テーブル
参照アドレスにこの値を加算し、つまり 2H+0215H=0217H を次の参照用アドレスとする(ステップS27)。
Since the index data referred to by the CPU 100 is "02H", 1 is added to the code data "01" for the 2nd and 3rd bits of the 3rd and 4th bits next to m of the code data.
Addition is performed to obtain "10 = 2H". Then, this value is added to the current table reference address, that is, 2H + 0215H = 0217H is set as the next reference address (step S27).

【0061】CPU100は、テーブルROM200の
アドレス「0217H」の領域を参照する(ステップS
28)。
The CPU 100 refers to the area of the address "0217H" of the table ROM 200 (step S).
28).

【0062】参照したデータは、「31H」であり、ビ
ット8は「0」であるので、このデータはインデックス
データであると判定する(ステップS23)。
Since the referred data is "31H" and the bit 8 is "0", it is determined that this data is index data (step S23).

【0063】CPU100は、データ「31H」と現テ
ーブル参照アドレスである「0217H」とを加算す
る。従って、加算結果である 31H+0217H=0248H が次のテーブルROM200の参照用アドレスとなる
(ステップS24)。
The CPU 100 adds the data "31H" and the current table reference address "0217H". Therefore, the addition result, 31H + 0217H = 0248H, becomes the reference address of the next table ROM 200 (step S24).

【0064】次に、アドレス「0248H」の指すテー
ブルROM200内の領域を参照する。この参照したデ
ータ「01H」が次のアドレス生成のためのインデック
スデータとなる(ステップS26)。
Next, the area in the table ROM 200 indicated by the address "0248H" is referred to. The referred data "01H" becomes index data for the next address generation (step S26).

【0065】CPU100は、参照したインデックスデ
ータが「01H」であるので、符号データの5番目の1
ビット分である符号データ「0」に1加算して、「1」
を得る。そして、現テーブル参照アドレスにこの値を加
算し、つまり 1+0248H=0249H を次の参照用アドレスとする(ステップS27)。
Since the index data referred to by the CPU 100 is "01H", the first 1 of the code data
Adds 1 to the code data “0” which is the number of bits to obtain “1”
Get. Then, this value is added to the current table reference address, that is, 1 + 0248H = 0249H is set as the next reference address (step S27).

【0066】CPU100は、テーブルROM200の
アドレス「0249H」の領域を参照する(ステップS
26)。
The CPU 100 refers to the area of the address "0249H" of the table ROM 200 (step S).
26).

【0067】参照したデータは「45H」でありビット
8は「0」であるので、このデータはインデックスデー
タであると判定する(ステップS23)。
Since the referred data is "45H" and the bit 8 is "0", it is determined that this data is index data (step S23).

【0068】CPU100は、データ「45H」と現テ
ーブル参照アドレスである「0249H」とを加算す
る。従って、加算結果である 45H+0249H=028EH が次のテーブルROM200の参照用アドレスとなる
(ステップS24)。
The CPU 100 adds the data "45H" and the current table reference address "0249H". Therefore, the addition result of 45H + 0249H = 028EH becomes the reference address of the next table ROM 200 (step S24).

【0069】次に、アドレス「028EH」の指すテー
ブルROM200内の領域を参照する。この参照したデ
ータ「01H」が次のアドレス生成のためのインデック
スデータとなる(ステップS26)。
Next, the area in the table ROM 200 indicated by the address "028EH" is referred to. The referred data "01H" becomes index data for the next address generation (step S26).

【0070】CPU100は、参照したインデックスデ
ータが「01H」であるので、符号データの5番目の1
ビット分である符号データ「0」に1加算して、「1」
を得る。そして、現テーブル参照アドレスにこの値を加
算し、つまり 1+028EH=028FH を次の参照用アドレスとする(ステップS27)。
Since the index data referred to by the CPU 100 is "01H", the first 1 of the code data
Adds 1 to the code data “0” which is the number of bits to obtain “1”
Get. Then, this value is added to the current table reference address, that is, 1 + 028EH = 028FH is set as the next reference address (step S27).

【0071】CPU100は、テーブルROM200の
アドレス「028F」の領域を参照する(ステップS2
8)。
The CPU 100 refers to the area of the address "028F" of the table ROM 200 (step S2).
8).

【0072】参照したデータは「8EH」でありビット
8は「1」であるので、このデータは最終的に求める画
データ情報であると判定する(ステップS23)。
Since the referred data is "8EH" and the bit 8 is "1", it is judged that this data is the finally obtained image data information (step S23).

【0073】最終的な画データ情報であると判定された
データ「8EH」のビット7が「0」であるので、この
符号はターミネーション符号であることがわかる。そし
て、データの下位6ビットがランレングスRLとなるの
で、この画データは白が14ビット連続したものである
ことがわかる。従って、CPU100は、FIFOメモ
リ500に「00000000000000」を送出す
る(ステップS25)。
Since the bit 7 of the data "8EH" determined to be the final image data information is "0", it can be seen that this code is a termination code. Then, since the lower 6 bits of the data become the run length RL, it can be seen that this image data has 14 consecutive white bits. Therefore, the CPU 100 sends "0000000000000000" to the FIFO memory 500 (step S25).

【0074】以降、符号データの7番目のビットを先頭
として同様に黒の画データの復号化を、次に白をという
具合に順次行っていけばよい。
After that, the black image data may be similarly decoded with the seventh bit of the code data as the head, and then white, and so on.

【0075】ここに、述べた例ではテーブルROM20
0の参照を7回行うことで画データ情報を得ることがで
きた。
In the example described here, the table ROM 20
Image data information could be obtained by referring to 0 seven times.

【0076】このように、図10のステップS23で判
定された結果、最終データでない場合に繰り返される処
理は、対象となる符号の符号長により異なるもので、復
号化処理の性質から最小1回から最大9回となる。
As described above, as a result of the determination in step S23 of FIG. 10, the process repeated when it is not the final data differs depending on the code length of the target code, and from the minimum of once from the nature of the decoding process. Up to 9 times.

【0077】[0077]

【発明が解決しようとする課題】以上説明したように、
従来のファクシミリ装置における符号化復号化装置に利
用されるテーブルの引用方式では、符号化処理における
テーブル参照回数は常に1回で固定されているが、復号
化処理におけるテーブル参照回数は、符号長により異な
るため最低1回から最高9回であり一定でない。つま
り、符号データから画データを再生する処理時間が不定
となってしまう。
As described above,
In the conventional table citation method used in the encoding / decoding device of the facsimile apparatus, the number of table references in the encoding process is always fixed at once, but the number of table references in the decoding process depends on the code length. Since it is different, it is at least 1 to 9 times, and is not constant. That is, the processing time for reproducing the image data from the coded data becomes indefinite.

【0078】これにより、復号結果である画データの情
報をテーブルから最終的に読み出すのに同期して、この
画データの情報を画素の形式に加工するなどの復号化に
係わるハードウェアのタイミイグ速度設計が、難しく複
雑なものとなる欠点があった。
Thus, in synchronization with the final reading of the information of the image data as the decoding result from the table, the timing speed of the hardware relating to the decoding such as processing the information of the image data into the pixel format The drawback was that the design was difficult and complicated.

【0079】また、このような複雑さを回避するため
に、ハードウェアのタイミイグ速度設計が最長時間に合
わせた状態、つまり従来の場合では最大9回のテーブル
参照時間に合わせた状態となり、性能が上がらない欠点
もあった。
Further, in order to avoid such complexity, the timing design of the hardware is adjusted to the longest time, that is, in the conventional case, it is adjusted to the table reference time of 9 times at maximum, and the performance is improved. There were some drawbacks that didn't go up.

【0080】本発明の目的は、前記の欠点を除去するこ
とにより、復号化処理を安定させ、ハードウェアの設計
が簡単で、かつ性能を向上させることができるテーブル
引用方式を有するファクシミリ装置の符号化復号化装置
を提供することにある。
It is an object of the present invention to eliminate the above-mentioned drawbacks, thereby stabilizing the decoding process, simplifying the hardware design, and improving the performance of a facsimile apparatus having a table reference system. An object of the present invention is to provide a decoding / decoding device.

【0081】[0081]

【課題を解決するための手段】本発明は、符号化テーブ
ルおよび復号化テーブルが格納されたテーブル記憶手段
と、前記符号化テーブルまたは前記復号化テーブルの参
照アドレスを生成する手段、および生成した参照アドレ
スに対応する符号データを読み出して符号化または復号
化を行う手段を含む処理手段とを備えたファクシミリ装
置の符号化復号化装置において、前記復号化テーブル
は、符号長情報を格納した第一の領域と、色情報、メー
クアップ符号化またはターミネート符号化の符号の種別
情報およびランレングス情報とを格納した第二の領域か
ら構成され、前記復号化テーブルの参照アドレスは、符
号データの先頭から連続した「0」の個数nに前記第二
の領域を示すためのアドレスバイアス値を加えた値を表
す第一のビットフィールドと、前記符号データの色を示
す第二のビットフィールドと、前記符号データの所定の
ビット数である第三のビットフィールドを含む情報ワー
ドを基に生成される構成であり、前記処理手段は、復号
化処理時に、符号データの先頭から連続する「0」の個
数nを求める計数手段と、この計数した「0」の個数を
用い前記復号化テーブルの参照アドレスを生成する参照
アドレス生成手段とを含むことを特徴とする。
According to the present invention, table storage means storing an encoding table and a decoding table, means for generating a reference address of the encoding table or the decoding table, and the generated reference. in coding and decoding apparatus of a facsimile apparatus and a processing means including means for encoding or decoding reads the code data corresponding to the address, the decoding table
Is the first area that stores the code length information, and the color information and
Type of code for Kupe-coding or terminate-coding
A second area that stores information and run length information
And the reference address of the decoding table is the number n of consecutive "0" s from the beginning of the coded data .
Area, a first bit field representing a value added with an address bias value , a second bit field indicating the color of the code data, and a third bit that is a predetermined number of bits of the code data. The processing means is configured to be generated based on an information word including a field, and the processing means obtains the number n of consecutive "0" s from the beginning of the code data at the time of decoding processing, and the counted "0". And a reference address generating means for generating the reference address of the decoding table by using the number of

【0082】[0082]

【作用】復号化テーブルの参照アドレスは、符号データ
の先頭から連続した「0」の個数nに1を加えた値を表
す第一のビットフィールドを有している。
The reference address of the decoding table has a first bit field representing a value obtained by adding 1 to the number n of "0" s consecutive from the head of the code data.

【0083】すなわち、一つの符号データの内、連続す
る「0」の後に検出される「1」以降の残りの符号デー
タのビット数、つまりn+2ビット目以降の残りの符号
コードのビット数を示しており、次に復号化する符号デ
ータの先頭位置を決める情報となる。
That is, the number of bits of the remaining code data after "1" detected after consecutive "0" in one code data, that is, the number of bits of the remaining code code after the (n + 2) th bit is shown. This is information for determining the start position of the code data to be decoded next.

【0084】従って、処理手段が復号化テーブルを参照
するのは、画データ情報からランレングスRLを計算す
るときと、それに基づいて求めた参照アドレスに対する
データを参照するときとの常に2回に限定することがで
きる。
Therefore, the processing means refers to the decoding table only twice, when the run length RL is calculated from the image data information and when the data for the reference address obtained based on the run length RL is referred to. can do.

【0085】[0085]

【実施例】以下、本発明の実施例について図面を参照し
て説明する。
Embodiments of the present invention will be described below with reference to the drawings.

【0086】図1は本発明の第一実施例を示すブロック
構成図、図2はその復号化処理手順を示す流れ図、図3
(a)、(b)および(c)はその復号化テーブルの参
照アドレスの形式を示す図、ならびに図4(a)および
(b)はその復号化テーブルのデータ形式を示す図であ
る。また、表5はその復号化テーブル202aの一例を
示す。なお、符号化テーブル201は従来例で示した表
3と同じである。
FIG. 1 is a block diagram showing the first embodiment of the present invention, FIG. 2 is a flow chart showing the decoding processing procedure, and FIG.
(A), (b) and (c) are diagrams showing the format of the reference address of the decoding table, and FIGS. 4 (a) and (b) are diagrams showing the data format of the decoding table. Table 5 shows an example of the decoding table 202a. The coding table 201 is the same as Table 3 shown in the conventional example.

【0087】図1によると、本第一実施例は、符号化テ
ーブル201および復号化テーブル202aが格納され
たテーブル記憶手段としてのテーブルROM200a
と、符号化テーブル201および復号化テーブル202
aの参照アドレスを生成する手段、および生成した参照
アドレスに対応する符号データを読み出して符号化およ
び復号化を行う手段を含む処理手段としてのCPU10
0aと、画データメモリ300と、符号データメモリ4
00と、FIFOメモリ500と、バス600とを備え
た符号化復号化装置において、本発明の特徴とするとこ
ろの、復号化テーブル202aの参照アドレスは、図3
(a)および(b)に示すように、符号データの先頭か
ら連続した「0」の個数nに1を加えた値を表す第一の
ビットフィールド(AD4)と、前記符号データの色を
示す第二のビット(AD5)と、前記符号データの所定
のビット数である第三のビットフィールド(AD6)を
含む情報ワードを基に生成される構成であり、CPU1
00aは、復号化処理時に、符号データの先頭から連続
する「0」の個数nを求める計数手段と、この計数した
「0」の個数を用い復号化テーブル202aの参照アド
レスを生成するアドレス生成手段とを含んでいる。
According to FIG. 1, in the first embodiment, a table ROM 200a as a table storage means in which an encoding table 201 and a decoding table 202a are stored.
And an encoding table 201 and a decoding table 202
CPU 10 as processing means including means for generating the reference address of a and means for reading code data corresponding to the generated reference address to perform encoding and decoding.
0a, the image data memory 300, and the code data memory 4
00, a FIFO memory 500, and a bus 600, the reference address of the decoding table 202a, which is a feature of the present invention, is as shown in FIG.
As shown in (a) and (b), a first bit field (AD4) representing a value obtained by adding 1 to the number n of "0" s consecutive from the beginning of the code data and the color of the code data are shown. The CPU 1 is configured to be generated based on an information word including a second bit (AD5) and a third bit field (AD6) that is a predetermined number of bits of the code data.
Reference numeral 00a is a counting means for obtaining the number n of consecutive "0" s from the beginning of the code data during the decoding process, and an address generating means for generating a reference address of the decoding table 202a using the counted number of "0s". Includes and.

【0088】次に、本第一実施例の動作について説明す
る。
Next, the operation of the first embodiment will be described.

【0089】なお、テーブルROM200aには、あら
かじめ表5に示す復号化テーブル202aが格納されて
いるものとする。
It is assumed that the table ROM 200a stores the decoding table 202a shown in Table 5 in advance.

【0090】[0090]

【表5】 本第一実施例の符号化処理については、前述の従来例の
場合と同様である。
[Table 5] The encoding process of the first embodiment is the same as that of the above-mentioned conventional example.

【0091】次に、伸長処理について、図2、図3
(a)、(b)および(c)、ならびに図4(a)およ
び(b)を参照して説明する。
Next, the decompression process will be described with reference to FIGS.
A description will be given with reference to (a), (b) and (c) and FIGS. 4 (a) and 4 (b).

【0092】まず、従来例と同様にモデム等により受信
したシリアル符号データをパラレル符号データ(符号デ
ータ)に変換し、図1に示す符号データメモリ400に
貯える。
First, similarly to the conventional example, serial code data received by a modem or the like is converted into parallel code data (code data) and stored in the code data memory 400 shown in FIG.

【0093】以降、図2に示した復号化処理のフローの
示す通り、以下のようになる。
After that, as shown in the flow of the decoding process shown in FIG.

【0094】始めに、CPU100aは、符号データメ
モリ400から符号データを読み出す。そして、読み出
した符号データの先頭から連続した「0」の数をnと
し、このnに1加算した値をAD4、符号の色をAD
5、符号をAD6とした図3に示すような構成をとる値
に、復号化テーブル202aのベースアドレスを加算し
アドレスADR2を生成する(ステップS1)。
First, the CPU 100a reads code data from the code data memory 400. Then, the number of consecutive "0" s from the beginning of the read code data is n, the value obtained by adding 1 to this n is AD4, and the color of the code is AD.
5, the base address of the decoding table 202a is added to the value having the configuration shown in FIG. 3 where the code is AD6 to generate the address ADR2 (step S1).

【0095】次に、テーブルROM200a内のアドレ
スADR2の指す領域からデータDT2を参照する(ス
テップS2)。
Next, the data DT2 is referenced from the area designated by the address ADR2 in the table ROM 200a (step S2).

【0096】次に、CPU100aは、参照したデータ
DT2の情報を基に画データを生成し、FIFOメモリ
500に貯える(ステップS3)。
Next, the CPU 100a generates image data based on the information of the referred data DT2 and stores it in the FIFO memory 500 (step S3).

【0097】また、CPU100aは、参照したデータ
DT2の値に復号化テーブル202aベースアドレスを
加算した値をアドレスとして、テーブルROM200a
を参照する。参照したデータDT2−1は、一つの符号
コードの内、連続する「0」の後に検出される「1」以
降の残りの符号コードのビット数、つまりn+2ビット
目以降の残りの符号コードのビット数を示しており、次
に復号化する符号コードの先頭位置を決める情報となる
(ステップS4)。
Further, the CPU 100a uses the value obtained by adding the base address of the decoding table 202a to the value of the referred data DT2 as the address, and the table ROM 200a.
See The referred data DT2-1 is the number of bits of the remaining code code after "1" detected after a continuous "0" in one code code, that is, the bits of the remaining code code after the (n + 2) th bit. The number indicates the number and serves as information for determining the start position of the code code to be decoded next (step S4).

【0098】次に、図1のステップS1のアドレス生成
方法を述べる。
Next, the address generating method in step S1 of FIG. 1 will be described.

【0099】まず、図3(b)で示すように、符号デー
タの先頭から連続する「0」を計数し、その値をnとす
る。そして、図3(c)に示すように、このnに1加算
した値をビット8から11にセットする。ここで、MH
方式における符号コードにおいて、先頭から連続する
「0」つまりnの値は最大でも7であり、1加算したと
ころで最大8であるので4ビットあればよい。
First, as shown in FIG. 3B, consecutive "0" s are counted from the beginning of the code data, and the value is set to n. Then, as shown in FIG. 3C, the value obtained by adding 1 to this n is set in bits 8 to 11. Where MH
In the code code in the method, the maximum number of consecutive "0" s, that is, the value of n, is 7 from the beginning, and the maximum value is 8 when 1 is added.

【0100】そして、ビット7に対象となる画データが
白ならば「0」を、黒ならば「1」をセットし、ビット
0からビット6に連続する「0」の後に検出される
「1」の次の符号つまりn+2番目から7ビット分の符
号を最下位ビットから順に右詰めにセットする。
If the target image data is white, "0" is set in bit 7, and if it is black, "1" is set, and "1" detected after "0" consecutive from bit 0 to bit 6 is detected. , The code for the 7th bit from the (n + 2) th is set to the right justification from the least significant bit.

【0101】このようにセットされた値に、復号化テー
ブル202aのベースアドレスを加算したものをアドレ
スADR2として生成する。
An address ADR2 is generated by adding the base address of the decoding table 202a to the value thus set.

【0102】次に、図2のステップS2およびS4で読
み出されるROM200a内のデータについて図4
(a)および(b)を用いて説明する。
Next, regarding the data in the ROM 200a read in steps S2 and S4 of FIG.
A description will be given using (a) and (b).

【0103】ステップS2で参照されるデータDT2は
画データ情報である。データDT2は、バイトデータで
参照され、図4(a)に示すように、ビット7が「0」
であれば対象となる符号が白のコードであり、「1」で
あれば黒であることを示し、ビット6が「1」ならば対
象となる符号がメークアップ符号であり、「0」ならば
ターミネーション符号であることを示し、ビット0から
ビット5にメークアップ符号であれば対応する画データ
のランレングスRLを64で割った商を、ターミネーシ
ョン符号であればその余りを示すような構成をとる値
に、復号化テーブル202aのベースアドレスを加算し
てアドレスADR2を生成する。ここで、MH方式にお
ける符号コードにおいては、ランレングスRLについて
は従来例でも述べた通り最大6ビットあれば表現可能で
ある。
The data DT2 referred to in step S2 is image data information. The data DT2 is referred to by byte data, and bit 7 is "0" as shown in FIG. 4 (a).
If it is, the target code is a white code, and if it is "1", it is black. If the bit 6 is "1", the target code is a make-up code, and if it is "0". If it is a termination code, if it is a make-up code from bit 0 to bit 5, the run length RL of the corresponding image data is divided by 64, and if it is a termination code, the remainder is shown. The base address of the decoding table 202a is added to the value to be taken to generate the address ADR2. Here, in the code code in the MH system, the run length RL can be represented by a maximum of 6 bits as described in the conventional example.

【0104】ステップS4で参照されるデータDT2−
1は、図4(b)に示すように、ステップS1、S2お
よびS3の処理で復号化した符号の符号長から、連続す
る「0」の数n+1を引いた値を記憶している。
Data DT2-referenced in step S4
As shown in FIG. 4B, 1 stores a value obtained by subtracting the number n + 1 of consecutive "0" s from the code length of the code decoded in the processes of steps S1, S2 and S3.

【0105】例として、前述の従来例と同様に、符号デ
ータ「110100110111・・・」を復号化する
場合について説明する。復号化テーブル202aのベー
スアドレスは、「0200H」とする。
As an example, the case of decoding coded data “110100110111 ...” Like the above-mentioned conventional example will be described. The base address of the decryption table 202a is “0200H”.

【0106】まず、CPU100aは、符号データメモ
リ400から符号を読み出し、先頭から連続した「0」
を計数する。この場合には「0」は無いのでn=0とな
る。このnに1加算した値をビット8からビット11に
セットし、符号の先頭は白から始まることからビット7
を「0」にセットし、ビット0からビット6に最初に検
出した「1」の次の符号、つまり、n+2番目の符号か
ら7ビット分の符号をLSBでセットすると、 「0000 0001 0110 0101=0165
H」 となり、この値に復号化テーブル202aのベースアド
レスを加算した結果である 0165H+0200H=0365H が生成アドレスとなる(ステップS1)。
First, the CPU 100a reads a code from the code data memory 400, and continuously reads "0" from the beginning.
Is counted. In this case, since there is no "0", n = 0. The value obtained by adding 1 to this n is set in bit 8 to bit 11, and since the beginning of the code starts from white, bit 7
Is set to “0” and the code next to “1” that is first detected from bit 0 to bit 6, that is, the code for 7 bits from the n + 2nd code is set by LSB, “0000 0001 0110 0101 = 0165
H ”, and 0165H + 0200H = 0365H, which is the result of adding the base address of the decoding table 202a to this value, is the generated address (step S1).

【0107】次に、テーブルROM200a内のアドレ
ス「0365H」の指す領域からデータを表6から参照
する(ステップS2)。
Next, the data is referred to from Table 6 from the area designated by the address "0365H" in the table ROM 200a (step S2).

【0108】参照したデータは「0EH」であり、ビッ
ト7は「0」であるので符号の色は白であることを示
し、ビット6が「0」であるので符号の種類はターミネ
ーション符号であることがわかる。そして、データの下
位6ビットがランレングスとなるので、この画データは
白が14ビット連続したものであることがわかる。従っ
て、CPU100aは、FIFOメモリ500に「00
000000000000」を送出する(ステップS
3)。
The data referred to is "0EH" and bit 7 is "0" to indicate that the color of the code is white. Since bit 6 is "0", the type of code is the termination code. I understand. Then, since the lower 6 bits of the data become the run length, it can be seen that this image data has 14 consecutive white bits. Therefore, the CPU 100a stores "00" in the FIFO memory 500.
"000000000000" is transmitted (step S
3).

【0109】また、CPU100aは、参照したデータ
「0EH」に復号化テーブル202aのベースアドレス
を加算した値 0EH+0200H=020EH をアドレスとしてテーブルROM200aを参照する。
参照したデータは「05H」であり、ステップS1、S
2およびS3で復号化された符号コードの符号長はこの
データ値「05H」に計数した「0」の数nビットと最
初に検出した「1」の1ビット分を加算した値、 0+1+05H=06H であることがわかる(ステップS4)。
Further, the CPU 100a refers to the table ROM 200a with the value 0EH + 0200H = 020EH obtained by adding the base address of the decoding table 202a to the referred data "0EH" as an address.
The referred data is "05H", and steps S1 and S
The code length of the code code decoded in 2 and S3 is a value obtained by adding the number n bits of "0" counted to this data value "05H" and one bit of "1" detected first, 0 + 1 + 05H = 06H (Step S4).

【0110】以降、ステップS4で求めた復号化した符
号コードの符号長「06H」から6番目の符号ビット
「1」を先頭として、同様に黒の画データの復号を、次
に白をという具合に順次行っていけばよい。
Thereafter, with the sixth code bit "1" from the code length "06H" of the decoded code code obtained in step S4 as the head, the black image data is similarly decoded, and the white is next. You can go to

【0111】このように、本第一実施例における復号化
処理のテーブル参照回数は、ステップS2における画デ
ータ情報の参照と、ステップS4におけるステップS
1、S2およびS3で処理してきた符号コードの符号長
情報の参照との常に2回である。
As described above, the number of table references in the decoding process in the first embodiment is the same as the reference of the image data information in step S2 and step S4 in step S4.
1, twice with reference to the code length information of the code code processed in S2 and S3.

【0112】次に、本発明の第二実施例について説明す
る。
Next, a second embodiment of the present invention will be described.

【0113】本第二実施例の基本的な構成は図1で示し
た第一実施例と同じである。
The basic construction of the second embodiment is the same as that of the first embodiment shown in FIG.

【0114】その相違点は、表6に示す独自のメークア
ップ符号コードを追加することで、最大ランレングス6
655まで対応可能としたものである。この符号はラン
レングス1792以上2623以下の場合のメークアッ
プ符号と同様に、「白」を表現するコードと「黒」を表
現するコードが共通になっている。
The difference is that the maximum run length of 6 is added by adding the unique makeup code shown in Table 6.
It can handle up to 655. This code has a common code expressing "white" and a code expressing "black" as in the case of the makeup code in the case of run lengths 1792 to 2623.

【0115】[0115]

【表6】 次に、符号化処理の内容について第一実施例と異なる点
を説明する。
[Table 6] Next, the difference between the encoding process and the first embodiment will be described.

【0116】テーブルROM200a内には第一実施例
のテーブルROM200a内のデータに加え、拡張した
符号コードに対応すべく後述する符号化方式および復号
化方式に対応した所定のデータが記憶させてある。
In the table ROM 200a, in addition to the data in the table ROM 200a of the first embodiment, predetermined data corresponding to an encoding system and a decoding system, which will be described later, corresponding to the extended code code is stored.

【0117】本第二実施例の符号処理は、第一実施例と
同様に、従来例と同じく図7に示す処理順序で処理が行
われる。ただし、本第二実施例における図7のステップ
S12のテーブルの参照アドレスADR3の生成につい
ては以下のようになる。
Similar to the first embodiment, the code processing of the second embodiment is performed in the processing order shown in FIG. 7 as in the conventional example. However, the generation of the reference address ADR3 of the table in step S12 of FIG. 7 in the second embodiment is as follows.

【0118】まず、符号化の対象となる画データのラン
レングスRLが2624以上であるか否か判定する。判
定の結果、2624未満であれば従来例の場合と同様に
アドレスを生成する。ただし、従来例で加算した符号化
のためのテーブルのベースアドレスは、第二実施例では
ランレングスが2624未満に対応する符号コード、つ
まり従来例の表1で示すような符号コード生成のための
テーブルのベースアドレスとするものである。
First, it is determined whether the run length RL of the image data to be encoded is 2624 or more. If the result of the determination is less than 2624, the address is generated as in the case of the conventional example. However, the base address of the table for encoding which is added in the conventional example is a code code corresponding to a run length of less than 2624 in the second embodiment, that is, a code code for generating the code code as shown in Table 1 of the conventional example. It is the base address of the table.

【0119】判定結果が2624以上である場合には、
ターミネーション符号については従来例の場合と同様に
アドレスADR1を生成し、メークアップ符号を生成す
る場合には次のようになる。
If the judgment result is 2624 or more,
For the termination code, the address ADR1 is generated as in the case of the conventional example, and when the makeup code is generated, it is as follows.

【0120】第一実施例の図4(a)および(b)に示
したのと同様に、ビット8に対象となる画データが白な
らば「0」を、黒ならば「1」をセットし、ビット7に
メークアップ符号であることを示す「1」をセットす
る。ビット1からビット6には、2進数で表現されるラ
ンレングスRLのビット6からビット11をセットす
る。これは、ランレングスRLを64で割った商の値を
2進数で表現したものの下位6ビットのデータである。
そして、ビット0を「0」にセットする。
As in the first embodiment shown in FIGS. 4A and 4B, "0" is set in bit 8 if the target image data is white, and "1" is set in black. Then, bit 7 is set to "1" indicating that it is a make-up code. In bits 1 to 6, bits 6 to 11 of the run length RL represented by a binary number are set. This is the data of the lower 6 bits of the binary value of the value of the quotient obtained by dividing the run length RL by 64.
Then, bit 0 is set to "0".

【0121】以上のようにセットされた値に対し、表6
で示したような独自の符号コード生成のためのテーブル
のベースアドレスを加算してアドレスADR1とする。
Table 6 shows the values set as described above.
The base address of the table for generating the unique code code as shown in (1) is added to form the address ADR1.

【0122】次に、復号化処理の内容について説明す
る。
Next, the contents of the decoding process will be described.

【0123】本第二実施例の復号処理においても、第一
実施例で述べたような図2に示す処理順序で処理が行わ
れる。ただし、本第二実施例における図2のステップS
2のテーブルから参照したデータDT2については以下
のようになる。
Also in the decoding processing of the second embodiment, the processing is performed in the processing order shown in FIG. 2 as described in the first embodiment. However, in step S of FIG. 2 in the second embodiment.
The data DT2 referred to from the table 2 is as follows.

【0124】図2のステップS1で計数される連続する
「0」の数であるnが7以下である場合には、第一実施
例の場合と同様で図4(a)で示されるようなデータと
なる。
When n, which is the number of consecutive "0" s counted in step S1 of FIG. 2, is 7 or less, as in the case of the first embodiment, as shown in FIG. 4 (a). It becomes data.

【0125】nが8以上の場合には、図5に示すように
ビット7が「0」であれば白、「1」であれば黒を示
し、ビット0からビット6にランレングスRLを64で
割った商を示す構成になっている。これは、本第二実施
例で追加した表6のような独自の符号コードが、ランレ
ングスが6655まで対応可能としているので、これを
表現するために最大7ビットが必要であり、また、独自
の符号コードは白、黒ともに共通であることによる。
When n is 8 or more, as shown in FIG. 5, if bit 7 is "0", it indicates white, and if it is "1", it indicates black, and the run length RL from bit 0 to bit 6 is 64. It is configured to show the quotient divided by. This is because the unique code code as shown in Table 6 added in the second embodiment allows the run length to be up to 6655, so that a maximum of 7 bits is necessary to represent this, and the unique code This is because the code of is common to both white and black.

【0126】以上のように、復号化処理におけるテーブ
ルの参照回数は、第二実施例においても第一実施例と同
様に常に2回である。
As described above, the number of table references in the decoding process is always two in the second embodiment as in the first embodiment.

【0127】[0127]

【発明の効果】以上説明したように、本発明は、次のよ
うな効果がある。 (1) 復号化処理を行う際にテーブル参照を利用する
場合、テーブルの参照回数は符号の種類にかかわらず常
に2回行われる。これにより、復号結果である画データ
の情報がテーブルから最終的に読み出されるのを待っ
て、この画像データの情報を画素の形式に加工するなど
の待ち合わせのための回路が不要であり、符号化、復号
化に係わるハードウェアの設計が、従来に比べ簡単にな
る。
As described above, the present invention has the following effects. (1) When the table reference is used when performing the decoding process, the reference number of the table is always twice regardless of the type of code. This eliminates the need for a circuit for waiting such as when the information of the image data that is the decoding result is finally read from the table and processing the information of this image data into the pixel format. , The design of the hardware related to decoding becomes simpler than in the past.

【0128】(2) 従来に比べ、テーブルから読み出
されたデータが最終的に求め得る画データの情報である
か判定する必要がないため、符号データを画データにす
る復号化の処理が簡素化される。
(2) Since it is not necessary to judge whether the data read from the table is the information of the image data that can be finally obtained as compared with the conventional method, the decoding process for converting the code data into the image data is simpler. Be converted.

【0129】(3) 本発明では、MH方式の符号コー
ドだけでなく独自の符号を追加することが可能となる。
(3) In the present invention, it is possible to add not only the MH system code but also a unique code.

【0130】(4) 本発明の復号化方式におけるテー
ブル参照回数2回の固定時間は、従来の最長9回のテー
ブル参照時間よりも短い。従って、従来の最長時間に合
わせたハードウェアのタイミイグ設計に対して、本発明
の方が従来に比べ高性能となる。これにより、ソフトウ
ェアによるMR方式の実現も可能となる。
(4) In the decoding method of the present invention, the fixed time of the table reference count of 2 times is shorter than the conventional maximum 9 times of the table reference time. Therefore, the present invention has higher performance than the conventional one in comparison with the conventional hardware timing design which is adapted to the longest time. As a result, the MR method can be realized by software.

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

【図1】本発明の第一実施例の要部を示すブロック構成
図。
FIG. 1 is a block diagram showing a main part of a first embodiment of the present invention.

【図2】その復号化処理手順を示す流れ図。FIG. 2 is a flowchart showing the decoding processing procedure.

【図3】その復号化テーブルの参照アドレスの形式を示
す図。
FIG. 3 is a diagram showing a format of a reference address of the decoding table.

【図4】その復号化テーブルのデータ形式を示す図。FIG. 4 is a diagram showing a data format of the decoding table.

【図5】本発明の第二実施例の復号化テーブルのデータ
形式を示す図。
FIG. 5 is a diagram showing a data format of a decoding table according to the second embodiment of the present invention.

【図6】従来例の要部を示すブロック構成図。FIG. 6 is a block diagram showing a main part of a conventional example.

【図7】その符号化処理手順を示す流れ図。FIG. 7 is a flowchart showing the encoding processing procedure.

【図8】その符号化テーブルの参照アドレスの形式を示
す図。
FIG. 8 is a diagram showing a format of a reference address of the encoding table.

【図9】その符号化テーブルのデータの形式を示す図。FIG. 9 is a diagram showing a data format of the encoding table.

【図10】その復号化処理手順を示す流れ図。FIG. 10 is a flowchart showing the decoding processing procedure.

【図11】その復号化テーブルのデータの形式を示す
図。
FIG. 11 is a diagram showing a data format of the decoding table.

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

100、100a CPU 200、200a テーブルROM 201 符号化テーブル 202、202a 復号化テーブル 300 画データメモリ 400 符号データメモリ 500 FIFOメモリ 600 バス S1〜S4、S11〜S14、S21〜S28 ステ
ップ
100, 100a CPU 200, 200a Table ROM 201 Encoding table 202, 202a Decoding table 300 Image data memory 400 Code data memory 500 FIFO memory 600 Bus S1 to S4, S11 to S14, S21 to S28 Steps

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 符号化テーブルおよび復号化テーブルが
格納されたテーブル記憶手段と、前記符号化テーブルま
たは前記復号化テーブルの参照アドレスを生成する手
段、および生成した参照アドレスに対応する符号データ
を読み出して符号化または復号化を行う手段を含む処理
手段とを備えたファクシミリ装置の符号化復号化装置に
おいて、前記復号化テーブルは、符号長情報を格納した第一の領
域と、色情報、メークアップ符号化またはターミネート
符号化の符号の種別情報およびランレングス情報とを格
納した第二の領域から構成され、 前記復号化テーブルの参照アドレスは、符号データの先
頭から連続した「0」の個数nに前記第二の領域を示す
ためのアドレスバイアス値を加えた値を表す第一のビッ
トフィールドと、前記符号データの色を示す第二のビッ
フィールドと、前記符号データの所定のビット数であ
る第三のビットフィールドを含む情報ワードを基に生成
される構成であり、 前記処理手段は、復号化処理時に、符号データの先頭か
ら連続する「0」の個数nを求める計数手段と、この計
数した「0」の個数を用い前記復号化テーブルの参照ア
ドレスを生成する参照アドレス生成手段とを含むことを
特徴とする符号化復号化装置。
1. A table storage unit that stores an encoding table and a decoding table, a unit that generates a reference address of the encoding table or the decoding table, and read code data corresponding to the generated reference address. In a coding / decoding apparatus for a facsimile apparatus, comprising: a processing unit including a unit for performing coding or decoding according to the first embodiment, the decoding table includes a first area storing code length information.
Gamut and color information, make-up coding or termination
The code type information and the run length information of the encoding are
The reference address of the decoding table is composed of the stored second area, and the second area is indicated by the number n of “0” consecutive from the beginning of the code data.
Information including a first bit field indicating a value obtained by adding an address bias value for the above, a second bit field indicating the color of the code data, and a third bit field that is a predetermined number of bits of the code data. The processing means is configured to be generated based on words, and the processing means uses a counting means for obtaining the number n of consecutive "0" s from the beginning of the code data at the time of decoding processing and the counted number of "0s". A coding / decoding device, comprising: a reference address generation unit that generates a reference address of the decoding table.
【請求項2】 前記符号化テーブルまたは前記復号化テ
ーブルの参照アドレスを生成する手段および生成した参
照アドレスに対応する符号データを読み出して符号化ま
たは復号化を行う手段は、ファクシミリ装置の演算処理
手段に含まれる請求項1記載の符号化復号化装置。
2. A means for generating a reference address of the encoding table or the decoding table and a means for reading code data corresponding to the generated reference address to perform encoding or decoding are arithmetic processing means of a facsimile apparatus. The encoding / decoding device according to claim 1, which is included in.
JP3213922A 1991-08-26 1991-08-26 Encoding / decoding device Expired - Fee Related JP2684887B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3213922A JP2684887B2 (en) 1991-08-26 1991-08-26 Encoding / decoding device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3213922A JP2684887B2 (en) 1991-08-26 1991-08-26 Encoding / decoding device

Publications (2)

Publication Number Publication Date
JPH0556283A JPH0556283A (en) 1993-03-05
JP2684887B2 true JP2684887B2 (en) 1997-12-03

Family

ID=16647268

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3213922A Expired - Fee Related JP2684887B2 (en) 1991-08-26 1991-08-26 Encoding / decoding device

Country Status (1)

Country Link
JP (1) JP2684887B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3220598B2 (en) * 1994-08-31 2001-10-22 三菱電機株式会社 Variable length code table and variable length coding device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61125283A (en) * 1984-11-20 1986-06-12 Mitsubishi Electric Corp Decoding device of modified hafman code

Also Published As

Publication number Publication date
JPH0556283A (en) 1993-03-05

Similar Documents

Publication Publication Date Title
US4992887A (en) Method of storing and transmitting image data as an image file suitable for an image search
US4811113A (en) Image signal encoding method and system
US4688100A (en) Video data encoding/decoding apparatus
JP2002176553A (en) Picture processor, its method, program, and storage medium
JPH04270568A (en) Data compression system in picture processing unit
JPH0969951A (en) Encoding method and decoding method
JPH07184059A (en) Equipment and method for facsimile data coding
JP2962518B2 (en) Image data encoding device
JP2684887B2 (en) Encoding / decoding device
JPH04270564A (en) Serial picture data compression system having color information
JPH09139955A (en) Data coding device, its method, data decoding device and its method
JP3676078B2 (en) Run-length encoding method and compression apparatus
JP3408472B2 (en) Run-length encoding method and run-length encoding device
JP2687926B2 (en) Code decoder
JPS6214579A (en) Decoding circuit
JP4141692B2 (en) Image compression processing apparatus and image compression processing method
JPH04270569A (en) Data compression system for picture processor
JP2000350045A (en) Coding/decoding method and device
JPH01108861A (en) Picture coder
JPH0799583A (en) Two-dimension coding method and two-dimension code decoding method
JP2001078042A (en) Picture expansion processing device and picture compression processing device
JP3488672B2 (en) IMAGE PROCESSING APPARATUS, IMAGE PROCESSING METHOD, AND COMPUTER-READABLE RECORDING MEDIUM RECORDING PROGRAM FOR CAUSING COMPUTER TO EXECUTE THE METHOD
JP2561292B2 (en) Image data compression device
KR900007566B1 (en) Picture data converting device
JP2001169118A (en) Method and device for image processing and computer- readable memory

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees