JP2000350045A - Coding/decoding method and device - Google Patents

Coding/decoding method and device

Info

Publication number
JP2000350045A
JP2000350045A JP11156537A JP15653799A JP2000350045A JP 2000350045 A JP2000350045 A JP 2000350045A JP 11156537 A JP11156537 A JP 11156537A JP 15653799 A JP15653799 A JP 15653799A JP 2000350045 A JP2000350045 A JP 2000350045A
Authority
JP
Japan
Prior art keywords
code
decoding
bits
length
conversion table
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP11156537A
Other languages
Japanese (ja)
Inventor
Masahiro Fukuda
正浩 福田
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 IC Microcomputer Systems Co Ltd
Original Assignee
NEC IC Microcomputer Systems Co 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 NEC IC Microcomputer Systems Co Ltd filed Critical NEC IC Microcomputer Systems Co Ltd
Priority to JP11156537A priority Critical patent/JP2000350045A/en
Publication of JP2000350045A publication Critical patent/JP2000350045A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To provide a coding/decoding method by which the capacity of a decoding table is reduced and the memory space can be used efficiently. SOLUTION: A decoded image is generated (step SA11) on the basis of read run length information respectively, by using values of 5-bits in succession to a level '1' of the most significant bit, using values of remaining 8-bits, except the most significant bit when the most significant bit is '0' and the value of the high-order 8-bits is '2' or large, using remaining 4-bits when the received 8-bits are '1' in the case that modified Huffman MH coded data are white data, using the high-order 6-bits, when the high-order 4-bits are '1' and using the remaining 9-bits when the high-order 4-bits are '0', in the case that modified Huffman MH coded data are black data as the reference address of a decoded conversion table respectively (steps SA6-SA10). In the case that the decoded code is a terminate code, a value denoting a white/black level is inverted (step SA14), and coding decoding processing is conducted.

Description

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

【0001】[0001]

【発明の属する技術分野】この発明は、可変長符号の符
号復号化方法および装置に関し、特に白/黒の2値画情
報の符号化処理に使用されるモディファイド・ハフマン
符号(以下、MH符号と称する)の符号復号化に際し、
汎用CPUでのソフトウエア処理に適した符号復号化方
法および装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method and an apparatus for decoding and decoding variable-length codes, and more particularly to a modified Huffman code (hereinafter referred to as MH code) used for encoding white / black binary image information. The encoding and decoding of
The present invention relates to a code decoding method and apparatus suitable for software processing in a general-purpose CPU.

【0002】[0002]

【従来の技術】従来、可変長符号を用いた画像情報の符
号化は、ファクシミリや画像ファイリング装置などの多
種多様な装置において、画像情報の圧縮のために用いら
れている。ここで可変長符号としては、たとえばファク
シミリ通信に広く用いられているMH符号がある。
2. Description of the Related Art Conventionally, encoding of image information using a variable length code has been used for compression of image information in various devices such as a facsimile and an image filing device. Here, as the variable length code, for example, there is an MH code widely used in facsimile communication.

【0003】まず、MH符号について簡単に説明する。
MH符号は、白/黒2値画像データの各水平ラインごと
の連続する同じ色(白または黒)の画素数(ランレング
スと呼ぶ)を、対応するMH符号に置き換えるものであ
り、MH符号にはメークアップ符号とターミネート符号
の2種類がある。これはランレングスを64で割ったと
きの商と余りとで表す方式であり、商に相当するのがメ
ークアップ符号(以下、M符号と呼ぶ)で、余りに相当
するのがターミネート符号(以下、T符号と呼ぶ)であ
る。したがって、商をM、余りをTとすると、ランレン
グス(RL)は、RL=M×64+Tで表すことができ
る。
[0003] First, the MH code will be briefly described.
The MH code replaces the number of pixels of the same color (white or black) (referred to as run length) that are continuous for each horizontal line of the white / black binary image data with a corresponding MH code. There are two types of make-up codes and terminate codes. This is a method of expressing the quotient and remainder when the run length is divided by 64, and the quotient is a makeup code (hereinafter, referred to as an M code), and the remainder is a termination code (hereinafter, referred to as a M code). (Referred to as a T code). Therefore, assuming that the quotient is M and the remainder is T, the run length (RL) can be represented by RL = M × 64 + T.

【0004】図13、図14にMH符号におけるターミ
ネート符号を示し、図15〜図17(図15、図16は
標準紙幅用の場合を示し、図17は拡張紙幅用の場合を
示す)にMH符号におけるメークアップ符号を示す。タ
ーミネート符号は、「0」から「63」までのランレン
グスに対応しており、メークアップ符号は「64」の整
数倍で最大「2560」までのランレングスに対応して
いる。また、MH符号は「白」と「黒」を表すものに分
かれている。さらに、MH符号は、図11に示すよう
に、最初の「1」が出現する前の「0」の個数が最大7
個であり、最初の「1」の後に続く符号ビット数が最大
でも7個の符号であり、符号長は最大で13ビットの可
変長符号であるという特徴を持っている。
FIGS. 13 and 14 show a terminating code in the MH code, and FIGS. 15 to 17 (FIGS. 15 and 16 show the case for the standard paper width, and FIG. 17 shows the case for the extended paper width). The make-up code in the code is shown. The terminating code corresponds to a run length from "0" to "63", and the make-up code corresponds to a run length up to an integer multiple of "64" and up to "2560". Further, the MH code is divided into those representing "white" and "black". Further, as shown in FIG. 11, the MH code has a maximum of seven “0” s before the first “1” appears.
And the number of code bits following the first "1" is a maximum of seven codes, and the code length is a variable length code of a maximum of 13 bits.

【0005】符号化の際は、64画素未満のランレング
スに対してはターミネート符号を割り当て、64画素以
上のランレングスについてはメークアップ符号とターミ
ネート符号を組み合わせて割り当てるものである。たと
えば、白/黒の2値画像データのある水平ラインが図1
8に示すように白画素と黒画素が配列されている場合
に、最初の白の画素が4つ続いていると、ランレングス
(RL)は「4」となる。図13、図14に示すMH符
号のターミネート符号表より、ランレングス4の白ラン
用符号を見ると、「1011」という符号を得ることが
できる。つまり、「0」から「63」画素までの範囲に
あるランレングスは、ターミネート符号だけで符号化す
る。
At the time of encoding, a terminating code is assigned to a run length of less than 64 pixels, and a make-up code and a terminating code are assigned to a run length of 64 pixels or more in combination. For example, a horizontal line having binary image data of white / black is shown in FIG.
In the case where white pixels and black pixels are arranged as shown in FIG. 8, if four first white pixels continue, the run length (RL) becomes “4”. Looking at the code for white run of run length 4 from the terminating code table of the MH code shown in FIGS. 13 and 14, a code “1011” can be obtained. That is, run lengths in the range from “0” to “63” pixels are encoded using only the termination code.

【0006】また、64画素以上のランレングスに関し
ては、まず、図15〜図17に示すメークアップ符号表
を用いて符号化する。その後実際のランレングスと、メ
ークアップ符号によって表されたランレングスとの差を
表すターミネート符号が続く符号構成となる(図18の
「白139」のランレングスに対応する符号を参照)。
なお、水平ラインの先頭の符号化は白ランから行い、実
際の水平ラインの画像データが黒画素から始まる場合
は、先頭に0個(ランレングス0)の仮想白画素が存在
するものとして、符号は必ず白画素用の符号から始まる
ものとする。また、2次元符号化方式であるMR方式や
MMR方式においても、水平モードなどで上述のMH方
式の符号化処理を使用している。
[0006] A run length of 64 pixels or more is first coded using a makeup code table shown in FIGS. Thereafter, a terminating code representing a difference between the actual run length and the run length represented by the make-up code has a code configuration (see the code corresponding to the run length of “white 139” in FIG. 18).
Note that the coding of the head of the horizontal line is performed from the white run, and when the image data of the actual horizontal line starts from the black pixel, it is assumed that there are 0 (run length 0) virtual white pixels at the head. Always start with a code for white pixels. Also, in the MR system and the MMR system, which are two-dimensional coding systems, the above-described MH coding process is used in a horizontal mode or the like.

【0007】次に、従来のMH符号の符号復号化方法に
ついて説明する。従来より、可変長符号を符号長の長短
によらず高速に復号する方法として、可変長符号データ
の復号テーブルをメモリに構成しておき、この復号テー
ブルを参照して入力データに対応した固定長データを読
み出す、いわゆるテーブルルックアップ方式が知られて
いる。
Next, a conventional MH code decoding method will be described. Conventionally, as a method of decoding a variable-length code at high speed regardless of the code length, a decoding table of variable-length code data is configured in a memory, and a fixed-length code corresponding to input data is referred to by referring to the decoding table. A so-called table lookup method for reading data is known.

【0008】この方法を用いた可変長符号の復号装置と
しては、たとえば、特開昭61−265927号公報に
記載されているように、最長符号長分の可変長データを
直接メモリアドレスとして復号テーブルを参照し、これ
によって対応する固定長データと符号長とを出力すると
いうものがある。しかしながら、上記の可変長符号の復
号装置においては、最長符号長の全符号パターンについ
て、各可変長符号に対応する固定長データを復号テーブ
ルに保持するため、MH符号の復号化のためには入力ア
ドレス「13ビット」で出力ビットが11ビットのテー
ブルが白用と黒用2つ必要となり、213×11×2=
176Kビットのメモリ容量が必要となる。
As a variable length code decoding apparatus using this method, for example, as described in Japanese Patent Application Laid-Open No. Sho 61-265927, a decoding table in which variable length data corresponding to the longest code length is directly used as a memory address. And outputs the corresponding fixed-length data and code length. However, in the above variable length code decoding device, fixed length data corresponding to each variable length code is held in the decoding table for all code patterns having the longest code length, and thus input data is used for decoding the MH code. Two tables for an address “13 bits” and 11 bits for output are required for white and black, and 213 × 11 × 2 =
A memory capacity of 176K bits is required.

【0009】また、最長符号長に満たない可変長符号に
ついては、上位の可変長符号に相当する部分を除く無効
な部分の全符号パターンについて重複して同一のデータ
を記憶しなければならず、その分メモリ空間が無駄に使
用される。このような従来技術の欠点をなくすべく、特
許公報第2687926号では、前述のMH符号の特徴
に着目し、符号列において最初の「1」が出現する前の
「0」の個数をカウントすることにより、11ビットの
アドレスでランレングス値を含む8ビットの情報を読み
出すテーブルと、読み出した8ビットの情報をアドレス
として3ビットの符号長を読み出すテーブルの2つのテ
ーブルに分けることにより、復号化テーブルのメモリ容
量を削減して、冗長度を削減する方法が提案されてい
る。
Further, for a variable length code shorter than the longest code length, the same data must be stored in duplicate for all code patterns of an invalid portion except for a portion corresponding to an upper variable length code. That much memory space is wasted. In order to eliminate such disadvantages of the prior art, Japanese Patent Publication No. 2687926 focuses on the features of the MH code described above and counts the number of “0” before the first “1” appears in a code string. Thus, the decoding table is divided into two tables: a table for reading 8-bit information including a run length value at an 11-bit address, and a table for reading a 3-bit code length using the read 8-bit information as an address. A method has been proposed for reducing the memory capacity of the device to reduce the redundancy.

【0010】前述したような符号復号化処理は、上記従
来の装置のように、専用のハードウェアを用いることに
より高速に行うことができる。しかし、汎用性やコスト
の削減、小型化、処理内容の変更の容易性などを考慮す
れば、このような処理を汎用のCPUを用いてソフトウ
ェアによる処理で実現することが望ましい。
The above-described code decoding process can be performed at high speed by using dedicated hardware as in the above-described conventional device. However, in consideration of versatility, cost reduction, miniaturization, easy change of processing contents, and the like, it is desirable to realize such processing by software processing using a general-purpose CPU.

【0011】次に、この従来の符号復号化方法の動作に
ついて図10に示すフローチャートを参照して説明す
る。従来の符号復号化方法においては、まず、符号入力
レジスタ(図示せず)に復号化対象である連続したMH
符号の最初の8ビットが入力される(ステップSB
1)。次に、この符号入力レジスタにおける入力符号系
列で最初に「1」が出現するまでの最大7個の連続した
「0」の個数を計数する(0カウント処理)(ステップ
SB2)。
Next, the operation of the conventional code decoding method will be described with reference to the flowchart shown in FIG. In the conventional code decoding method, first, consecutive MHs to be decoded are stored in a code input register (not shown).
The first 8 bits of the code are input (step SB
1). Next, up to seven consecutive “0” s are counted until “1” first appears in the input code sequence in the code input register (0 counting process) (step SB2).

【0012】次に、このカウント値に「1」を加えた値
だけ符号入力レジスタの内容を左へシフトするととも
に、左へシフトされたビット数だけ次の符号ビットを符
号入力レジスタに入力する(ステップSB3)。これに
より、符号入力レジスタには、最初に現れた「1」の後
に続く最大7ビットの符号ビットがセットされる。
Next, the contents of the sign input register are shifted to the left by a value obtained by adding "1" to the count value, and the next sign bit is input to the sign input register by the number of bits shifted to the left ( Step SB3). As a result, up to seven sign bits following the first appearing "1" are set in the sign input register.

【0013】次に、この符号入力レジスタの値と、対象
となる画像の白/黒を示す値と、「0」カウント値を、
図12(a)に示すフォーマットの11ビットをアドレ
ス値として、復号化変換テーブルを参照する(ステップ
SB4)。復号化変換テーブルからは、図12(b)に
示すように、対象となる画像の色(白/黒)を示す情報
(1ビット)と、ターミネート符号(T)であるか、メ
ークアップ符号(M)であるかを表すT/Mビットと、
実際に復号するランレングス(RL)(6ビット)の合
計8ビットの情報が得られる。
Next, the value of the code input register, the value indicating white / black of the target image, and the “0” count value are
The decoding conversion table is referred to using 11 bits of the format shown in FIG. 12A as an address value (step SB4). From the decoding conversion table, as shown in FIG. 12B, information (1 bit) indicating the color (white / black) of the target image and a termination code (T) or a makeup code ( M) T / M bits indicating whether
Information of a total of 8 bits of the run length (RL) (6 bits) to be actually decoded is obtained.

【0014】次に、この読み出した8ビットの情報によ
り、復元画像を生成する(ステップSB5)。次に、復
号化変換テーブルより読み出された8ビットの情報(白
/黒,T/M,RL)を、図12(b)に示すようなフ
ォーマットのアドレス値として、符号長テーブルを参照
する(ステップSB6)。参照したデータは、図12
(c)に示すように、1つのコードのうち連続する
「0」の後に検出される「1」以降の残りの符号ビット
数を示しており、次に復号化する符号の先頭位置を決め
る情報となる。
Next, a restored image is generated based on the read 8-bit information (step SB5). Next, the 8-bit information (white / black, T / M, RL) read from the decoding conversion table is referred to as a code length table as an address value in a format as shown in FIG. (Step SB6). The data referred to is shown in FIG.
As shown in (c), the number of remaining code bits after “1” detected after consecutive “0” in one code is shown, and information for determining the head position of the code to be decoded next is shown. Becomes

【0015】次に、読み出した符号ビット数だけ符号入
力レジスタの内容を左へシフトし、符号入力レジスタに
はシフト数だけ符号ビットを入力する(ステップSB
7)。これにより、符号入力レジスタには、次に復号し
ようとする符号がセットされる。
Next, the contents of the code input register are shifted to the left by the read code bit number, and the code bits are input to the code input register by the shift number (step SB).
7). As a result, the code to be decoded next is set in the code input register.

【0016】次に、前に復号化変換テーブルより読み出
したターミネート符号(T)であるかメークアップ符号
(M)であるかを示す情報を判断し(ステップSB
8)、復号化した符号がターミネート符号であった場合
は、次に復号する符号の対象となる画像の色が反転する
ため、白/黒を示す値を反転する(ステップSB9)。
最後に、符号入力レジスタに次に復号化する符号がある
かどうかを判断し(ステップSB10)、上記のステッ
プSB2からステップSB10の処理を、符号入力がな
くなるまで繰り返し実行することにより符号復号化処理
を行う。
Next, information indicating whether the code is a terminating code (T) or a makeup code (M) read from the decoding conversion table previously is determined (step SB).
8) If the decoded code is a terminating code, the value indicating white / black is inverted because the color of the image to be decoded next is inverted (step SB9).
Finally, it is determined whether or not there is a code to be decoded next in the code input register (step SB10), and the above-described processing from step SB2 to step SB10 is repeatedly executed until there is no more code input. I do.

【0017】[0017]

【発明が解決しようとする課題】しかし、上記の従来の
符号復号化方法においては、次に列挙するような課題が
あった。第1の課題は、復号化処理に使用する参照テー
ブルとして17,152ビットのメモリ容量が必要であ
り、メモリ空間が無駄に使用されるということである。
その理由は、MH符号の符号列において最初の「1」が
出現する前の「0」の個数を示す3ビットと、最初に現
れる「1」の後に続く最長符号長の7ビットと白/黒の
色を示す1ビットの計11ビットの全パターンについ
て、MH符号に対応するランレングス値6ビットと、白
/黒の色を示す1ビットと、ターミネート符号/メーク
アップ符号を示す1ビットの計8ビットの情報をもつ復
号化変換テーブルと、符号化変換テーブルの8ビットの
情報に対し3ビットの符号長データを持つ符号長テーブ
ルの2つのテーブルが必要であり、2つのテーブルの合
計容量は、211×8+28×3=17,152(ビッ
ト)となる。また、復号化変換テーブルについては、符
号列で最初に現れる「1」の後に続く7ビットの最長符
号長に満たない符号については、符号に相当する部分を
除く無効な部分の全符号パターンについて重複して同一
のデータを記憶しなければならず、その分メモリ空間が
無駄に使用されるためである。
However, the above-mentioned conventional code decoding method has the following problems. A first problem is that a memory capacity of 17,152 bits is required as a reference table used for the decoding process, and the memory space is wasted.
The reason is that 3 bits indicating the number of “0” s before the first “1” appears in the code string of the MH code, 7 bits of the longest code length following the first “1”, and white / black , A run length value corresponding to the MH code of 6 bits, a white / black color bit, and a terminate code / make-up code of 1 bit. Two tables, a decoding conversion table having 8-bit information and a code length table having 3-bit code length data for the 8-bit information of the coding conversion table, are required. The total capacity of the two tables is as follows. , 211 × 8 + 28 × 3 = 17,152 (bits). As for the decoding conversion table, for codes having a length of less than 7 bits following the first appearing “1” in the code string, all code patterns of invalid portions except for portions corresponding to the codes are duplicated. This is because the same data must be stored, and the memory space is used wastefully.

【0018】第2の課題は、ソフトウエアにて符号復号
化を行う場合に、処理速度が低下するということであ
る。その理由は、「0」の個数をカウントするための演
算処理が必要であり、またランレングス値を読み出す復
号化変換テーブルと符号長を読み出す符号長テーブルを
それぞれ参照する必要があるためである。
The second problem is that when code decoding is performed by software, the processing speed is reduced. The reason is that arithmetic processing for counting the number of “0” is necessary, and it is necessary to refer to a decoding conversion table for reading out the run-length value and a code length table for reading out the code length.

【0019】近年のデータ通信システムにおいては、符
号復号化処理の高速化とともに、機能の拡張や多くのマ
ルチメディア処理の実現が必要になっており、これらの
処理に使用するメモリが増大し、システムのメモリ不足
が深刻になっている。また、セットの低価格のため、メ
モリを効率的に使用し搭載メモリを削減することが重要
となっている。
In recent data communication systems, it has become necessary to increase the speed of code decoding processing, to expand functions, and to realize many multimedia processing, and to increase the memory used for these processing. The lack of memory has become serious. Also, due to the low cost of the set, it is important to use the memory efficiently and reduce the amount of mounted memory.

【0020】この発明は、このような背景に鑑みなされ
たもので、MH符号の復号化に用いる復号化変換テーブ
ルの容量を削減し、メモリ空間を効率的に使用するとと
もに、符号復号化処理を高速に実行することができる符
号復号化方法を提供することを目的とする。
The present invention has been made in view of such a background, and reduces the capacity of a decoding conversion table used for decoding an MH code, efficiently uses a memory space, and performs a code decoding process. An object of the present invention is to provide a code decoding method that can be executed at high speed.

【0021】また、この発明は、MH符号の復号化に用
いる復号化変換テーブルの容量の削減化、メモリ空間の
効率的に使用の可能化、符号復号化処理の高速化を期す
ことができる符号復号化装置を提供することを目的とす
る。
Further, the present invention provides a code capable of reducing the capacity of a decoding conversion table used for decoding an MH code, enabling efficient use of a memory space, and speeding up a code decoding process. It is an object to provide a decoding device.

【0022】[0022]

【課題を解決するための手段】上記目的を達成するため
に、この発明の符号復号化方法は、MH符号を対象画像
の色と符号の上位共通ビット部分と符号長の関係により
複数のグループに分類して、各グループのMH符号の上
位共通ビット部分を除いた復号関与ビット部分に対応し
た符号長とランレングス情報が記憶された複数の復号化
変換テーブルを備え、MH符号の復号化対象の色と、符
号データの一部の共通部分ビットを判断することによ
り、複数の復号化変換テーブルから対応する復号化変換
テーブルを1つ選択するステップと、各復号化変換テー
ブルが上記MH符号の上位共通ビット部分を除いた符号
関与ビットをアドレス情報として復号化変換テーブルを
参照することにより対象符号の符号長とランレングス情
報を読み出すステップとを含むことを特徴とする。その
ため、MH符号が符号長に関連して上位に共通ビット部
分があるという特性に着目し、MH符号を上位共通ビッ
ト部分により複数のグループに分類し、上位共通ビット
部分を除いた復号関与ビット部分に対応づけた複数の復
号化変換テーブルを使用し、復号化対象の色と符号デー
タの一部のビットを判断して、複数の復号化変換テーブ
ルから対応する復号化変換テーブルの1つを選択し、各
復号化変換テーブルが符号関与ビットをアドレス情報と
して符号長とランレングス情報を参照するようにしてい
るので、対象符号の1つの符号の復号化処理に対して復
号化変換テーブルの読み出しが1回で済ませることがで
き、復号化に用いる復号化変換テーブルの容量を削減
し、メモリ空間を効率的に使用することを可能とするこ
とができるとともに、テーブルの参照が1回で済むた
め、符号復号化の処理速度が向上する。
In order to achieve the above object, a code decoding method according to the present invention is arranged such that an MH code is divided into a plurality of groups according to the relationship between the color of a target image, the upper common bit portion of the code, and the code length. A plurality of decoding conversion tables storing code lengths and run-length information corresponding to decoding-related bit portions excluding the upper common bit portion of the MH code of each group, and decoding target of the MH code. A step of selecting one corresponding decoding conversion table from a plurality of decoding conversion tables by determining a color and a common part bit of a part of code data; A step for reading out the code length and run length information of the target code by referring to the decoding conversion table with the code-related bits excluding the common bit portion as address information. Characterized in that it comprises and. Therefore, paying attention to the characteristic that the MH code has a higher-order common bit portion related to the code length, the MH code is classified into a plurality of groups by the higher-order common bit portion, and the decoding-related bit portion excluding the higher-order common bit portion Is used to determine the color to be decoded and some bits of the code data, and select one of the corresponding decoding conversion tables from the plurality of decoding conversion tables. However, since each decoding conversion table refers to the code length and the run length information using the code-related bits as address information, the decoding conversion table is read for the decoding process of one code of the target code. It can be performed only once, and the capacity of the decoding conversion table used for decoding can be reduced, and the memory space can be used efficiently. In addition, since the table needs to be referred to only once, the processing speed of code decoding is improved.

【0023】また、この発明の符号復号化装置は、MH
符号を対象画像の色と符号の上位共通ビット部分と符号
長の関係により複数のグループに分類して、各グループ
のMH符号の上位共通ビット部分を除いた復号関与ビッ
ト部分に対応した符号長とランレングス情報が記憶され
た複数の復号化変換テーブルを備え、MH符号の復号化
対象画像の色と、符号データの一部の共通部分ビットを
判断することにより、複数の復号化変換テーブルから対
応する復号化変換テーブルを1つ選択する手段と、各復
号化変換テーブルが上記MH符号の上位共通ビット部分
を除いた符号関与ビットをアドレス情報として復号化変
換テーブルを参照することにより対象符号の符号長とラ
ンレングス情報を読み出す手段とを備えていることを特
徴とする。そのため、MH符号が符号長に関連して上位
に共通ビット部分があるという特性に着目し、MH符号
を上位共通ビット部分により複数のグループに分類し、
上位共通ビット部分を除いた復号関与ビット部分に対応
づけた複数の復号化変換テーブルを使用し、選択する手
段により復号化対象の色と符号データの一部のビットを
判断して、複数の復号化変換テーブルから対応する復号
化テーブルの1つを選択し、読み出す手段により各復号
化変換テーブルが符号関与ビットをアドレス情報として
符号長とランレングス情報を参照するようにしているの
で、MH符号の復号化に用いる復号化変換テーブルの容
量の削減化、メモリ空間の効率的に使用の可能化、符号
復号化処理の高速化が可能となる。
Further, the code decoding apparatus according to the present invention has a MH
The codes are classified into a plurality of groups based on the relationship between the color of the target image, the upper common bit portion of the code, and the code length, and the code length corresponding to the decoding-related bit portion excluding the upper common bit portion of the MH code of each group. A plurality of decoding conversion tables storing run-length information are provided. By determining the color of the image to be decoded of the MH code and a common part bit of a part of the code data, the plurality of decoding conversion tables correspond to each other. Means for selecting one decoding conversion table to be decoded, and each decoding conversion table refers to the decoding conversion table as address information using code-related bits excluding the upper common bit portion of the MH code, thereby obtaining the code of the target code. A means for reading the length and the run length information is provided. Therefore, paying attention to the characteristic that the MH code has a higher common bit portion in relation to the code length, the MH code is classified into a plurality of groups by the higher common bit portion,
Using a plurality of decoding conversion tables associated with the decoding-related bit portions excluding the upper common bit portion, the selecting means determines the color to be decoded and some bits of the code data, and performs a plurality of decoding. Means for selecting one of the corresponding decoding tables from the conversion table and reading the data so that each decoding conversion table refers to the code length and the run length information using the code-related bits as address information. The capacity of the decoding conversion table used for decoding can be reduced, the memory space can be used efficiently, and the speed of the code decoding process can be increased.

【0024】[0024]

【発明の実施の形態】以下、この発明による符号復号化
方法および符号復号化装置の実施の形態について図面に
基づき説明する。この発明に適用するMH符号は、ファ
クシミリや画像ファイリング装置など、画像を取り扱う
多種多様の装置に適用することができるが、以下では、
一例として、ファクシミリへの適用を例にとり、この発
明に係る符号復号化方法および装置の実施の形態を説明
する。
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram showing an embodiment of a code decoding method and a code decoding apparatus according to the present invention. The MH code applied to the present invention can be applied to various types of devices that handle images, such as facsimile and image filing devices.
As an example, an embodiment of a code decoding method and apparatus according to the present invention will be described by taking application to facsimile as an example.

【0025】図3は、この発明による符号復号化方法お
よび装置の第1実施の形態に適用されるファクシミリの
構成を示すブロック図である。ファクシミリは、画像デ
ータを取り込んでその情報を符号化して通信回線に送信
し、通信回線から受信した符号データを復号化して印刷
を行う装置であり、この図3に示すファクシミリはこの
発明の符号復号化方装置の機能を備えているものであ
る。なお、ファクシミリの中には、取り込んだ画像デー
タをそのまま印刷する複写機能を備えているものがある
が、この複写機能についてはこの発明と直接関係しない
ので、以下では特に説明しない。
FIG. 3 is a block diagram showing the configuration of a facsimile applied to the first embodiment of the code decoding method and apparatus according to the present invention. The facsimile is a device that takes in image data, encodes the information, transmits the information to a communication line, and decodes and prints the code data received from the communication line. The facsimile shown in FIG. It has the function of a chemical conversion device. Some facsimile machines have a copy function for printing the captured image data as it is, but this copy function is not directly related to the present invention and will not be described below.

【0026】図3において、ファクシミリは、装置全体
を制御するCPU(中央演算処理装置)2と、CPU2
を駆動するプログラムおよび画像データなどの情報を記
憶するメモリ1と、原稿から画像データを読み込み、電
気的情報に変換するスキャナ7と、スキャナ7からデー
タを読み出すスキャナ制御部6と、画像などを印刷する
プリンタ9と、プリンタ9にデータを送るためのプリン
タ制御部8と、通信回線を通して通信相手との通信手順
の調整およびデータの送受信を行う通信制御部5と、送
信先を入力し、また結果を表示する操作パネル4と、操
作パネル4を制御する操作パネル制御部3とから構成さ
れている。このような構成において、CPU2は、画像
データをMH符号データに符号化する処理と、MH符号
データを画像データに復号化する処理を所定のプログラ
ムにしたがって実行する。
In FIG. 3, a facsimile includes a CPU (Central Processing Unit) 2 for controlling the entire apparatus,
, A memory for storing information such as a program for driving the scanner and image data, a scanner 7 for reading image data from a document and converting it into electrical information, a scanner controller 6 for reading data from the scanner 7, and printing images and the like. A printer 9, a printer control unit 8 for sending data to the printer 9, a communication control unit 5 for adjusting a communication procedure with a communication partner through a communication line and transmitting and receiving data, and inputting a transmission destination. And an operation panel control unit 3 for controlling the operation panel 4. In such a configuration, the CPU 2 executes a process of encoding image data into MH code data and a process of decoding MH code data into image data according to a predetermined program.

【0027】さて、このようなファクシミリにおいて、
画像データを通信回線より通信相手に送る場合は、スキ
ャナ7で読み込んだ画像データはメモリ1に保持され、
メモリ1の画像データをCPU2によりMH符号に符号
化処理することにより圧縮して通信制御部5から通信回
線に送信する。ここで、MH符号への符号化処理方法
は、たとえば、特開昭59−117375号公報に開示
された従来技術にて実現されているものであり、この発
明には直接関係しないので、以下では特に説明しない。
また、通信相手より送られた画像データを受信する場合
は、通信回線より受信したMH符号データを通信制御部
5を介してメモリ1に保持し、メモリ1に格納されたM
H符号データをCPU2により符号復号化処理すること
により元の画像データに復元し、プリンタ制御部8を通
してプリンタ9に送ることにより印刷を行う。
Now, in such a facsimile,
When sending image data to a communication partner from a communication line, the image data read by the scanner 7 is held in the memory 1,
The image data in the memory 1 is compressed by being encoded into an MH code by the CPU 2 and transmitted from the communication control unit 5 to the communication line. Here, an encoding method for the MH code is realized by, for example, a conventional technique disclosed in Japanese Patent Application Laid-Open No. Sho 59-117375, and is not directly related to the present invention. No particular description is given.
When receiving the image data sent from the communication partner, the MH code data received from the communication line is held in the memory 1 via the communication control unit 5 and the Mh code data stored in the memory 1 is stored.
The H code data is restored to the original image data by code decoding by the CPU 2, and is sent to the printer 9 through the printer control unit 8 to perform printing.

【0028】次に、CPU2が行うMH符号データの符
号復号化処理について説明する。この符号復号化処理
は、メモリ1を用いて行われる。ここで、この処理にお
けるメモリ1の用い方について説明する。図2に、符号
復号化処理実行時のメモリ1の内容を示す。図2中、メ
モリの領域をファクシミリの各処理を制御するプログラ
ム領域11、復号化対象の符号データを格納する符号デ
ータ領域13、符号データを画像データに変換する際に
用いる符号復号化変換テーブルを格納する復号化テーブ
ル領域12、復号化した画像データを記憶する画像デー
タ格納領域14に区分している。
Next, the code decoding process of the MH code data performed by the CPU 2 will be described. This code decoding process is performed using the memory 1. Here, how to use the memory 1 in this process will be described. FIG. 2 shows the contents of the memory 1 when the code decoding process is executed. In FIG. 2, a memory area includes a program area 11 for controlling each process of facsimile, a code data area 13 for storing code data to be decoded, and a code decoding conversion table used when converting the code data into image data. It is divided into a decoding table area 12 for storing and an image data storage area 14 for storing decoded image data.

【0029】この発明に係る符号復号化方法の第1実施
の形態では、MH符号を図6〜図9に示すように、符号
の対象画像の色と符号の上位共通ビット部分と符号長の
関係によりaからeの5つの符号グループに分類してい
る。図6は符号グループbとc、図7は符号グループa
とb、図8は符号グループe、図9は符号グループdと
eの場合を示している。図6と図7は白ラン用符号グル
ープ対応表を示し、図8と図9は黒ラン用符号グループ
対応表を示している。
In the first embodiment of the code decoding method according to the present invention, as shown in FIGS. 6 to 9, the relationship between the color of the target image of the code, the upper common bit portion of the code, and the code length is shown in FIGS. Are classified into five code groups a to e. 6 shows code groups b and c, and FIG. 7 shows code group a.
8 shows the case of code group e, and FIG. 9 shows the case of code groups d and e. 6 and 7 show a code group correspondence table for white runs, and FIGS. 8 and 9 show a code group correspondence table for black runs.

【0030】復号化テーブル領域12には、各符号グル
ープのMH符号からグループ共通ビット部分を除いた復
号関与ビット部分の最大長の値をテーブル参照アドレス
のビット長として、アドレス情報に対応するMH符号
の、ターミネート符号/メークアップ符号(T/M)を
示す1ビットと、実際に復号するランレングス値(R
L)の6ビットと、符号のビット数(符号長)を示す4
ビットの合計11ビットの情報が図4に示すフォーマッ
トで格納された符号グループaからeの5つの復号化変
換テーブルが格納されている。図5に符号グループaに
対応する復号化変換テーブルを例として、復号化変換テ
ーブルの構成を示す。
In the decoding table area 12, the value of the maximum length of the decoding-related bit portion excluding the group common bit portion from the MH code of each code group is set as the bit length of the table reference address, and the MH code corresponding to the address information is set. 1 bit indicating a termination code / makeup code (T / M) and a run length value (R
L) and 4 indicating the number of bits (code length) of the code.
Five decoding conversion tables of code groups a to e in which information of a total of 11 bits is stored in the format shown in FIG. 4 are stored. FIG. 5 shows the configuration of the decoding conversion table, taking the decoding conversion table corresponding to the code group a as an example.

【0031】次に、この発明に係る符号復号化方法の第
1実施の形態の動作について説明する。この動作の説明
に際して、この動作を実行するために適用するこの発明
の符号復号化装置の機能を有する図3で示した前記ファ
クシミリの符号データの受信処理における符号復号化処
理の手順について、図1に示すフローチャートを参照し
て説明する。なお、ここでは、受信した符号データは既
にメモリ1の符号データ領域13に格納されているもの
とする。
Next, the operation of the first embodiment of the code decoding method according to the present invention will be described. In describing this operation, FIG. 1 shows a procedure of the code decoding process in the reception process of the facsimile code data shown in FIG. 3 having the function of the code decoding device of the present invention applied to execute this operation. This will be described with reference to the flowchart shown in FIG. Here, it is assumed that the received code data has already been stored in the code data area 13 of the memory 1.

【0032】まず、符号データ領域13から復号化対象
である連続したMH符号の最初の16ビットを符号入力
レジスタ(図示せず)に読み出す(図1のステップSA
1)。ここで、16ビットの符号データを読み出してい
るのは、CPU2が一般の16ビットまたは32ビット
CPUであり、8ビット、16ビット、または32ビッ
トのうちの、与えられた命令に応じたデータ幅でメモリ
1のデータにアクセスすることができることを想定し、
MH符号の最大ビット長である13ビット以上で都合の
よいサイズで読み出しているものである。このような異
なるデータ幅によるアクセス機構は、一般の16ビット
または32ビットCPUに備えられているものである。
First, the first 16 bits of a continuous MH code to be decoded are read out from the code data area 13 to a code input register (not shown) (step SA in FIG. 1).
1). Here, the CPU 2 reads a 16-bit code data from a general 16-bit or 32-bit CPU, and a data width corresponding to a given instruction out of 8-bit, 16-bit, or 32-bit. Assuming that the data in the memory 1 can be accessed by
The data is read out at a convenient size with a maximum bit length of 13 bits or more of the MH code. An access mechanism using such different data widths is provided in a general 16-bit or 32-bit CPU.

【0033】次に、読み出した復号化対象の符号データ
が白か黒かを判別する(ステップSA2)。この判別の
結果、白の場合は、符号入力レジスタの最上位ビットが
「1」であるかを判断する(ステップSA3)。この判
断の結果、「1」である場合は、符号長は最大でも6ビ
ットであるため、「1」に続く5ビットの値を復号化変
換テーブルaの参照アドレスとしてデータを読み出す
(ステップSA6)。
Next, it is determined whether the read code data to be decoded is white or black (step SA2). If the result of this determination is white, it is determined whether the most significant bit of the code input register is "1" (step SA3). If the result of this determination is "1", since the code length is at most 6 bits, the data is read using the 5-bit value following "1" as the reference address of the decoding conversion table a (step SA6). .

【0034】また、ステップSA3で最上位ビットが
「0」の場合は、符号入力レジスタの上位8ビットの値
が「1」であるか、否かを判断する(ステップSA
5)。上位8ビットの値が「2」以上の場合は、符号長
は最大でも9ビットであるため、最上位ビットを除く残
り8ビットを復号化変換テーブルbの参照アドレスとし
てデータを読み出す(ステップSA7)。符号入力レジ
スタの上位8ビットの値が「1」である場合は、符号長
は最大で12ビットであるため、残りの4ビットを復号
化変換テーブルcの参照アドレスとしてデータを読み出
す(ステップSA8)。
If the most significant bit is "0" at step SA3, it is determined whether or not the value of the upper 8 bits of the code input register is "1" (step SA3).
5). If the value of the upper 8 bits is “2” or more, the code length is 9 bits at the maximum, so that the remaining 8 bits excluding the most significant bit are read as reference addresses of the decoding conversion table b (step SA7). . If the value of the upper 8 bits of the code input register is "1", the code length is 12 bits at the maximum, and the data is read using the remaining 4 bits as reference addresses of the decoding conversion table c (step SA8). .

【0035】同様に、ステップSA2で復号化対象が黒
の場合は、符号入力レジスタの上位4ビットが「0」で
あるかどうかを判断する(ステップSA4)。この判断
の結果、「1」以上である場合は、符号長は最大でも6
ビットであるため、上位6ビットを復号化変換テーブル
dの参照アドレスとしてデータを読み出す(ステップS
A9)。また、上位4ビットが「0」である場合は、符
号長は最大で13ビットであるため、残りの9ビットを
復号化変換テーブルeの参照アドレスとしてデータを読
み出す(ステップSA10)。
Similarly, if the decoding target is black in step SA2, it is determined whether the upper 4 bits of the code input register are "0" (step SA4). If the result of this determination is “1” or more, the code length is at most 6
The data is read out using the upper 6 bits as the reference address of the decoding conversion table d (step S).
A9). If the upper 4 bits are "0", the code length is 13 bits at the maximum, and thus the remaining 9 bits are read as the reference address of the decoding conversion table e (step SA10).

【0036】次に、現在の復号化対象の色(白/黒)情
報と、ステップSA6からステップSA10の何れかに
より読み出されたランレングス情報により復元画像を生
成し、画像データ領域14に格納する(ステップSA1
1)。次に、ステップSA6からステップSA10の何
れかにより読み出した符号ビット数(符号長)分だけ、
符号入力レジスタの内容を左へシフトし、シフト数分の
続く符号データを符号データ領域13から符号入力レジ
スタに入力する(ステップSA12)。これにより、符
号入力レジスタには、次に復号しようとする符号がセッ
トされる。
Next, a restored image is generated from the current color (white / black) information to be decoded and the run-length information read out by any of steps SA6 to SA10, and stored in the image data area 14. Yes (step SA1
1). Next, by the number of code bits (code length) read in any of steps SA6 to SA10,
The contents of the code input register are shifted to the left, and the code data following the number of shifts is input from the code data area 13 to the code input register (step SA12). As a result, the code to be decoded next is set in the code input register.

【0037】次に、ステップSA6からステップSA1
0の何れかにより読み出したターミネート符号/メーク
アップ符号(T/M)を示す値がターミネート符号であ
るか判断(ステップSA13)する。この判断の結果、
復号化した符号がターミネート符号であったと判断した
場合は、次に復号する符号の対象となる画像の色が反転
するため、白/黒を示す値を反転しておく(ステップS
A14)。
Next, from step SA6 to step SA1
It is determined whether the value indicating the termination code / make-up code (T / M) read by any one of 0 is a termination code (step SA13). As a result of this decision,
If it is determined that the decoded code is a terminating code, the value indicating white / black is inverted because the color of the image to be decoded next is inverted (Step S).
A14).

【0038】最後に、符号入力レジスタに次に復号化す
る符号があるかどうかを判断し(ステップSA15)、
その判断の結果、符号入力レジスタに次に復号化する符
号があると判断した場合には、上記のステップSA2か
らステップSA15の処理を行うことにより、ステップ
SA15での符号入力がなくなるまで繰り返し実行する
ことにより、符号復号化処理を行う。ステップSA15
において、符号入力がなくなると、一連の処理が終了す
る。
Finally, it is determined whether or not there is a code to be decoded next in the code input register (step SA15).
If it is determined that there is a code to be decoded next in the code input register, the above-described processing from step SA2 to step SA15 is performed to repeatedly execute the code input in step SA15 until there is no code input. Thus, a code decoding process is performed. Step SA15
In, when there is no code input, a series of processing ends.

【0039】次に、この発明に係る上記の符号復号化処
理を具体例を用いて説明する。たとえば、図3のメモリ
1における図2に示す符号データ格納領域13に、図1
8に示す「白4、黒15、白139、…」のランレング
スに対応するMH符号データ『「1011」,「000
011000」,「10010 01000」…』が格
納されている場合は、まず先頭から16ビットの符号デ
ータ「1011000011000100」が符号入力
レジスタに入力される(ステップSA1)。
Next, the above-described code decoding processing according to the present invention will be described using a specific example. For example, in the code data storage area 13 shown in FIG.
MH code data ““ 1011 ”,“ 000 ”corresponding to the run length of“ white 4, black 15, white 139,.
011000 "," 10010 01000 "..." are stored, first, the 16-bit code data "1011000011000100" from the top is input to the code input register (step SA1).

【0040】次に、復号する対象画像の色を判断し(ス
テップSA2)、先頭は必ず白であるため、符号入力レ
ジスタの最上位ビットが「1」であるかを判断する(ス
テップSA3)。この場合、最上位ビットは「1」であ
るため、「1」に続く5ビットの値「01100」を復
号化変換テーブルaの参照アドレスとしてデータを読み
出す(ステップSA6)。図5に示す復号化変換テーブ
ルaを参照すると、アドレス値「01100」に対し
て、T/Mがターミネート符号であることを示す「1」
と、符号長「4」と、ランレングス値(RL)「4」が
読み出される。
Next, the color of the image to be decoded is determined (step SA2). Since the head is always white, it is determined whether the most significant bit of the code input register is "1" (step SA3). In this case, since the most significant bit is “1”, data is read using the 5-bit value “01100” following “1” as a reference address of the decoding conversion table a (step SA6). Referring to the decoding conversion table a shown in FIG. 5, for the address value "01100", "1" indicating that T / M is a termination code.
, A code length “4”, and a run length value (RL) “4”.

【0041】次に、現在の復号化対象の色が白であり、
読み出されたランレングス値が「4」であることから、
白4画素の復元画像を生成し、メモリ1における画像デ
ータ領域14に格納する(ステップSA11)。次に、
読み出した符号長が「4」であるため、符号入力レジス
タの内容を左へ4ビット分シフトし、符号データ領域1
3から続く符号データを4ビット分だけ符号入力レジス
タに入力する(ステップSA12)。これにより、符号
入力レジスタには、次に復号しようとする符号「000
0110001001001」がセットされる。
Next, the current color to be decoded is white,
Since the read run length value is "4",
A restored image of four white pixels is generated and stored in the image data area 14 of the memory 1 (step SA11). next,
Since the read code length is “4”, the contents of the code input register are shifted left by 4 bits, and the code data area 1 is shifted.
The code data following 3 is input to the code input register by 4 bits (step SA12). As a result, the code “000” to be decoded next is stored in the code input register.
0110001001001 "is set.

【0042】次に、対象符号のターミネート符号/メー
クアップ符号(T/M)を示す値がターミネート符号で
あるか判断(ステップSA13)し、読み出した値がタ
ーミネート符号を示す「1」であるため、次に復号する
符号の対象画像の色情報を反転し、黒を示す値にする
(ステップSA14)。次に、符号入力レジスタに次に
復号化する符号があるかどうかを判断し(ステップSA
15)、次に復号化する符号があるため、再びステップ
SA2に戻り、復号する対象画像の色を判断する。
Next, it is determined whether the value indicating the termination code / makeup code (T / M) of the target code is a termination code (step SA13), and the read value is "1" indicating the termination code. Then, the color information of the target image of the code to be decoded next is inverted to a value indicating black (step SA14). Next, it is determined whether or not there is a code to be decoded next in the code input register (step SA).
15) Since there is a code to be decoded next, the flow returns to step SA2 again to determine the color of the target image to be decoded.

【0043】ここでは、対象画像の色情報は黒を示す値
になっているため、今度は符号入力レジスタの上位4ビ
ットが「0」であるかを判断する(ステップSA4)。
上位4ビットは「0000」であるため、「0000」
に続く9ビットの値「110001001」を復号化変
換テーブルeの参照アドレスとしてデータを読み出す
(ステップSA10)。ここでは、アドレス値「110
001001」に対して、T/Mがターミネート符号で
あることを示す「1」と、符号長「9」と、ランレング
ス値(RL)「15」が読み出される(図は省略)。
Here, since the color information of the target image has a value indicating black, it is determined whether the upper 4 bits of the code input register are "0" (step SA4).
Since the upper 4 bits are “0000”, “0000”
Then, the data is read using the 9-bit value “110001001” subsequent to the above as the reference address of the decoding conversion table e (step SA10). Here, the address value “110”
For “001001”, “1” indicating that the T / M is a terminated code, a code length “9”, and a run length value (RL) “15” are read (not shown).

【0044】次に、現在の復号化対象の色が黒であり、
読み出されたランレングス値が「15」であることか
ら、黒15画素の復元画像を生成し、メモリ1の画像デ
ータ領域14へ格納する(ステップSA11)。次に、
読み出した符号長が「9」であるため、符号入力レジス
タの内容を左へ9ビット分シフトし、符号データ領域1
3から続く符号データを9ビット分だけ符号入力レジス
タに入力する(ステップSA12)。
Next, the current color to be decoded is black,
Since the read run-length value is "15", a restored image of 15 black pixels is generated and stored in the image data area 14 of the memory 1 (step SA11). next,
Since the read code length is “9”, the content of the code input register is shifted to the left by 9 bits, and the code data area 1 is shifted.
The code data subsequent to 3 is input to the code input register for 9 bits (step SA12).

【0045】次に、対象符号のターミネート符号/メー
クアップ符号(T/M)を示す値がターミネート符号で
あるか判断(ステップSA13)し、読み出した値がタ
ーミネート符号を示す「1」であるため、次に復号する
符号の対象画像の色情報を反転し、再び白を示す値にす
る(ステップSA14)。次に、符号入力レジスタに次
に復号化する符号があるかどうかを判断する(ステップ
SA15)。以上の動作を符号入力がなくなるまで実行
して符号復号化処理を行う。
Next, it is determined whether the value indicating the termination code / makeup code (T / M) of the target code is a termination code (step SA13), and the read value is "1" indicating the termination code. Then, the color information of the target image of the next code to be decoded is inverted to a value indicating white again (step SA14). Next, it is determined whether or not there is a code to be decoded next in the code input register (step SA15). The code decoding process is performed by executing the above operation until there is no code input.

【0046】上記に示すように、この発明に係るファク
シミリの符号データ受信処理における符号復号化方法の
第1実施の形態では、MH符号を上位共通ビット部分に
より複数のグループに分類し、上位共通ビット部分を除
いた復号関与ビット部分に対応づけた複数の復号化テー
ブルを用意することにより、従来の符号復号化方法で使
用する復号化テーブルに対して、重複するデータが削減
されるため、復号化変換テーブルの容量を削減し、メモ
リ空間を効率的に使用することが可能である。また、前
記の手順により復号化変換テーブルを参照し、MH符号
に対応するランレングス値、符号長データおよびT/M
情報をダイレクトに参照して復元画像を生成できるた
め、従来の符号復号化処理に対して復号化テーブルのメ
モリ読み出し処理回数が削減されるため、符号復号化処
理速度を向上することが可能である。なお、MR方式や
MMR方式における水平モードの符号復号化処理におい
ても、上記この発明の符号復号化処理方法が使用できる
ことは言うまでもない。
As described above, in the first embodiment of the code decoding method in the facsimile code data receiving process according to the present invention, the MH codes are classified into a plurality of groups by the upper common bit portion, By preparing a plurality of decoding tables corresponding to the decoding-related bit parts excluding the part, overlapping data is reduced with respect to the decoding tables used in the conventional code decoding method. The capacity of the conversion table can be reduced, and the memory space can be used efficiently. Further, the decoding conversion table is referred to by the above procedure, and the run length value corresponding to the MH code, code length data and T / M
Since the restored image can be generated by directly referring to the information, the number of times of reading the memory of the decoding table from the conventional decoding process can be reduced, so that the decoding speed can be improved. . It goes without saying that the above-described code decoding processing method of the present invention can also be used in horizontal mode code decoding processing in the MR method or the MMR method.

【0047】このように、この発明の第1実施の形態で
は、符号の共通ビット部分を除いた復号関与ビット部分
に対応づけた複数の復号化変換テーブルを用意すること
により、復号化に用いる復号化変換テーブルの容量を削
減しているから、復号化に用いる復号化変換テーブルの
容量を削減し、メモリ空間を効率的に使用できる。この
第1実施の形態では、5つの復号化変換テーブルの容量
は、 (25+28+24+26+29)×11=9680(ビット)………(1) となり、特許公報第2687926号に示される従来の
符号復号化装置のテーブル領域約17Kビットに対し、
メモリ容量を約半分に削減している。
As described above, in the first embodiment of the present invention, by preparing a plurality of decoding conversion tables corresponding to decoding-related bit portions excluding the common bit portion of the code, the decoding used for decoding is performed. Since the capacity of the decoding conversion table is reduced, the capacity of the decoding conversion table used for decoding can be reduced, and the memory space can be used efficiently. In the first embodiment, the capacity of the five decoding conversion tables is (2 5 +2 8 +2 4 +2 6 +2 9 ) × 11 = 9680 (bits) (1). Is about 17K bits in the table area of the conventional code decoding device shown in FIG.
The memory capacity has been reduced by about half.

【0048】また、この第1実施の形態の説明では、M
H符号を5つのグループに分類し5つの復号化変換テー
ブルを用いた例を説明しているが、たとえば、符号グル
ープeを上位8ビットが「00000001」かどうか
により、さらに2つのグループに分けるなど、符号グル
ープをさらに詳細に分けることにより、復号化変換テー
ブルの容量を削減することが可能であり、復号化変換テ
ーブルの選択処理が複雑になることによる処理速度が低
下と、削減されるメモリ容量との兼ね合いから、システ
ムに適切な符号のグループ分けを選択することが可能で
ある。
In the description of the first embodiment, M
An example in which the H codes are classified into five groups and five decoding conversion tables are used has been described. For example, the code group e is further divided into two groups according to whether the upper 8 bits are “00000001”. By dividing the code groups in more detail, it is possible to reduce the capacity of the decoding conversion table, and the processing speed decreases due to the complexity of the selection processing of the decoding conversion table, and the reduced memory capacity Therefore, it is possible to select a code grouping appropriate for the system.

【0049】さらに、上述の特許公報第2687926
号に示される従来の符号復号化装置では、復号化変換テ
ーブルの容量を削減するために、1つの符号の復号化処
理ごとに符号列において最初の「1」が出現する前の
「0」の個数をカウントする処理と、ランレングス値を
読み出すテーブル参照と符号長を読み出すテーブル参照
の2回のテーブル参照が必要であるのに対し、この発明
の第1実施の形態による符号復号化方法では、「0」の
カウント処理が不要であり、また1回の復号化変換テー
ブルの参照で対応するランレングス値と符号長を読み出
すことにより、メモリの読み出し回数が削減され、処理
時間が短縮されるため、従来の符号復号化方法に対し、
高速な符号化処理ができる。
Further, the above-mentioned Patent Publication No. 2687926 is disclosed.
In order to reduce the capacity of the decoding conversion table, the conventional code decoding device shown in FIG. 1 uses “0” before the first “1” appears in the code sequence for each decoding process of one code. In contrast to the process of counting the number and the need to refer to the table twice for reading the run length value and the table for reading the code length, the code decoding method according to the first embodiment of the present invention requires: Since the count processing of “0” is unnecessary, and the corresponding run length value and code length are read by referring to the decoding conversion table once, the number of times of reading the memory is reduced, and the processing time is shortened. , In contrast to the conventional code decoding method,
High-speed encoding processing can be performed.

【0050】次に、1つの符号の復号化処理における従
来の符号復号化方法と、この発明による符号復号化方法
での相違する処理のクロック数を比較すると、CPUの
外部メモリ参照、分岐命令、シフト命令、演算命令の実
行クロック数をそれぞれ18クロック、3クロック、1
クロック、1クロックとした場合では、次の式で示され
る処理時間の差が発生する。なお、ランレングス値より
復元画像を生成する処理は、従来と同様であるため、下
記の処理時間の差の計算では省略する。
Next, when comparing the number of clocks of a different process between the conventional code decoding method in the decoding process of one code and the code decoding method according to the present invention, the external memory reference of the CPU, the branch instruction, The number of execution clocks of the shift instruction and the operation instruction is 18 clocks, 3 clocks,
When one clock is used, a processing time difference represented by the following equation occurs. Note that the process of generating a restored image from the run-length value is the same as in the related art, and thus will not be described in the following calculation of the difference in processing time.

【0051】「従来の符号復号化方法の場合」図10の
フローチャートにおいて、ステップSB2、ステップS
B3、ステップSB4、ステップSB6に対応するクロ
ックの合計は、2〜28クロック+20クロック+20
クロック+18クロック=60〜86クロックである。
「この発明による符号復号化方法の場合」図1のフロー
チャートにおいて、ステップSA2〜ステップSA5、
ステップSA6〜ステップSA10に対応するクロック
の合計は、6〜8クロック+20クロック=26〜28
クロックである。
"In the case of the conventional code decoding method" In the flowchart of FIG.
The total of the clocks corresponding to B3, step SB4, and step SB6 is 2 to 28 clocks + 20 clocks + 20
Clock + 18 clocks = 60-86 clocks.
"In the case of the code decoding method according to the present invention" In the flowchart of FIG. 1, steps SA2 to SA5,
The sum of the clocks corresponding to steps SA6 to SA10 is 6 to 8 clocks + 20 clocks = 26 to 28
Clock.

【0052】[0052]

【発明の効果】以上のように、この発明の符号復号化方
法および装置によれば、符号の共通ビット部分を除いた
復号関与ビット部分に対応づけた複数の復号化変換テー
ブルを用意し、復号化対象の色と、符号データの一部の
共通部分ビットを判断することにより、複数の復号化変
換テーブルから対応する復号化変換テーブルを1つ選択
し、各復号化変換テーブルが符号関与ビットをアドレス
情報として参照することにより対象符号の符号長とラン
レングス情報を読み出すようにして、復号化に用いる復
号化変換テーブルの容量を削減するようにしたので、メ
モリ空間を効率的に使用することができる。また、
「0」のカウント処理が不要であるとともに、1回の復
号化変換テーブルの参照で対応するランレングス値と符
号長を読み出しているから、メモリの読み出し回数が削
減され、処理時間を短縮でき、高速な符号化処理ができ
る。
As described above, according to the code decoding method and apparatus of the present invention, a plurality of decoding conversion tables are prepared which are associated with decoding-related bit portions excluding common bit portions of codes. By determining the color to be converted and the common part bit of a part of the code data, one corresponding decoding conversion table is selected from the plurality of decoding conversion tables, and each decoding conversion table determines the code-related bits. By reading the code length and run-length information of the target code by referring to the address information, the capacity of the decoding conversion table used for decoding is reduced, so that the memory space can be used efficiently. it can. Also,
Since the count processing of “0” is unnecessary and the corresponding run length value and code length are read by referring to one decoding conversion table, the number of times of reading the memory can be reduced, and the processing time can be shortened. High-speed encoding processing can be performed.

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

【図1】この発明による符号復号化方法の第1実施の形
態の動作を説明するためのフローチャートである。
FIG. 1 is a flowchart for explaining an operation of a first embodiment of a code decoding method according to the present invention.

【図2】この発明による符号復号化方法の第1実施の形
態を適用するファクシミリにおけるメモリの符号復号化
処理時の使用例を示す説明図である。
FIG. 2 is an explanatory diagram showing an example of use of a memory at the time of code decoding processing in a facsimile to which the first embodiment of the code decoding method according to the present invention is applied.

【図3】この発明のによる符号復号化方法を適用し、か
つこの発明の符号復号化装置の機能を備えるファクシミ
リの構成を示すブロック図である。
FIG. 3 is a block diagram showing a configuration of a facsimile to which the code decoding method according to the present invention is applied and which has the function of the code decoding apparatus according to the present invention.

【図4】この発明による符号復号化方法の第1実施の形
態に適用される復号化変換テーブルのデータ・フォーマ
ットの具体例を示す説明図である。
FIG. 4 is an explanatory diagram showing a specific example of a data format of a decoding conversion table applied to the first embodiment of the code decoding method according to the present invention;

【図5】この発明による符号復号化方法の第1実施の形
態に適用される復号化変換テーブルの構成を示す説明図
である。
FIG. 5 is an explanatory diagram showing a configuration of a decoding conversion table applied to the first embodiment of the code decoding method according to the present invention.

【図6】この発明による符号復号化方法の第1実施の形
態に適用される白ラン用符号グループ対応表を示す説明
図である。
FIG. 6 is an explanatory diagram showing a white run code group correspondence table applied to the first embodiment of the code decoding method according to the present invention.

【図7】この発明による符号復号化方法の第1実施の形
態に適用される白ラン用符号グループ対応表を示す説明
図である。
FIG. 7 is an explanatory diagram showing a white run code group correspondence table applied to the first embodiment of the code decoding method according to the present invention.

【図8】この発明による符号復号化方法の第1実施の形
態に適用される黒ラン用符号グループ対応表を示す説明
図である。
FIG. 8 is an explanatory diagram showing a black run code group correspondence table applied to the first embodiment of the code decoding method according to the present invention.

【図9】この発明による符号復号化方法の第1実施の形
態に適用される黒ラン用符号グループ対応表を示す説明
図である。
FIG. 9 is an explanatory diagram showing a black run code group correspondence table applied to the first embodiment of the code decoding method according to the present invention.

【図10】従来の符号復号化方法の動作を説明するため
のフローチャートである。
FIG. 10 is a flowchart for explaining the operation of a conventional code decoding method.

【図11】MH符号のフォーマットを示す説明図であ
る。
FIG. 11 is an explanatory diagram showing a format of an MH code.

【図12】従来の符号復号化方法における変換テーブル
の参照アドレスおよびテーブルデータのフォーマットを
示す説明図である。
FIG. 12 is an explanatory diagram showing a reference address of a conversion table and a format of table data in a conventional code decoding method.

【図13】MH符号におけるターミネート符号を示す説
明図である。
FIG. 13 is an explanatory diagram showing a termination code in the MH code.

【図14】MH符号におけるターミネート符号を示す説
明図である。
FIG. 14 is an explanatory diagram showing a termination code in the MH code.

【図15】MH符号における標準紙幅の場合のメークア
ップ符号を示す説明図である。
FIG. 15 is an explanatory diagram showing a makeup code in the case of a standard paper width in the MH code.

【図16】MH符号における標準紙幅の場合のメークア
ップ符号を示す説明図である。
FIG. 16 is an explanatory diagram showing a makeup code in the case of a standard paper width in the MH code.

【図17】MH符号における拡張紙幅の場合のメークア
ップ符号を示す説明図である。
FIG. 17 is an explanatory diagram showing a makeup code in the case of an extended paper width in the MH code.

【図18】白/黒の2値画像の一例を示す説明図であ
る。
FIG. 18 is an explanatory diagram illustrating an example of a binary image of white / black.

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

1……メモリ、2……中央演算処理装置(CPU)、3
……操作パネル制御部、4……操作パネル、5……通信
制御部、6……スキャナ制御部、7……スキャナ、8…
…プリンタ制御部、9……プリンタ、11……プログラ
ム領域、12……復号化テーブル領域、13……符号デ
ータ領域、14……画像データ領域。
1 ... memory, 2 ... central processing unit (CPU), 3
... Operation panel control unit, 4 ... Operation panel, 5 ... Communication control unit, 6 ... Scanner control unit, 7 ... Scanner, 8 ...
... Printer controller 9, printer 11, program area 12, decoding table area 13, code data area 14, image data area.

Claims (12)

【特許請求の範囲】[Claims] 【請求項1】 MH符号の符号復号化方法において、 MH符号を対象画像の色と符号の上位共通ビット部分と
符号長の関係により複数のグループに分類して、各グル
ープのMH符号の上位共通ビット部分を除いた復号関与
ビット部分に対応した符号長とランレングス情報が記憶
された複数の復号化変換テーブルを備え、 MH符号の復号化対象画像の色と、符号データの一部の
共通部分ビットを判断することにより、複数の復号化変
換テーブルから対応する復号化変換テーブルを1つ選択
するステップと、 各復号化変換テーブルが上記MH符号の上位共通ビット
部分を除いた符号関与ビットをアドレス情報として復号
化変換テーブルを参照することにより対象符号の符号長
とランレングス情報を読み出すステップと、 を含むことを特徴とする符号復号化方法。
1. An MH code decoding method, wherein the MH codes are classified into a plurality of groups according to a relationship between a color of a target image, an upper common bit portion of the codes, and a code length, and the upper common MH codes of each group are classified. A plurality of decoding conversion tables storing code lengths and run-length information corresponding to decoding-related bit portions excluding bit portions; a common part of a color of an image to be decoded of the MH code and a part of code data; Selecting one corresponding decoding conversion table from the plurality of decoding conversion tables by judging the bits; each decoding conversion table addresses a code-related bit excluding the upper common bit portion of the MH code; Reading the code length and run-length information of the target code by referring to the decoding conversion table as the information. METHOD No. decoding.
【請求項2】 上記復号化変換テーブルは、1つの符号
の復号化処理に対して復号化変換テーブルの読み出しを
1回で済ませることを特徴とする請求項1記載の符号復
号化方法。
2. The encoding / decoding method according to claim 1, wherein the decoding / conversion table only needs to read the decoding / conversion table once for the decoding process of one code.
【請求項3】 上記復号化変換テーブルは、上記符号関
与ビット部分の最大長の値をテーブル参照アドレスのビ
ット長として、アドレス情報に対応するMH符号のター
ミネート符号/メークアップ符号を示す1ビットと、実
際に復号するランレングス値の6ビットと、符号のビッ
ト数を示す4ビットの合計11ビットの情報をフォーマ
ット化されることを特徴とする請求項1記載の符号復号
化方法。
3. The decoding conversion table according to claim 1, wherein a value of a maximum length of the code-related bit portion is a bit length of a table reference address, and one bit indicating a termination code / makeup code of an MH code corresponding to the address information. 2. The code decoding method according to claim 1, wherein information of a total of 11 bits of 6 bits of a run length value to be actually decoded and 4 bits indicating the number of bits of a code is formatted.
【請求項4】 上記MH符号は、5つのグループに分類
されることを特徴とする請求項1記載の符号復号化方
法。
4. The code decoding method according to claim 1, wherein the MH codes are classified into five groups.
【請求項5】 上記MH符号は、2つのグループに分類
されることを特徴とする請求項1記載の符号復号化方
法。
5. The code decoding method according to claim 1, wherein said MH codes are classified into two groups.
【請求項6】 上記復号化変換テーブルは、1回の参照
で対応するランレングス値と符号長を読み出すことを特
徴とする請求項1記載の符号復号化方法。
6. The code decoding method according to claim 1, wherein the decoding conversion table reads out the corresponding run length value and code length by one reference.
【請求項7】 MH符号の符号復号化装置において、 MH符号を対象画像の色と符号の上位共通ビット部分と
符号長の関係により複数のグループに分類して、各グル
ープのMH符号の上位共通ビット部分を除いた復号関与
ビット部分に対応した符号長とランレングス情報が記憶
された複数の復号化変換テーブルを備え、 MH符号の復号化対象画像の色と、符号データの一部の
共通部分ビットを判断することにより、複数の復号化変
換テーブルから対応する復号化変換テーブルを1つ選択
する手段と、 各復号化変換テーブルが上記MH符号の上位共通ビット
部分を除いた符号関与ビットをアドレス情報として復号
化変換テーブルを参照することにより対象符号の符号長
とランレングス情報を読み出す手段と、 を備えていることを特徴とする符号復号化装置。
7. An MH code decoding apparatus, wherein the MH codes are classified into a plurality of groups according to the relationship between the color of the target image, the upper common bit portion of the codes, and the code length, and the upper MH codes of the respective groups are classified. A plurality of decoding conversion tables storing code lengths and run-length information corresponding to decoding-related bit portions excluding bit portions; a common part of a color of an image to be decoded of the MH code and a part of code data; Means for selecting one corresponding decoding conversion table from a plurality of decoding conversion tables by judging bits, and each decoding conversion table addresses a code-related bit excluding the upper common bit part of the MH code. Means for reading out the code length and run-length information of the target code by referring to the decoding conversion table as information. Decoder.
【請求項8】 上記復号化変換テーブルは、1つの符号
の復号化処理に対して復号化変換テーブルの読み出しを
1回で済ませることを特徴とする請求項7記載の符号復
号化装置。
8. The code decoding apparatus according to claim 7, wherein the decoding conversion table only needs to read the decoding conversion table once for one code decoding process.
【請求項9】 上記復号化変換テーブルは、上記符号関
与ビット部分の最大長の値をテーブル参照アドレスのビ
ット長として、アドレス情報に対応するMH符号のター
ミネート符号/メークアップ符号を示す1ビットと、実
際に復号するランレングス値の6ビットと、符号のビッ
ト数を示す4ビットの合計11ビットの情報をフォーマ
ット化されることを特徴とする請求項7記載の符号復号
化装置。
9. The decoding conversion table according to claim 1, wherein a value of a maximum length of the code-related bit portion is a bit length of a table reference address, and one bit indicating a termination code / makeup code of an MH code corresponding to the address information. 8. The code decoding apparatus according to claim 7, wherein a total of 11 bits of information of 6 bits of a run length value to be actually decoded and 4 bits indicating the number of bits of a code are formatted.
【請求項10】 上記MH符号は、5つのグループに分
類されることを特徴とする請求項7記載の符号復号化装
置。
10. The code decoding apparatus according to claim 7, wherein said MH codes are classified into five groups.
【請求項11】 上記MH符号は、2つのグループに分
類されることを特徴とする請求項7記載の符号復号化装
置。
11. The code decoding apparatus according to claim 7, wherein said MH codes are classified into two groups.
【請求項12】 上記復号化変換テーブルは、1回の参
照で対応するランレングス値と符号長を読み出すことを
特徴とする請求項7記載の符号復号化装置。
12. The code decoding apparatus according to claim 7, wherein the decoding conversion table reads out the corresponding run length value and code length by one reference.
JP11156537A 1999-06-03 1999-06-03 Coding/decoding method and device Pending JP2000350045A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11156537A JP2000350045A (en) 1999-06-03 1999-06-03 Coding/decoding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11156537A JP2000350045A (en) 1999-06-03 1999-06-03 Coding/decoding method and device

Publications (1)

Publication Number Publication Date
JP2000350045A true JP2000350045A (en) 2000-12-15

Family

ID=15629968

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11156537A Pending JP2000350045A (en) 1999-06-03 1999-06-03 Coding/decoding method and device

Country Status (1)

Country Link
JP (1) JP2000350045A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014017629A (en) * 2012-07-06 2014-01-30 Fujitsu Ltd Reconstruction program, compression program, reconstruction apparatus, compression apparatus, reconstruction method and compression method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014017629A (en) * 2012-07-06 2014-01-30 Fujitsu Ltd Reconstruction program, compression program, reconstruction apparatus, compression apparatus, reconstruction method and compression method

Similar Documents

Publication Publication Date Title
US4360840A (en) Real time data compression/decompression scheme for facsimile transmission system
US4811113A (en) Image signal encoding method and system
JP3231855B2 (en) Data format conversion apparatus and method
JPH0969951A (en) Encoding method and decoding method
US4688100A (en) Video data encoding/decoding apparatus
JPH04270568A (en) Data compression system in picture processing unit
JPH07184059A (en) Equipment and method for facsimile data coding
JPH04270564A (en) Serial picture data compression system having color information
JP2000350045A (en) Coding/decoding method and device
JPH09139955A (en) Data coding device, its method, data decoding device and its method
JPH04298164A (en) Data compression/release circuit for facsimile apparatus
JP3676078B2 (en) Run-length encoding method and compression apparatus
JP2687926B2 (en) Code decoder
JP3408472B2 (en) Run-length encoding method and run-length encoding device
JPH04270569A (en) Data compression system for picture processor
JP2891818B2 (en) Encoding device
JP3187696B2 (en) Image coding device
JP3001563B1 (en) Run-length encoding method, run-length encoding device, and storage medium storing run-length encoding program
JP3108243B2 (en) Encoding and decoding device
JPH09121286A (en) Method and device for compressing picture data
JP3255808B2 (en) Compression / expansion device
JPS60251763A (en) Magnifying and reducing circuit of facsimile information
KR900007566B1 (en) Picture data converting device
JPH0583575A (en) Pictorial communication equipment
JP3029863B2 (en) Compressed data decoding device