JPH0686079A - Image coding device - Google Patents

Image coding device

Info

Publication number
JPH0686079A
JPH0686079A JP23235392A JP23235392A JPH0686079A JP H0686079 A JPH0686079 A JP H0686079A JP 23235392 A JP23235392 A JP 23235392A JP 23235392 A JP23235392 A JP 23235392A JP H0686079 A JPH0686079 A JP H0686079A
Authority
JP
Japan
Prior art keywords
encoding
stripe
image data
code
encoder
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP23235392A
Other languages
Japanese (ja)
Other versions
JP3167802B2 (en
Inventor
Miyuki Enokida
幸 榎田
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP23235392A priority Critical patent/JP3167802B2/en
Publication of JPH0686079A publication Critical patent/JPH0686079A/en
Application granted granted Critical
Publication of JP3167802B2 publication Critical patent/JP3167802B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Analogue/Digital Conversion (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

PURPOSE:To code again the image data that could not be coded by an arithmetic code by using the template function of a reference picture element when the counter contained in an arithmetic coder has an overflow. CONSTITUTION:The coder of a coder/decoder 5 is started and the coding processing is carried out for one stripe. Thus the reduced image data on a strip 0 part are outputted to a frame memory FM 2 and the bit stream of a stripe 0 is outputted to a code memory 6 respectively. When these output operations are normally complete, the code output processing is carried out. The FF counter of an arithmetic coder has an overflow and is unable to perform the coding operation with a stripe 2. Thus the value of ATLagX of the stripe 2 is compared with the maximum value Mx. Then the coding failure is decided if ATLagX>Mx is satisfied. Meanwhile the control procedure is set back to the head of a main stripe if ATLagX<Mx is satisfied.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、算術符号器を利用して
画像データを符号化する画像符号化装置に関するもので
ある。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image coding apparatus for coding image data using an arithmetic coder.

【0002】[0002]

【従来の技術】従来、JBIG(Joint Bi-level Image
Group)で検討された2値画像の階層符号化方式において
用いられている減算型算術符号化方式は、CCITT Draft
Recommendation T.82 ,ISO/IEC Committee Draft 1154
4 にも記載されているように、シフト処理によって符号
化レジスタからはき出されたビットが符号出力となる
が、その後のオージェント加算によっては、符号化レジ
スタよりも上位へ桁上りが波及することがある。従っ
て、符号化レジスタからはき出された符号を直ちに伝送
路に出力していたのでは、桁上りの伝播に対して対処で
きないため、桁上りの可能性があるときには、それを何
らかの形で吸収する処置が必要となる。
2. Description of the Related Art Conventionally, JBIG (Joint Bi-level Image)
The CCITT Draft is a subtractive arithmetic coding method used in the hierarchical coding method of binary images studied by the Group).
Recommendation T.82, ISO / IEC Committee Draft 1154
As described in 4, the bit output from the encoding register by the shift process becomes the code output, but the carry may spread to the higher order than the encoding register depending on the subsequent orient addition. is there. Therefore, if the code output from the encoding register is immediately output to the transmission line, the propagation of carry cannot be dealt with. Therefore, when there is a possibility of carry, a measure to absorb it in some way is taken. Is required.

【0003】JBIGの標準案では、この桁上り伝播に
対処するために、はき出された符号ビットパターンとし
て、0で始まり1が連続するパターン01…1を記憶し
ておく必要があり、桁上りが伝播する可能性のある範囲
は全て記憶しておき、伝播の可能性がなくなるまで出力
を待機させる「桁上り待機方式」を採用している。この
「桁上り待機方式」を実現するため、Committee Draft
11544 では、符号化レジスタから符号を出力する際、
“FF”の数をカウントするFFカウンタと、1つ前の
コードをバッファリングするBUFFERを設けてこの
桁上り伝播の処理を行なっている。
In the standard proposal of JBIG, in order to cope with this carry propagation, it is necessary to store a pattern 01 ... 1 in which 0 starts and 1 continues as a code bit pattern that is ejected, and carry occurs. The "carry wait method" is adopted in which all possible propagation ranges are stored and the output waits until there is no possibility of propagation. In order to realize this "carry standby method", Committee Draft
In 11544, when outputting the code from the encoding register,
An FF counter that counts the number of "FFs" and a BUFFER that buffers the immediately preceding code are provided to carry out this carry propagation process.

【0004】[0004]

【発明が解決しようとする課題】しかしながら、上記の
処理を実際のハードウェアにて実現するためには、上述
のFFカウンタのビット長を制限する必要がある。例え
ば、3ビットであれば0〜7まで、4ビットであれば0
〜15までの値をとることができるが、これは“FF”
の数を7個、あるいは15個までしかスタックできない
ということを意味する。そして、この値以上に“FF”
が続いてしまうような画像データについては符号化でき
ないという問題がある。
However, in order to implement the above processing by actual hardware, it is necessary to limit the bit length of the above FF counter. For example, 0 to 7 for 3 bits and 0 for 4 bits
It can take values up to ~ 15, but this is "FF"
It means that you can only stack up to 7 or 15. And more than this value "FF"
There is a problem in that image data that continues to be unable to be encoded.

【0005】また、FFカウンタのビット長を増やす
と、それに伴ってハード規模が大きくなり、装置のコス
トが高くなるという問題がある。さらに、上記の標準化
方式の原理からは、“FF”の最大値を特定することは
できず、論理的に無限大の値をとる可能性もあり、論理
的にFFカウンタの最大ビット長を決めることができな
いという問題もある。
Further, if the bit length of the FF counter is increased, the hardware scale will increase accordingly, and the cost of the device will increase. Further, from the principle of the standardization method described above, it is not possible to specify the maximum value of "FF", and there is a possibility of taking a logically infinite value, so the maximum bit length of the FF counter is logically determined. There is also the problem that you cannot do it.

【0006】本発明の目的は、算術符号を用いる符号化
方式では符号化ができなかった画像データをJBIGの
ビットストリーム形式で符号化したり、あるいは、符号
化できる確率が高い画像符号化装置を提供することであ
る。
An object of the present invention is to provide an image coding apparatus which has a high probability of coding image data which could not be coded by a coding system using arithmetic codes in the JBIG bit stream format, or having a high probability of coding. It is to be.

【0007】[0007]

【課題を解決するための手段】上述の目的を達成するた
め、請求項1に記載の発明は、算術符号器を用いて2値
画像データを階層的に符号化する画像符号化装置におい
て、前記算術符号器内の桁上り伝播のカウンタ値のオー
バーフローを検出する手段と、前記オーバーフローが検
出された場合、符号化の予測モデルとして用いる参照画
素のテンプレートを変更する手段と、前記テンプレート
を用いて、前記オーバーフローにより符号化できなかっ
た画像データを再度符号化する再符号化手段とを備え
る。
In order to achieve the above object, the invention according to claim 1 is an image coding apparatus for hierarchically coding binary image data using an arithmetic coder, wherein: Means for detecting overflow of the counter value of carry propagation in the arithmetic encoder, means for changing the template of the reference pixel used as a prediction model of encoding when the overflow is detected, using the template, Re-encoding means for re-encoding image data that could not be encoded due to the overflow.

【0008】また、請求項7に記載の発明は、算術符号
器を用いて2値画像データを階層的に符号化する画像符
号化装置において、前記算術符号器内の桁上り伝播のカ
ウンタ値のオーバーフローを検出する手段と、前記オー
バーフローが検出された場合、前記算術符号器による算
術符号化以外の符号化を選択する手段と、前記選択され
た符号化にて、前記オーバーフローにより符号化できな
かった画像データを再度符号化する再符号化手段とを備
え、前記再符号化手段による符号化データを、前記算術
符号器が出力するビットストリームに入れ込んで、1つ
のビットストリームにする。
According to a seventh aspect of the present invention, in an image encoding apparatus for hierarchically encoding binary image data using an arithmetic encoder, the carry propagation counter value in the arithmetic encoder is Means for detecting overflow, means for selecting encoding other than arithmetic encoding by the arithmetic encoder when the overflow is detected, and encoding by the overflow due to the selected encoding Re-encoding means for re-encoding the image data, and the encoded data by the re-encoding means is put into the bit stream output by the arithmetic encoder to form one bit stream.

【0009】[0009]

【作用】以上の構成において、算術符号を用いる符号化
方式では符号化ができなかった画像データを符号化する
ように機能する。
With the above arrangement, it functions to encode the image data that could not be encoded by the encoding method using the arithmetic code.

【0010】[0010]

【実施例】以下、添付図面を参照して、本発明に係る好
適な実施例を詳細に説明する。 [第1実施例]図1は、本発明の第1の実施例に係る画
像符号化装置(以下、装置という)全体の概略ブロック
図である。なお、本実施例では、入力画像をストライプ
に分割し、ストライプ単位に符号化を行なうことを考え
る。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings. [First Embodiment] FIG. 1 is a schematic block diagram of an entire image coding apparatus (hereinafter referred to as apparatus) according to a first embodiment of the present invention. In this embodiment, it is considered that the input image is divided into stripes and the coding is performed in stripe units.

【0011】図1において、1はストライプ単位に画像
データをエンコード/デコードする符号化/復号化器で
ある。本実施例における符号化/復号化の手法は、国際
標準化委員会内のJBIGで検討されているような、2
値画像の階層符号化手法を用いる。符号化/復号化器1
を構成するFM1(2),FM2(3)は、符号/復号
化するときに画像データを格納するためのフレームメモ
リであり、階層符号化するために2面ある。すなわち、
ある解像度の画像データと、それより1つ階層が低い解
像度の画像データを各々格納し、符号/復号する。ま
た、ストライプ単位の符号化/復号化器5は、例えば、
FM1から画像データを読み込んで、縮小された画像デ
ータをFM2へ出力しながら、符号化データをストライ
プ単位にコード・メモリ6に出力するように符号化器と
して動作したり、あるいは、逆にコード・メモリ6から
符号化データを読み込んで、画像データをストライプ単
位に復元する復号化器としての機能を有する。
In FIG. 1, reference numeral 1 is an encoder / decoder for encoding / decoding image data in stripe units. The encoding / decoding method in the present embodiment is as described in JBIG within the International Standardization Committee.
The hierarchical encoding method of the value image is used. Encoder / Decoder 1
The FM1 (2) and FM2 (3) that make up are frame memories for storing image data at the time of encoding / decoding, and have two surfaces for hierarchical encoding. That is,
Image data of a certain resolution and image data of a resolution one layer lower than that are stored and encoded / decoded. Also, the stripe-unit encoder / decoder 5 is, for example,
The image data is read from the FM1 and the reduced image data is output to the FM2 while operating as an encoder so that the encoded data is output to the code memory 6 in stripe units, or vice versa. It has a function as a decoder that reads the encoded data from the memory 6 and restores the image data in stripe units.

【0012】また、符号化器は、算術符号器にてFFカ
ウンタがオーバーフローした場合には、後述するレジス
タ・メモリ内の正常/失敗フラグに、‘失敗フラグ’を
セットし、符号化の途中でもレジスタ内の終了フラグを
セットして停止するように動作する。逆に、全ての画像
データを符号化できた場合には、正常/失敗フラグに
‘正常フラグ’をセットし、終了フラグを立てて動作を
止める。
In addition, when the FF counter overflows in the arithmetic encoder, the encoder sets a "failure flag" in the normal / failure flag in the register memory described later, and even during the encoding. Operates to stop by setting the end flag in the register. On the contrary, when all the image data can be encoded, the normal / failure flag is set to the'normal flag 'and the end flag is set to stop the operation.

【0013】レジスタ・メモリ4は、符号化/復号化器
1をCPUから制御するためのレジスタ群である。ま
た、コードバッファ・メモリ6は、上述の符号化時の出
力であるビットストリーム、あるいは復号化時の入力と
なるビットストリームを格納する。そして、FM1,F
M3,レジスタ・メモリ4、コード・メモリ6は、後述
するCPUからリード/ライトできるように、システム
バス7に接続されている。
The register memory 4 is a group of registers for controlling the encoder / decoder 1 from the CPU. Further, the code buffer memory 6 stores a bitstream which is an output at the time of encoding or a bitstream which is an input at the time of decoding. And FM1, F
The M3, the register memory 4, and the code memory 6 are connected to the system bus 7 so that they can be read / written by a CPU described later.

【0014】CPU8は、本装置全体を制御するための
中央制御部であり、メモリ9は、CPU8の制御プログ
ラムやデータを格納するためのプログラム・メモリとし
て機能し、ディスク10は、上記のプログラムや画像デ
ータを格納する。図2は、レジスタ・メモリ4の内部構
成を示す図である。図中、11は符号化/復号化する画
像データのXサイズ、12はストライプ分割したときの
ライン数(Yサイズ)であり、本実施例に係る符号化/
復号化器1が1回で処理するライン数を表わす。また、
13は、符号化の場合、符号化器が1ストライプ分の画
像データを符号化したときに発生したビットストリーム
のバイト数(コードレングス)を格納し、復号化の場合
には、復号化器が復号化するビットストリームのバイト
数を格納する領域である。
The CPU 8 is a central control unit for controlling the entire apparatus, the memory 9 functions as a program memory for storing the control program of the CPU 8 and data, and the disk 10 is for the above program and Stores image data. FIG. 2 is a diagram showing an internal configuration of the register memory 4. In the figure, 11 is the X size of the image data to be encoded / decoded, and 12 is the number of lines (Y size) when stripe division is performed.
It represents the number of lines that the decoder 1 processes at one time. Also,
In the case of encoding, 13 stores the number of bytes (code length) of the bit stream generated when the encoder encodes image data for one stripe, and in the case of decoding, the decoder This area stores the number of bytes of the bitstream to be decoded.

【0015】制御コードフィールド14には、符号15
〜18にて示す情報群が入っている。これらの内、15
は、後述する、この符号化器では「符号化できない」と
きにONにする「完全失敗フラグ」、16は、今回の符
号化処理で符号化が成功したか失敗したかを示すフラ
グ、また、17は、符号化/復号化が終了したことを示
すフラグであり、18は、JBIGのAT(Adaptive Te
mplate) の画素のX方向の位置を表わすフィールドであ
り、通常は0、すなわち、AT画素変換を行なわないよ
うになっている。
The control code field 14 has a code 15
Contains information groups indicated by # 18. 15 of these
Is a “complete failure flag” that is turned on when “encoding is not possible” with this encoder, which will be described later, 16 is a flag indicating whether encoding has succeeded or failed in the encoding process of this time, and Reference numeral 17 is a flag indicating that encoding / decoding is completed, and 18 is an AT (Adaptive Te of JBIG).
mplate) is a field indicating the position of the pixel in the X direction, and is usually 0, that is, AT pixel conversion is not performed.

【0016】ATの画素を変更する場合には、0以外の
数値を入れる。この数値の最大値は、符号化/復号化器
の性能で決まるが、本実施例の場合は、それを8とす
る。なお、以下の説明では、この最大値をMx(Mx=
8)と表わす。次に、AT画素変換について説明する。
なお、本説明は、differential-layerを符号化するとき
のテンプレートについて行なう。
When changing the pixel of AT, a value other than 0 is entered. Although the maximum value of this numerical value is determined by the performance of the encoder / decoder, it is set to 8 in the case of the present embodiment. In the following description, this maximum value is Mx (Mx =
Represented as 8). Next, the AT pixel conversion will be described.
It should be noted that this description will be given for the template when the differential-layer is encoded.

【0017】図3は、テンプレートの一例を示し、図
中、画素19,20,21は、高解像度側の画素データ
を、画素22は低解像度側の画素データを示す。また、
画素20は注目画素であり、画素19が、テンプレート
側のATの対象となる画素である。このAT画素と変換
できる可能性のある画素群を図4に示す。図4におい
て、図3との関係を表わすために、AT画素、注目画素
には、図3と同一の番号を付けてある。この中で、図3
のテンプレートの画素と重ならない画素群が全てAT画
素変換の対象となる画素である。例えば、図4の(3,
0)の画素とAT画素変換をする場合、図3の19の位
置の画素値を、図4中の(3,0)の画素値と置き換え
て、参照画素のテンプレートを作り、符号化する。
FIG. 3 shows an example of the template. In the figure, pixels 19, 20, and 21 show pixel data on the high resolution side, and pixels 22 show pixel data on the low resolution side. Also,
The pixel 20 is a pixel of interest, and the pixel 19 is a pixel targeted for AT on the template side. FIG. 4 shows a pixel group that may be converted to the AT pixel. In FIG. 4, in order to express the relationship with FIG. 3, the same numbers as in FIG. 3 are attached to the AT pixel and the target pixel. In this, Figure 3
All the pixel groups that do not overlap with the pixels of the template are target pixels for AT pixel conversion. For example, (3 in FIG.
In the case of performing the AT pixel conversion with the pixel 0), the pixel value at the position 19 in FIG. 3 is replaced with the pixel value (3, 0) in FIG. 4, and a template of the reference pixel is created and encoded.

【0018】このとき、JBIGのビットストリームの
形式に準拠するためには、このAT画素を変更するコー
ドをストライプの切れ目(AT画素を変更するストライ
プの符号化データが始まる前にフローティング・マーカ
ー・コードとしてビットストリームに挿入する必要があ
る)。なお、この処理の詳細は、後述する実際の処理の
中で説明する。
At this time, in order to comply with the JBIG bit stream format, the code for changing the AT pixel is changed to a break of the stripe (a floating marker code before the encoded data of the stripe for changing the AT pixel is started. Must be inserted into the bitstream as). The details of this process will be described later in the actual process.

【0019】また、図4は、二次元のAT画素変換を示
しているが、本実施例では、一次元のみ、すなわち、M
y=0,Mx=8,(3,0)〜(8,0)までの範囲
の画素と置き換えることを考える。以下、本実施例に係
る装置の動作を詳細に説明するが、この説明には、入力
画像としてXサイズ1960画素、Yサイズ1951ラ
インの2値画像データを用い、1ストライプのライン数
としては、入力画像に対して128ラインで符号化する
場合を考える。また、図1のFM1及びFM2のフレー
ム・メモリとして、2048画素×2048画素分の2
値画像データ用のメモリ容量があるものとする。すなわ
ち、2値画像データであるために、(2048/8=2
56バイト)×2048=512Kバイトのメモリ容量
がある。
Although FIG. 4 shows a two-dimensional AT pixel conversion, in the present embodiment, only one dimension, that is, M is used.
Consider replacement with pixels in the range of y = 0, Mx = 8, (3,0) to (8,0). Hereinafter, the operation of the apparatus according to the present embodiment will be described in detail. In this description, binary image data of X size 1960 pixels and Y size 1951 lines is used as an input image, and the number of lines in one stripe is as follows. Consider a case where an input image is encoded with 128 lines. Also, as the frame memory of FM1 and FM2 in FIG.
It is assumed that there is a memory capacity for the value image data. That is, since it is binary image data, (2048/8 = 2
There is a memory capacity of 56 bytes) × 2048 = 512 Kbytes.

【0020】また、図1のFM1には、ディスク10等
から入力された画像データが既にロードされており、レ
ジスタ・メモリ4には、今回の符号化に必要な情報とし
て、Xサイズには1960が、Yサイズには128が、
また、ATlagXには0が既に設定されているものと
する。図7に、今回の入力画像データとストライプとの
関係を示す。ここでは、Y方向のライン数が1951で
あるために、ストライプは全部で16個ある。図に示す
ように、ストライプ0から14までの15個のストライ
プは、1ストライプのライン数が128ラインである
が、最終のストライプ15は31ラインとなる。ここで
は、ストライプ2の画像データを符号化するときに、F
Fカウンタがオーバーフローして符号化できない状態に
なるものとする。
Further, the image data input from the disk 10 or the like is already loaded in the FM 1 of FIG. 1, and the register memory 4 stores 1960 in the X size as information necessary for the present encoding. However, Y size has 128,
Further, it is assumed that 0 is already set in ATlagX. FIG. 7 shows the relationship between the input image data this time and the stripe. Here, since there are 1951 lines in the Y direction, there are 16 stripes in total. As shown in the figure, the 15 stripes from stripes 0 to 14 have 128 lines per stripe, but the final stripe 15 has 31 lines. Here, when encoding the image data of the stripe 2, F
It is assumed that the F counter overflows and cannot be encoded.

【0021】図5及び図6は、上記の画像データを符号
化するときの処理手順を示すフローチャートである。図
5のステップS100は、ストライプの先頭で必ず処理
しなければならない初期化ルーチンである。ここでは、
Committe Draft 11544に記載されているストライプの初
期化処理である。この中の主な処理としては、画像の先
頭であれば、算術符号器の予測テーブル等を初期化した
り、ATlagの値を0にする処理、また、FMを参照
するポインタ等を設定する処理が含まれる。ステップS
101では、図1の符号化/復号化器5の符号化器を起
動し、1ストライプ分の符号化処理を行なう。
FIG. 5 and FIG. 6 are flowcharts showing the processing procedure when the above image data is encoded. Step S100 of FIG. 5 is an initialization routine that must be processed at the beginning of the stripe. here,
This is the stripe initialization process described in Committe Draft 11544. As the main processing in this, at the beginning of the image, there is processing for initializing the prediction table of the arithmetic encoder, setting the value of ATlag to 0, and setting a pointer that references the FM. included. Step S
At 101, the encoder of the encoder / decoder 5 of FIG. 1 is activated to perform encoding processing for one stripe.

【0022】例えば、ストライプ0を符号化するときに
は、FM1に格納されている入力画像データのストライ
プ0の画像データ、すなわち、図7の符号30にて示さ
れる部分の画像データをライン毎に読み込み、JBIG
の方式に基づいて符号化処理を行なう。これにより、ス
トライプ0の部分の縮小画像データがFM2の該当する
位置に、符号化結果のストライプ0のビットストリーム
がコード・メモリ6に各々出力される。
For example, when the stripe 0 is encoded, the image data of the stripe 0 of the input image data stored in the FM1, that is, the image data of the portion indicated by reference numeral 30 in FIG. 7 is read line by line, JBIG
The encoding process is performed based on the method. As a result, the reduced image data of the stripe 0 portion is output to the corresponding position of FM2, and the bit stream of the stripe 0 of the encoding result is output to the code memory 6.

【0023】ストライプ0の全ての画像データの符号化
が終了すると、レジスタ・メモリ4中のコードレングス
・フィールド13にコードメモリ6に出力したビットス
トリームのバイト数を、また、終了フラグ・フィールド
17に終了フラグを、正常/異常フラグ・フィールド1
6には、正常に動作が終了したことを知らせる正常フラ
グを各々セットするように動作する。
When the coding of all the image data of the stripe 0 is completed, the code length field 13 in the register memory 4 is set to the number of bytes of the bit stream output to the code memory 6, and the end flag field 17 is set. Set the end flag to normal / abnormal flag field 1
6 operates to set a normal flag for notifying that the operation is normally completed.

【0024】このとき、CPUは、ステップS102に
て動作が終了か否かの判定を行ない、符号化器がいまだ
に動作中であれば、ステップS103でwaitし、再
度、ステップS102へ戻って符号化器の動作の終了を
待つ。そして、符号化器での符号化を終ると、CPUの
処理はステップS104に移行し、そこで正常終了、つ
まり、FFカウンタがオーバーフローしなかったかどう
かを、図2に示す制御フラグ・フィールドより判断す
る。
At this time, the CPU determines in step S102 whether or not the operation is completed. If the encoder is still in operation, it waits in step S103 and returns to step S102 again to encode. Wait for the operation of the vessel. Then, when the encoding by the encoder is completed, the processing of the CPU proceeds to step S104, where it is normally terminated, that is, it is judged from the control flag field shown in FIG. 2 whether or not the FF counter has overflowed. .

【0025】ストライプ0、及びストライプ1は、正常
に符号化できるため、CPUは処理をステップS105
に移行する。図6は、図5のステップS105に示すコ
ード出力処理の詳細フローチャートである。同図におい
て、ステップS120では、今回のストライプを符号化
する際に、1度でも失敗がなかったかどうかの判断を行
ない、失敗がなければ、ステップS121にて、通常の
終了コード出力を行なう。この処理では、今回のストラ
イプが画像の先頭のストライプであれば何の処理もしな
いが、それ以外のストライプの場合、JBIGの「SD
NORM」のコードを出力する。
Since stripe 0 and stripe 1 can be encoded normally, the CPU executes the processing in step S105.
Move to. FIG. 6 is a detailed flowchart of the code output process shown in step S105 of FIG. In the figure, in step S120, it is determined whether or not there was any failure in encoding the current stripe. If there is no failure, a normal end code is output in step S121. In this process, if the current stripe is the first stripe of the image, no process is performed.
The code "NORM" is output.

【0026】次に、ステップS124に移行し、コード
・メモリ6に出力されているビットストリームを、例え
ば、ディスク10等の記憶媒体に出力する。この処理の
後、図5のステップS106に戻り、今回処理したスト
ライプが最終ストライプか否かの判断をする。そして、
本実施例の場合、ストライプ15が最終ストライプであ
るため、ステップS106での判断結果がNOであれ
ば、次のストライプの準備のために、処理をステップS
107に移す。
Next, in step S124, the bit stream output to the code memory 6 is output to a storage medium such as the disk 10. After this processing, the process returns to step S106 of FIG. 5 and it is determined whether the stripe processed this time is the final stripe. And
In the case of the present embodiment, since the stripe 15 is the final stripe, if the determination result in step S106 is NO, the process proceeds to step S to prepare for the next stripe.
Move to 107.

【0027】一方、今回処理したストライプが15番目
のストライプであれば、ステップS115で最終ストラ
イプの終了コードを出力し、今回のレイヤの符号化を終
了する。このステップS115では、「SDNORN」
か「SDRST」のいずれかのコードを、最終ストライ
プの符号化状態によって出力する。ステップS107で
の処理は、例えば、FM1,FM2をアクセスするため
のポインタやレジスタ情報を、次のストライプ用に計算
する。そして、ストライプ1まで符号化が終ったときの
ビットストリームは、図8に示す24,25,26まで
を出力したことになる。
On the other hand, if the stripe processed this time is the 15th stripe, the end code of the final stripe is output in step S115, and the coding of the current layer is ended. In this step S115, "SDNORN"
, Or "SDRST" is output depending on the encoding state of the final stripe. In the process in step S107, for example, pointers and register information for accessing FM1 and FM2 are calculated for the next stripe. Then, the bit stream after the coding up to the stripe 1 is 24, 25, and 26 shown in FIG.

【0028】次に、ストライプ2を符号化するときの動
作を説明する。このストライプ2は、算術符号器のFF
カウンタがオーバーフローして符号化できないストライ
プである。そのため、図5に示すフローチャート中のス
テップS104の判断は、上記の場合とは異なるNOと
なり、処理はステップS105−1に移ることになる。
このステップS105では、ATLagXの値を1イン
クリメントし、続くステップS108で、そのATLa
gXの値とMxとを比較する。
Next, the operation when the stripe 2 is encoded will be described. This stripe 2 is the FF of the arithmetic encoder
It is a stripe that the counter overflows and cannot be encoded. Therefore, the determination in step S104 in the flowchart shown in FIG. 5 is NO, which is different from the above case, and the process proceeds to step S105-1.
In this step S105, the value of ATLagX is incremented by 1, and in the following step S108, the ATLa
The value of gX is compared with Mx.

【0029】ここでの比較で、ATLagXがMx(=
8)より値が大きくなっていれば、符号化失敗と判断し
てステップS109に移り、レジスタ・メモリ4中の制
御コード・フィールド14の「完全に失敗フラグ」をセ
ットして、符号化を終了する。また、ATLagXがM
xよりも値が小さいときは、ステップS110にて、F
M1,FM2へのポインタ等を本ストライプ(ストライ
プ2)の先頭(図7の23の位置)に戻し、算術符号器
の予測テーブルを0クリアして、本ストライプで1度符
号化を失敗したことを記憶しておいて、再度符号化する
ためにステップS101に戻る。
In this comparison, ATLaggX is Mx (=
If the value is larger than 8), it is judged that the encoding has failed, the process proceeds to step S109, the "completely failed flag" of the control code field 14 in the register memory 4 is set, and the encoding ends. To do. Also, ATLabX is M
When the value is smaller than x, in step S110, F
The pointers to M1 and FM2 are returned to the head of the main stripe (stripe 2) (position 23 in FIG. 7), the prediction table of the arithmetic encoder is cleared to 0, and the encoding fails once in this stripe. Is stored and the process returns to step S101 to be encoded again.

【0030】なお、ステップS101でJBIG準拠の
符号化を行なう際、ATlagXの値が0でないため
に、AT画素を変更した画素にして、参照画素のテンプ
レートを作り符号化するように動作する。ステップS1
02,S104で、本ストライプの符号化が終ったかど
うかの判断を行ない、符号化を再度失敗している場合、
ステップS105−1以降の処理ルーチンを実行する。
しかし、符号化が無事終了していれば、ステップS10
5のコード出力処理ルーチンに飛ぶ。なお、図6のステ
ップS120では、今回の処理で、1度以上符号化に失
敗しているため、処理をステップS122に移し、異常
終了のコードとして、JBIGで規定している「SDR
ST」コードを出力する。このルーチンもステップS1
21と同様、今回のストライプが画像の先頭のストライ
プであれば何も出力しない。
When the JBIG-compliant encoding is performed in step S101, since the value of ATlagX is not 0, the AT pixel is changed to a pixel and a reference pixel template is created to perform encoding. Step S1
02, S104, it is judged whether or not the encoding of this stripe is completed, and if the encoding has failed again,
The processing routine after step S105-1 is executed.
However, if the encoding is completed successfully, step S10
It jumps to the code output processing routine of 5. In step S120 of FIG. 6, since the encoding has failed once or more in this process, the process is moved to step S122, and the abnormal termination code “SDR” specified in JBIG is set.
The "ST" code is output. This routine is also step S1
Similar to 21, if the current stripe is the first stripe of the image, nothing is output.

【0031】ステップS123では、ATlagXを変
更したことを知らせるためのフローティング・マーカー
コード(ATMOVE)を出力する。その後、ステップ
S124で、今回の符号化で出力したビットストリーム
をディスク10等に出力する。図8の24〜29まで
に、以上の処理を行なったときのビットストリームの状
態を示し、その後は、図5のステップS106に戻り、
上述の処理を最後のストライプまで行なう。
In step S123, a floating marker code (ATMOVE) for notifying that ATlagX has been changed is output. Then, in step S124, the bit stream output by the current encoding is output to the disk 10 or the like. 24 to 29 of FIG. 8 show the state of the bit stream when the above processing is performed, and thereafter, the process returns to step S106 of FIG.
The above process is repeated until the final stripe.

【0032】以上説明したように、本実施例によれば、
入力画像をJBIG準拠の符号化方式で符号化する場
合、算術符号化器内部のFFカウンタがオーバーフロー
したときに、符号化の際の予測モデルとして用いる参照
画素のテンプレートをJBIGのATの機能を利用して
変更し、符号化できなかった画像データに対しては再符
号化を行なう機能を持たせることにより、算術符号器等
の符号器内部のハードウエア規模を大きくすることな
く、JBIGに準拠した算術符号を用いる符号化方式に
て符号化する際、符号化ができなくなる確率を小さくす
ることができる。
As described above, according to this embodiment,
When the input image is encoded by the JBIG compliant encoding method, when the FF counter inside the arithmetic encoder overflows, the JBIG AT function is used as the template of the reference pixel used as the prediction model for encoding. By providing the function of re-encoding the image data that could not be encoded, the JBIG standard was complied with without increasing the hardware scale inside the encoder such as the arithmetic encoder. It is possible to reduce the probability that encoding cannot be performed when encoding is performed by the encoding method using the arithmetic code.

【0033】また、符号化の際に、各ストライプのビッ
トストリームのターミネーイト・コードとして、「SD
NORM」と「SDRST」を使い分け、「ATMOV
E」を行なう場合には、「SDRST」を使い、算術符
号器等のストライプ単位の処理を「SDNORM」と
「SDRST」で切り分けて行なうことにより、最終的
に出力されるビットストリームがJBIG準拠のビット
ストリーム形式を得ることが可能である。
In addition, at the time of encoding, as a termination code of the bit stream of each stripe, "SD
Using "NORM" and "SDRST" properly, "ATMOV"
When “E” is performed, “SDRST” is used, and the processing in stripe units such as the arithmetic encoder is divided into “SDNORM” and “SDRST” so that the finally output bit stream conforms to JBIG. It is possible to get the bitstream format.

【0034】なお、上記実施例に係る装置にて符号化を
終了すると、FM2には、FM1より1段階解像度が低
い縮小画像ができ、階層符号化する場合、FM2を入力
画像用、FM1を出力画像用フレーム・メモリに切り替
えて使用したり、あるいは、FM2の縮小画像データを
FM1に複写して使っても良い。上記実施例では、処理
として第1階層目の動作について説明したが、階層符号
化をしている際の途中の階層にあっても良いし、また、
differential-layerではなくlowest-layerの符号化にお
いても同様の処理が可能である。 [第2実施例]次に、本発明の第2の実施例について説
明する。
When encoding is completed in the apparatus according to the above embodiment, a reduced image having a one-step resolution lower than that of FM1 is formed in FM2, and when hierarchical encoding is performed, FM2 is used as an input image and FM1 is output. The image frame memory may be switched to be used, or the reduced image data of FM2 may be copied to FM1 for use. In the above embodiment, the operation of the first layer has been described as the process, but it may be in a layer in the middle of the layer coding, or
The same process can be performed in encoding the lowest-layer instead of the differential-layer. [Second Embodiment] Next, a second embodiment of the present invention will be described.

【0035】本第2実施例では、AT画素の変換を二次
元で行なう場合を説明する。なお、本実施例に係る画像
符号化装置の構成は、上記第1実施例と同じであるた
め、ここでは、その図示及び説明を省略する。図9は、
本実施例に係るレジスタ・メモリ4の構成例を示す図で
ある。また、図10,11は、CPUの処理手順を示す
フローチャートであるが、図中、第1の実施例と同一動
作、同一処理を表わすものには同一番号を付してあり、
それらの詳細な説明は省略する。
In the second embodiment, the case where the conversion of AT pixels is performed two-dimensionally will be described. The configuration of the image coding apparatus according to the present embodiment is the same as that of the first embodiment described above, and therefore, illustration and description thereof will be omitted here. Figure 9
It is a figure which shows the structural example of the register memory 4 which concerns on a present Example. 10 and 11 are flowcharts showing the processing procedure of the CPU. In the drawings, the same operations and the same processings as those in the first embodiment are designated by the same reference numerals.
Detailed description thereof will be omitted.

【0036】図9に示すレジスタ・メモリ4の構成にお
いて、ATlagY35のフィールドが、図2に示す上
記第1の実施例に係るレジスタ・メモリの構成に対して
加わっている部分である。なお、ここでのMx,Myの
値は、Mx=8,My=4とする。本実施例において、
CPUが行なう処理で上記第1の実施例と異なっている
部分は、ATlagYの制御である。すなわち、図10
の初期化ルーチンであるステップS124では、ATl
agXの0クリアと同時に、ATlagYの値も0クリ
アする。そして、算術符号器のFFカウンタのオーバー
フローで符号化に失敗した場合には、ステップS116
に移行する。
In the structure of the register memory 4 shown in FIG. 9, the field of ATlagY35 is a part added to the structure of the register memory according to the first embodiment shown in FIG. The values of Mx and My here are Mx = 8 and My = 4. In this example,
The difference in the processing performed by the CPU from the first embodiment is the control of ATlagY. That is, FIG.
In step S124, which is the initialization routine of
At the same time that agX is cleared to 0, the value of ATlagY is also cleared to 0. If the encoding fails due to the overflow of the FF counter of the arithmetic encoder, step S116.
Move to.

【0037】図11は、図10のステップS116の詳
細フローチャートである。同図のステップS131で
は、ATlagXを1インクリメントし、ステップS1
32で、ATlagXとMx(=8)とを比較する。こ
のとき、ATlagXの値がMxよりも大きければ処理
をステップS133に移し、AtlagYを1インクリ
メントするとともに、ATlagXを−Mx(−8)に
セットする。
FIG. 11 is a detailed flowchart of step S116 of FIG. In step S131 of the figure, ATlagX is incremented by 1, and step S1
At 32, ATlagX and Mx (= 8) are compared. At this time, if the value of ATlagX is larger than Mx, the process proceeds to step S133, AtlagY is incremented by 1, and ATlagX is set to −Mx (−8).

【0038】次に、ステップS134で、ATlagY
の値とMyとを比較し、ATlagYがMy(=4)よ
り大きければ、完全に符号化が失敗ということで処理ス
テップS135に移る。このステップS135では、全
て移動したとされるので、処理が図10のステップS1
17に移ると、そこでの判定結果はYESとなるので、
ステップS109にて符号化を終了する。なお、このと
きのステップS109での処理は、上記第1の実施例と
同様である。
Next, in step S134, ATlagY
Is compared with My, and if ATlagY is larger than My (= 4), it means that the encoding has completely failed, and the process proceeds to step S135. In this step S135, since it is assumed that everything has moved, the process is step S1 in FIG.
If you move to 17, the judgment result will be YES, so
The encoding ends in step S109. The processing in step S109 at this time is the same as that in the first embodiment.

【0039】また、その他の場合、つまり、図11のス
テップS132、あるいはステップS134での判定が
NOで、ステップS136で全ては移動していないとさ
れると、図10のステップS117での判定結果はNO
となる。よって、ステップS110では、上記第1の実
施例と同様、再符号化をAT画素変換しながら行なう。
この場合、符号化器は、二次元のATMOVEの機能を
サポートする必要がある。
In other cases, that is, if the determination in step S132 or step S134 of FIG. 11 is NO and it is determined that all of them have not moved in step S136, the determination result in step S117 of FIG. Is NO
Becomes Therefore, in step S110, re-encoding is performed while converting AT pixels, as in the first embodiment.
In this case, the encoder needs to support the functionality of the two-dimensional ATMOVE.

【0040】このように、本実施例では、完全に符号化
を失敗する可能性を、上記第1の実施例より下げること
ができる。 [第3の実施例]上記第1の実施例、及び第2の実施例
では、入力画像をストライプ分割し、符号化をストライ
プ単位に行なっているが、本実施例では、入力画像をス
トライプに分割しない場合を考える。この場合、第1、
第2の実施例で説明したストライプという概念を、入力
画像に対して1つであると考えれば良い。
As described above, in this embodiment, the possibility of completely failing in encoding can be lowered as compared with the first embodiment. [Third Embodiment] In the first and second embodiments described above, the input image is divided into stripes and the encoding is performed in stripe units. However, in the present embodiment, the input image is divided into stripes. Consider the case of not dividing. In this case, the first,
The concept of stripes described in the second embodiment may be considered as one for the input image.

【0041】図12は、本実施例に係る画像データとス
トライプとの関係を示す図である。ストライプ分割する
場合の両者の関係を図7に示したが、これと同一の意味
のものには同一の番号を付けてある。すなわち、図1の
レジスタ・メモリ4のYサイズ12のフィールドに、入
力画像のYサイズを入れれば良い。また、符号化に失敗
した場合には、AT画素を変更して再符号化を行なう
が、第1、第2の実施例で説明した、失敗したストライ
プの先頭に制御を戻す制御を、ここでは画像の先頭に戻
し、全画像データに対して再符号化を行なえば良い。こ
のとき、AT画素の変更は、一次元/二次元のどちらで
も良い。
FIG. 12 is a diagram showing the relationship between image data and stripes according to this embodiment. FIG. 7 shows the relationship between the two in the case of dividing into stripes, and the same meanings as those are given the same numbers. That is, the Y size of the input image may be entered in the Y size 12 field of the register memory 4 of FIG. Further, when the encoding fails, the AT pixel is changed and the re-encoding is performed. However, the control for returning the control to the head of the failed stripe described in the first and second embodiments is performed here. It is sufficient to return to the beginning of the image and re-encode all image data. At this time, the change of the AT pixel may be either one-dimensional or two-dimensional.

【0042】階層を使って符号化を行なわない場合に
は、シーケンシャル・オンリ・モード、すなわち、階層
符号化のlowest-layerの符号化を直接、入力画像に対し
て行なえば良い。図13、図14に、lowest-layerを符
号化するときの参照画素テンプレートの例を示す。な
お、図中、図3に示すdifferential-layer時と同一の意
味のものには同一の番号を付けてある。
When the coding is not performed using the hierarchy, the sequential only mode, that is, the lowest-layer coding of the hierarchy coding may be directly performed on the input image. 13 and 14 show examples of reference pixel templates when the lowest-layer is encoded. In the figure, the same numbers as those in the differential-layer shown in FIG. 3 are assigned the same numbers.

【0043】ここでの両者の相違点は、differential-l
ayerの場合は、高解像度側と低解像度側の画素データ両
方を参照したが、lowest-layerの場合は、この階層より
低解像度の画像データはないので、この階層の画像デー
タのみから符号化することになる。また、参照画素のテ
ンプレートとして、2ライン/3ライン用の2種類があ
り、これの切り替えは、符号化画像1枚で一回行なう。
The difference between the two is that the differential-l
In the case of ayer, both the high-resolution side and low-resolution side pixel data were referenced, but in the case of lowest-layer, there is no lower resolution image data than this layer, so encoding is performed only from this layer image data. It will be. There are two types of reference pixel templates for 2 lines / 3 lines, and switching between them is performed once for one encoded image.

【0044】これらの情報は、ここでは、不図示のビッ
トストリームのヘッダ情報として、ビットストリームの
中に格納することができる。また、この階層を符号化す
る場合のAT画素変換の原理は、differential-layerを
符号化するときと同じであり、変更可能な画素の領域
は、図4に示したものと同じである。さらに、このとき
の動作も、上記第1、第2の実施例で説明したものと同
様に行なえる。 [第4実施例]以下、本発明に係る第4の実施例につい
て説明する。
Here, these pieces of information can be stored in the bitstream as header information of a bitstream (not shown). Further, the principle of AT pixel conversion in the case of encoding this layer is the same as that in the case of encoding the differential-layer, and the changeable pixel area is the same as that shown in FIG. Further, the operation at this time can be performed in the same manner as described in the first and second embodiments. [Fourth Embodiment] The fourth embodiment according to the present invention will be described below.

【0045】なお、本実施例にて使用する符号化方式
は、国際標準化委員会内のJBIGで検討されているよ
うな算術符号方式を用いた2値画像の階層符号化方式に
より符号化を行ない、算術符号方式にて符号化ができな
い場合は、その部分の元画像を他の符号化方式にて符号
化し、送信する。また、ここでは、階層符号化を行なう
際、入力画像をストライプに分割し、ストライプ単位に
符号化/復号化することを考える。
The coding method used in this embodiment is a hierarchical coding method for binary images using an arithmetic coding method as examined by JBIG in the International Standardization Committee. When the encoding cannot be performed by the arithmetic encoding method, the original image of that portion is encoded by another encoding method and transmitted. In addition, here, when performing hierarchical encoding, it is considered that the input image is divided into stripes and encoding / decoding is performed in stripe units.

【0046】図15は、本実施例に係る画像符号化装置
の全体構成を示すブロック図である。なお、同図におい
て、図1に示す上記第1実施例に係る画像符号化装置と
同一構成要素には同一符号を付し、ここでは、それらの
説明を省略する。図15において、レジスタ・メモリ4
は、実際の符号化/復号化を行なうエンコード/デコー
ド器5´を制御するためのメモリである。このエンコー
ド/デコード器5´は、ストライプ単位に符号化/復号
化を行ない、内部にある算術符号器内のFFカウンタが
オーバーフローし、符号化ができない場合、レジスタ・
メモリ4内の該当フラグをセットして動作を停止する。
また、1つのストライプ分の画像データの符号化/復号
化を正常に終わると、レジスタ・メモリ4内の該当フラ
グをセットして、次の動作を待つ。
FIG. 15 is a block diagram showing the overall structure of the image coding apparatus according to this embodiment. In the figure, the same components as those of the image coding apparatus according to the first embodiment shown in FIG. 1 are designated by the same reference numerals, and the description thereof will be omitted here. In FIG. 15, the register memory 4
Is a memory for controlling the encoder / decoder 5'which performs actual encoding / decoding. This encoder / decoder 5'performs encoding / decoding on a stripe-by-stripe basis, and if the FF counter in the internal arithmetic encoder overflows and encoding cannot be performed, register / decoding is performed.
The corresponding flag in the memory 4 is set to stop the operation.
When the encoding / decoding of the image data for one stripe is completed normally, the corresponding flag in the register memory 4 is set and the next operation is waited for.

【0047】図16は、エンコード/デコード器5´の
符号器部分の内部構成を示すブロック図である。図中、
信号116は、高解像度側のフレーム・メモリから画像
データを入力するための信号であり、信号117は、低
解像度側のフレーム・メモリへ画像データを出力するた
めの信号である。そして、これは、後述する縮小器11
1の出力信号である。なお、ここでは、フレーム・メモ
リであるFM1とFM2の切り替え方式は、特に限定し
ない。
FIG. 16 is a block diagram showing the internal structure of the encoder portion of the encoder / decoder 5 '. In the figure,
The signal 116 is a signal for inputting image data from the high resolution side frame memory, and the signal 117 is a signal for outputting image data to the low resolution side frame memory. And, this is a reducer 11 described later.
1 output signal. Here, the switching method of the frame memories FM1 and FM2 is not particularly limited.

【0048】縮小器111は、高解像度の画像データと
低解像度の画像データを参照しながら、1段解像度が下
がった画像データを作成する。算術符号器113は、高
解像度側の画像データ116と縮小器111の出力結果
である縮小画像を参照しながら符号化する。また、11
2は、算術符号器113の算術符号とは別の符号化を行
なう符号器であり、本第4実施例では、原画像をそのま
ま符号とする方式を考える。そして、コード切り替え器
114は、符号器112及び算術符号器113からの出
力を切り替え、その出力は、コード・メモリ6となる。
なお、115は、コード切り替え器114のコード切り
替え器を制御するための切り替え信号である。
The reducer 111 refers to the high-resolution image data and the low-resolution image data, and creates the image data whose resolution is lowered by one step. The arithmetic encoder 113 encodes while referring to the high resolution image data 116 and the reduced image which is the output result of the reducer 111. Also, 11
Reference numeral 2 denotes an encoder that performs encoding different from the arithmetic code of the arithmetic encoder 113. In the fourth embodiment, a method in which the original image is used as it is is considered. Then, the code switching unit 114 switches the outputs from the encoder 112 and the arithmetic encoder 113, and the output becomes the code memory 6.
Note that 115 is a switching signal for controlling the code switching unit of the code switching unit 114.

【0049】図17は、本実施例におけるレジスタ・メ
モリ4の内部構成の一例を示す図である。ここでは、上
記第1実施例におけるレジスタ・メモリと同様、図中の
118は、符号化/復号化する画像データのXサイズ
を、また、119はストライプ分割したときの1ストラ
イプのライン数を示し、本実施例における符号化器/復
号化器が1回で処理するライン数を表わす。また、12
0は、符号化時には符号化器が1ストライプ分の画像デ
ータを符号化したときに発生したビットストリームのバ
イト数を、逆に、復号化時には、これから復号器が復号
するビットストリームのバイト数を表わすコード・レン
グスである。
FIG. 17 is a diagram showing an example of the internal configuration of the register memory 4 in this embodiment. Here, similarly to the register memory in the first embodiment, reference numeral 118 in the drawing indicates the X size of the image data to be encoded / decoded, and 119 indicates the number of lines in one stripe when divided into stripes. , Represents the number of lines processed by the encoder / decoder in this embodiment at one time. Also, 12
0 indicates the number of bytes of the bit stream generated when the encoder encodes image data for one stripe during encoding, and conversely, the number of bytes of the bit stream to be decoded by the decoder during decoding. This is the chord length to represent.

【0050】そして、制御コード・フィールド121に
は、各情報が格納された制御フラグ群である、符号化器
/復号化器が符号化/復号化の動作を終了したことを表
わす終了フラグ122、符号時に算術符号器内のFFカ
ウンタがオーバーフローして符号化ができなかったこと
を示す符号化失敗グラフ123、算術符号を使うか、あ
るいは他の符号化を使うかを示す切り替えフラグ124
が入っており、図16の切り替え信号115を制御する
ものである。
The control code field 121 is a control flag group in which each piece of information is stored. An end flag 122 indicating that the encoder / decoder has completed the encoding / decoding operation, An encoding failure graph 123 indicating that the FF counter in the arithmetic encoder overflowed at the time of encoding and the encoding could not be performed, and a switching flag 124 indicating whether to use the arithmetic code or another encoding.
, And controls the switching signal 115 in FIG.

【0051】以下、本実施例に係る装置の動作を詳細に
説明する。なお、ここでの説明に用いる画像データは、
Xサイズ=1960画素、Yサイズ=1951画素と
し、1ストライプのライン数は、入力画像に対して12
8ラインとして符号化することを考える。また、図15
のFM1、及びFM2のフレーム・メモリは、2048
画素×2048画素分の2値画像データが格納できるメ
モリ容量があるものとする。すなわち、2値画像データ
であるために、(2048/8=256バイト)×20
48ライン=512Kバイトのメモリ容量があるものと
する。
The operation of the apparatus according to this embodiment will be described in detail below. The image data used for the explanation here is
X size = 1960 pixels, Y size = 1951 pixels, and the number of lines in one stripe is 12 with respect to the input image.
Consider encoding as 8 lines. In addition, FIG.
The FM1 and FM2 frame memories are 2048
It is assumed that there is a memory capacity capable of storing binary image data of pixels × 2048 pixels. That is, since it is binary image data, (2048/8 = 256 bytes) × 20
It is assumed that there is a memory capacity of 48 lines = 512 Kbytes.

【0052】また、符号化に先立って、図15のFM1
に、ディスク10等から入力画像データが既にロードさ
れており、符号化に必要な情報としてレジスタ・メモリ
4内のXサイズ・フィールドに、入力画像のXサイズで
ある1960が、Yサイズ・フィールドには、符号器が
1回で処理するライン数が設定されている。つまり、ス
トライプ分割する場合には、1ストライプのライン数で
ある128が、また、制御コード・フィールドの切り替
えフラグには、算術符号器側を使うことを示すフラグが
各々、不図示の方法により設定されているものとする。
Prior to encoding, FM1 in FIG.
In addition, the input image data has already been loaded from the disc 10 or the like, and the X size field in the register memory 4 is stored in the X size field of the input image as the information necessary for encoding in the Y size field. Is set to the number of lines processed by the encoder at one time. In other words, when dividing into stripes, the number of lines in one stripe is 128, and in the control code field switching flag, a flag indicating that the arithmetic encoder side is used is set by a method not shown. It has been done.

【0053】図18は、入力画像データがFM1にロー
ドされたときのフレーム・メモリと画像データ、ストラ
イプとの関係を示す図である。図中、130はフレーム
・メモリのサイズを、131は画像データのサイズを示
す。画像データはストライプ分割されているので、各ス
トライプは、図18に示すようになっており、1ストラ
イプのライン数が128ライン、入力画像のYサイズが
1951ラインなので、ストライプは16個ある。
FIG. 18 is a diagram showing the relationship between the frame memory, image data, and stripes when the input image data is loaded into FM1. In the figure, 130 indicates the size of the frame memory and 131 indicates the size of the image data. Since the image data is divided into stripes, each stripe is as shown in FIG. 18. Since the number of lines in one stripe is 128 lines and the Y size of the input image is 1951 lines, there are 16 stripes.

【0054】16個のストライプの内、0〜14まで
は、1ストライプのライン数は128ラインであるが、
ストライプ15は、残りの31ラインである。そこで、
ストライプ15を符号化するときには、図17のYサイ
ズ・フィールドに31をセットすることになる。なお、
図18のストライプ2を符号化するときには、算術符号
器内のFFカウンタがオーバーフローして符号化できな
い状態に成るものとする。
Of the 16 stripes, 0 to 14 have 128 lines per stripe,
The stripe 15 is the remaining 31 lines. Therefore,
When the stripe 15 is encoded, 31 will be set in the Y size field of FIG. In addition,
When the stripe 2 in FIG. 18 is encoded, the FF counter in the arithmetic encoder overflows and cannot be encoded.

【0055】そこで、図19に示すフローチャートを参
照して、本実施例において画像データを符号化する際、
CPU8が行なう処理内容について説明する。図19の
ステップS1100は、ストライプの先頭で行なう初期
化ルーチンである。ここでは、Committee Draft 11544
に記載されているように、今回のストライプが画像デー
タの先頭であれば、算術符号器内の予測テーブルを0ク
リアし、算術符号器内の変数の初期化やフレーム・メモ
リをアクセスするためのポインタ等を設定する処理が含
まれる。また、本ステップでは、切り替えフラグ124
を算術符号器側にセットする。
Therefore, referring to the flowchart shown in FIG. 19, when the image data is encoded in this embodiment,
The contents of processing performed by the CPU 8 will be described. Step S1100 of FIG. 19 is an initialization routine performed at the beginning of the stripe. Here, Committee Draft 11544
As described in, if the stripe this time is the beginning of the image data, the prediction table in the arithmetic encoder is cleared to 0, and the variables for initializing variables in the arithmetic encoder and accessing the frame memory are accessed. A process of setting a pointer or the like is included. Further, in this step, the switching flag 124
Is set on the arithmetic encoder side.

【0056】次のステップS1101では、図15に示
すエンコード/デコード器5´の符号器を起動し、1ス
トライプ分の符号化処理を行なう。例えば、ストライプ
0の画像データを符号化する場合には、先ず、高解像度
側、すなわち、入力画像データがFM1に格納されてい
るので、縮小画像をFM2に作る。そして、図16に示
す信号116をFM1に、信号117をFM2に接続し
て、FM1をアクセスするポインタをストライプ0の先
頭画素の位置、つまり、図18の133の位置にセット
する。FM2のポインタも該当する位置にセットする。
In the next step S1101, the encoder of the encoder / decoder 5'shown in FIG. 15 is activated and the encoding process for one stripe is performed. For example, when encoding the image data of the stripe 0, first, since the high resolution side, that is, the input image data is stored in FM1, a reduced image is created in FM2. Then, the signal 116 shown in FIG. 16 is connected to FM1 and the signal 117 is connected to FM2, and the pointer for accessing FM1 is set to the position of the leading pixel of stripe 0, that is, the position of 133 in FIG. The pointer of FM2 is also set at the corresponding position.

【0057】その後、実際に符号器を起動かけると、コ
ード切り替えフラグ124は、算術符号器側を選択する
ようにセットされているので、算術符号器113が動作
する。ここでは、縮小器111が、高解像度側の画像デ
ータと、既に縮小した画像データを参照して縮小画像を
作成し、その出力結果をFM2に書き込むと同時に、算
術符号器113にも送る。また、高解像度の画像データ
は、信号116から直接、算術符号器113に入る。算
術符号器113は、高解像度側、低解像度側の画像デー
タから、符号化する際の参照画素のテンプレートを作成
し、算術符号化を行なってその結果をコード切り替えス
イッチ114に送る。
After that, when the encoder is actually activated, the code switching flag 124 is set so as to select the arithmetic encoder side, and therefore the arithmetic encoder 113 operates. Here, the reduction unit 111 creates a reduced image by referring to the image data on the high resolution side and the already reduced image data, writes the output result in the FM2, and at the same time, sends it to the arithmetic encoder 113 as well. Further, the high-resolution image data enters the arithmetic encoder 113 directly from the signal 116. The arithmetic encoder 113 creates a template of reference pixels for encoding from the image data on the high resolution side and the low resolution side, performs arithmetic encoding, and sends the result to the code changeover switch 114.

【0058】コード切り替えスイッチ114は、切り替
え信号115で符号器112と算術符号器113からの
出力の切り替えを行なうが、今回の処理では、それが算
術符号器側になっているので、算術符号器113の出力
をコード・メモリ6に出力するように動作する。以上の
処理を1ストライプ分の画像データに対して行ない、そ
の処理が終了すると、レジスタ・メモリ4内の終了フラ
グ122をONにする。また、このストライプは、FF
カウンタがオーバーフローしていないので、失敗フラグ
123はOFFにされる。そして、実際に出力した符号
のバイト数をコード・レングス・フィールド120に書
き込む。
The code changeover switch 114 switches the output from the encoder 112 and the arithmetic encoder 113 by the switching signal 115. In this processing, however, since it is on the arithmetic encoder side, the arithmetic encoder is It operates to output the output of 113 to the code memory 6. The above processing is performed on the image data for one stripe, and when the processing is completed, the end flag 122 in the register memory 4 is turned ON. Also, this stripe is FF
Since the counter has not overflowed, the failure flag 123 is turned off. Then, the number of bytes of the actually output code is written in the code length field 120.

【0059】CPU8は、この間、ステップS1102
で符号化が終了したか否かを判断し、まだ動作中であれ
ば、ステップS1103でwait後、再度、ステップ
S1102の処理に戻る動作を行なう。また、符号化器
の動作が終了すると、ステップS1104に進み、そこ
で正常終了したかどうかを失敗フラグ123より判断す
る。この失敗フラグがOFFであれば、CPU8は、処
理をステップS1105に進め、正常時のマーカー・コ
ード出力を行なう。ここでは、今回のストライプが画像
の先頭かどうかを判断し、それが先頭であれば、何の処
理も行なわない。しかし、ストライプが画像の先頭であ
れば、マーカー・コードとして「SDNORM」をディ
スク10等に出力する。
During this period, the CPU 8 executes step S1102.
In step S1103, it is determined whether or not the encoding has been completed, and if it is still in operation, after the wait in step S1103, the operation of returning to the process of step S1102 is performed again. When the operation of the encoder is completed, the process proceeds to step S1104, and it is determined from the failure flag 123 whether or not the operation is completed normally. If the failure flag is OFF, the CPU 8 advances the process to step S1105 and outputs the marker code at the normal time. Here, it is determined whether or not the current stripe is at the beginning of the image, and if it is at the beginning, no processing is performed. However, if the stripe is at the beginning of the image, "SDNORM" is output as the marker code to the disk 10 or the like.

【0060】ステップS1106では、コード・メモリ
6からコード・レングス・フィールド120に書かれて
いるバイト数を読み出し、それに対応するビットストリ
ームをディスク10等に出力する。その後、ステップS
1110に進み、今回処理したストライプが最終ストラ
イプか否かを判断する。それが最終ストライプでなけれ
ばステップS1100に戻り、次のストライプを符号化
する。しかし、ステップS1110で、ストライプが最
終ストライプであると判断されれば、ステップS111
1で最後のマーカー・コードとして「SDNORM」を
ディスク10に出力する。
In step S1106, the number of bytes written in the code length field 120 is read from the code memory 6 and the corresponding bit stream is output to the disk 10 or the like. After that, step S
In step 1110, it is determined whether the stripe processed this time is the final stripe. If it is not the final stripe, the process returns to step S1100 to encode the next stripe. However, if it is determined in step S1110 that the stripe is the final stripe, step S111.
When "1", "SDNORM" is output to the disk 10 as the last marker code.

【0061】以上の処理を、例えば、ストライプ1まで
行なったときには、ディスク10のビットストリーム
は、図20に示すビットストリームの内、230〜23
2までが出力される。次に、符号化処理中に算術符号器
内のFFカウンタがオーバーフローするストライプ2の
符号化処理について説明する。
When the above processing is performed up to, for example, stripe 1, the bit stream of the disk 10 is 230 to 23 of the bit streams shown in FIG.
Up to 2 are output. Next, the encoding process of the stripe 2 in which the FF counter in the arithmetic encoder overflows during the encoding process will be described.

【0062】このストライプも、最初は上記の処理と同
様、算術符号器で符号化処理を行なっているが、そのと
き、FFカウンタがオーバーフローすると、符号器は終
了フラグ122をONにし、失敗フラグ123をONに
して動作を終了する。そこで、CPU8は、ステップS
1104でNOと判断し、ステップS1107に進む。
この段階では、ここまで算術符号器が出力したコード
は、コード・メモリ6に入っているが、ここでは無視す
る。そして、レジスタ・メモリ4中のコード・レングス
・フィールド120に1ストライプ分のデータ量である
バイト数を計算して入力する。
Initially, this stripe is also encoded by the arithmetic encoder as in the case of the above processing. At that time, if the FF counter overflows, the encoder turns on the end flag 122 and the failure flag 123. Is turned on to end the operation. Therefore, the CPU 8 performs step S
If NO is determined in 1104, the process proceeds to step S1107.
At this stage, the code output by the arithmetic encoder up to this point is stored in the code memory 6, but is ignored here. Then, the number of bytes, which is the data amount for one stripe, is calculated and input to the code length field 120 in the register memory 4.

【0063】今回の処理では、画素数は1960画素×
128画素であるから、1960×128/8=313
60バイトをセットする。そして、失敗したことを表わ
すマーカー・カードとして、「SDRST」をディスク
10に出力する。このマーカー・コード出力も、上記ス
テップS1105と同様、今回のストライプが画像の先
頭であれば、何の処理もしない。しかし、ストライプが
画像の先頭でなければ、このマーカー・コードを出力す
る。
In this processing, the number of pixels is 1960 pixels ×
Since there are 128 pixels, 1960 × 128/8 = 313
Set 60 bytes. Then, "SDRST" is output to the disk 10 as a marker card indicating that the operation has failed. Similar to step S1105, this marker code output is also not processed if the current stripe is at the beginning of the image. However, if the stripe is not at the beginning of the image, this marker code is output.

【0064】次に、ユーザ独自のコードを識別するため
に「COMMENT」マーカー・コードをディスクに出
力する。この「COMMENT」マーカー・コードに、
その後に続く画像データのバイト数(今回は3136
0)を入れる。このとき、算術符号器内の予測テーブル
は0クリアする。そして、CPU8は、ステップS11
08にて、ストライプ2の先頭に制御を戻すとともに、
切り替えフラグ124を別符号化側にセットする。
Next, the "COMMENT" marker code is output to the disc to identify the user's unique code. In this "COMMENT" marker code,
Number of bytes of image data that follows (3136 this time)
Enter 0). At this time, the prediction table in the arithmetic encoder is cleared to 0. Then, the CPU 8 executes step S11.
At 08, while returning control to the head of stripe 2,
The switching flag 124 is set to another encoding side.

【0065】今回の処理では、高解像度側の画像データ
をそのまま出力するモードであるから、ステップS11
09にて、再度、ストライプ2を符号化するように符号
化器を起動する。そうすることで縮小器111が動作
し、縮小画像が作成される。また、符号器としては他符
号器112が選択され、信号116からの高解像度の画
像データがそのままコード切り替えスイッチ114に送
られるよう、他符号器112が動作する。
In this processing, since the mode is the mode in which the high resolution image data is output as it is, step S11
At 09, the encoder is activated again to encode stripe 2. By doing so, the reducer 111 operates and a reduced image is created. Further, the other encoder 112 is selected as the encoder, and the other encoder 112 operates so that the high-resolution image data from the signal 116 is sent to the code changeover switch 114 as it is.

【0066】コード切り替えスイッチ114は、他符号
器112側のデータを選択し、コード・メモリ6にデー
タを転送するように動作する。その後、ステップS11
06に進み、上記と同様の処理を行なう。なお、図20
の230〜235は、このストライプ2の処理後のビッ
トストリームを示している。また、図19のフローチャ
ートにて示す処理を、入力画像の全てのストライプに対
して行なうと、図20の230〜239に示すようなビ
ットストリームを得ることができる。FM2には、FM
1に格納されている入力画像データよりも、1段解像度
が低い縮小画像データができている。
The code changeover switch 114 operates so as to select the data on the side of the other encoder 112 and transfer the data to the code memory 6. Then, step S11
Proceeding to 06, the same processing as above is performed. Note that FIG.
230 to 235 indicate the bit stream after the processing of the stripe 2. When the process shown in the flowchart of FIG. 19 is performed on all the stripes of the input image, it is possible to obtain the bitstreams 230 to 239 of FIG. FM2, FM
Reduced image data whose resolution is one step lower than the input image data stored in No. 1 is created.

【0067】以上説明したように、本実施例によれば、
算術符号化器内のFFカウンタがオーバーフローして符
号化できない場合、画像データをそのまま送り、縮小処
理を行なうことで、JBIG方式では符号化できなかっ
た画像データをJBIGのビットストリーム形式で符号
化できるという効果がある。なお、この後、さらに階層
符号化を行なうには、FM2を入力画像データ用、FM
1を出力画像データ用のフレーム・メモリとして2面の
フレーム・メモリを切り替えて使ったり、あるいは、F
M2に作成された縮小画像データをFM1にコピーし
て、上記と同様にFM1を入力用、FM2を出力用のフ
レーム・メモリとして固定して使うようにしても良い。
As described above, according to this embodiment,
When the FF counter in the arithmetic encoder overflows and cannot be coded, the image data that cannot be coded by the JBIG method can be coded by the JBIG bit stream format by sending the image data as it is and performing the reduction process. There is an effect. After that, in order to perform further hierarchical encoding, FM2 is used for input image data
1 is used as the frame memory for the output image data by switching between the two frame memories, or F
The reduced image data created in M2 may be copied to FM1, and FM1 may be fixedly used as an input frame memory and FM2 as an output frame memory in the same manner as described above.

【0068】また、上記第1の実施例では、階層符号化
処理の第1階層目(最高解像度)の動作を説明したが、
階層符号化処理を行なっている際の途中の階層に符号化
できないストライプがあっても、上記と同様の処理が可
能である。さらに、最低階層(lowest-layer)の符号化の
場合は、縮小器111による縮小画像の作成がないのみ
で、上記と同様の処理が可能である。 [第5実施例]次に、本発明に係る第5の実施例につい
て説明する。
Further, in the first embodiment, the operation of the first layer (highest resolution) of the layer coding process has been described.
Even when there is a stripe that cannot be coded in a layer in the middle of the hierarchical coding process, the same process as above can be performed. Furthermore, in the case of the lowest-layer encoding, the same processing as above can be performed without the reduction image being generated by the reduction unit 111. [Fifth Embodiment] Next, a fifth embodiment according to the present invention will be described.

【0069】上記第4の実施例では、算術符号化とは別
の符号化方式として、画像データをそのまま送る方式に
ついて説明したが、第5実施例では、ファクシミリ装置
で用いられているMR,MMR符号化を用いる場合を説
明する。本実施例に係る画像符号化装置の全体構成は、
上記第4実施例に係る装置と同一構成をとるため、ここ
では、その図示を省略する。また、MR,MMR方式に
ついては、公知の符号化方式であるため、符号化そのも
のの動作説明は省略する。
In the fourth embodiment, a method of sending image data as it is is described as an encoding method different from the arithmetic encoding, but in the fifth embodiment, MR and MMR used in a facsimile machine are described. The case of using encoding will be described. The overall configuration of the image coding apparatus according to the present embodiment is
Since it has the same configuration as the device according to the fourth embodiment, its illustration is omitted here. Also, since the MR and MMR methods are known encoding methods, description of the operation of encoding itself is omitted.

【0070】MR,MMR符号化を行なう場合に問題に
なるのは、符号長(バイト数)である。上記第4の実施
例では、画像データそのものを送るため、データサイズ
(バイト数)は計算にて求めるとができたが、MR,M
MRの場合は、符号化して初めてバイト数が分かる。ま
た、JBIGで規定しているビットストリームの中に算
術符号以外のデータを挿入するには、第4実施例でも説
明したように、{「COMMENT」マーカー・コー
ド}+{その後に続くバイト数}+{ユーザ・データ
(MR,MMR符号)}という形式になる。
A problem in MR and MMR encoding is the code length (number of bytes). In the fourth embodiment, since the image data itself is sent, the data size (the number of bytes) could be calculated, but MR, M
In the case of MR, the number of bytes can be known only after encoding. Further, in order to insert data other than arithmetic codes into the bit stream defined by JBIG, as described in the fourth embodiment, {“COMMENT” marker code} + {the number of bytes following it}. The format is + {user data (MR, MMR code)}.

【0071】そこで、本実施例に係る装置における処理
手順をフローチャートを参照して説明する。図21は、
本実施例における画像データの符号化処理を示すフロー
チャートである。なお、図中、上記第4の実施例と同一
の動作を行なう処理ステップには同一の番号を付け、そ
れらの説明は割愛する。また、ここでの説明には、上記
第4の実施例と同一の画像データを用い、別符号化方式
として、MR符号化にて説明する。そして、算術符号器
内のFFカウンタがオーバーフローしない場合の動作、
すなわち、ストライプ2を符号化する場合については、
第4の実施例と同様であるためその説明を省略する。
Therefore, the processing procedure in the apparatus according to this embodiment will be described with reference to the flowchart. FIG. 21 shows
6 is a flowchart showing an image data encoding process in the present embodiment. In the figure, the same numbers are assigned to the processing steps that perform the same operations as those in the above-described fourth embodiment, and the description thereof will be omitted. Also, in the description here, the same image data as in the fourth embodiment is used, and MR encoding will be described as another encoding method. And the operation when the FF counter in the arithmetic encoder does not overflow,
That is, when encoding stripe 2,
Since it is similar to the fourth embodiment, its explanation is omitted.

【0072】CPU8の動作は、算術符号器の動作終了
までの処理は、上記第4の実施例と同じであり、ステッ
プS1104での判断がNOとなるので、ステップS1
113では、算術符号に失敗したことを表わすために、
「SDRST」マーカー・コードをディスク10に出力
する。この処理は、第4の実施例と同様、今回の処理の
ストライプが画像の先頭であれば、このコードを出力せ
ず、その他の場合は、コードを出力するように制御す
る。その後、ユーザ独自の符号を挿入するために、その
識別子として「COMMENT」マーカー・コードをデ
ィスク10に出力する。このマーカー・コードに入れ
る、その後に続くユーザ・コードのバイト数は、後の処
理で入れるため、ここでは何の処理も行なわない。
The operation of the CPU 8 is the same as that of the fourth embodiment up to the end of the operation of the arithmetic encoder, and since the determination in step S1104 is NO, step S1
In 113, in order to indicate that the arithmetic code has failed,
The "SDRST" marker code is output to the disc 10. In this process, like the fourth embodiment, if the stripe of this process is the head of the image, this code is not output, and in other cases, the code is output. Then, the "COMMENT" marker code is output to the disc 10 as its identifier in order to insert a user-specific code. Since the number of bytes of the user code that follows the marker code is entered in the subsequent processing, no processing is performed here.

【0073】次にステップS1114に進み、ストライ
プの先頭に制御を全て戻す。また、切り替えフラグ12
4をMR符号器側を示すコードに変える。そして、ステ
ップS1115にて、算術符号器で符号化できなかった
ストライプ2の画像データをMR符号で符号化し直す。
また、このMR符号化器は、1ストライプ分の符号化処
理が終了すると、MR符号器で出力したバイト数をレジ
スタ・メモリ4中のコード・レングス・フィールド12
0に格納する。
Next, in step S1114, control is returned to the beginning of the stripe. In addition, the switching flag 12
4 is changed to a code indicating the MR encoder side. Then, in step S1115, the image data of stripe 2 that could not be encoded by the arithmetic encoder is re-encoded by the MR code.
When the MR encoder has completed the encoding process for one stripe, the number of bytes output by the MR encoder is changed to the code length field 12 in the register memory 4.
Store in 0.

【0074】MR符号器が符号化処理を終了すると、レ
ジスタ・メモリ4内の終了フラグ122をONにする。
ここで、MR符号化器から出力される符号データは、一
旦、コード切り替えスイッチ114に渡り、このとき、
コード切り替えスイッチ114は、切り替え信号115
がMR符号器側になっているのでMR符号がコード・メ
モリ6に出力される。そして、このMR符号処理と並行
して、第4の実施例と同様に縮小処理を行なう。CPU
8は、以上の処理よりMR符号化が終了したこを確認す
る。
When the MR encoder finishes the encoding process, the end flag 122 in the register memory 4 is turned ON.
Here, the code data output from the MR encoder is once passed to the code changeover switch 114, and at this time,
The cord changeover switch 114 has a changeover signal 115.
Is on the MR encoder side, the MR code is output to the code memory 6. Then, in parallel with this MR code processing, reduction processing is performed as in the fourth embodiment. CPU
8 confirms that MR encoding has been completed by the above processing.

【0075】符号化処理が終了すると、処理をステップ
S1116に移し、MR符号器が出力したMR符号をデ
ィスク10に出力する。このとき、符号データを出力す
る前に、レジスタ・メモリ4中のコード・レングス・フ
ィールド120に格納されているバイト数を、「COM
MENT」マーカー・コードの後に出力する。そして、
CPU8の制御はステップS1110に移る。
When the encoding process is completed, the process proceeds to step S1116, and the MR code output by the MR encoder is output to the disk 10. At this time, before outputting the code data, the number of bytes stored in the code length field 120 in the register memory 4 is changed to “COM
Output after the "MENT" marker code. And
The control of the CPU 8 moves to step S1110.

【0076】このように、算術符号化器内のFFカウン
タが符号化できない場合、算術符号とは別の符号化であ
るMR,MMR符号化にて画像データを符号化するとと
もに、縮小処理を行なうことで、JBIG方式では符号
化できなかった画像データを符号化できる。なお、本実
施例ではMR符号化を用いて説明したが、MH,MMR
等の他の符号化手法を用いてもよい。また、復号器側の
処理としては、通常のJBIGで用いられている符号器
で復号し、途中に「COMMENT」マーカー・コード
があれば、そこのストライプの復号処理を、また、上記
第4の実施例の符号器であれば、マーカー・コードの後
に続くデータを解像度側の画像データに置き換えればよ
い。そして、本実施例では、MR符号としてMR復号器
に入力し、高解像度側の画像データを復元すればよい。
このときに、符号側で、別符号処理を行なっているとき
にも縮小処理を行なっているので、階層符号化であって
も構わない。 [第6実施例]上記第4の実施例、及び第5の実施例で
は、入力画像データをストライプに分割し、このストラ
イプ毎に符号化処理を行なっているが、本実施例では、
入力画像をストライプに分割しない場合を考える。この
場合、第4、第5の実施例で説明した1ストライプを、
入力画像に対して1つのストライプと考えれば、ストラ
イプ分割しない場合も簡単に符号化を行なえる。
As described above, when the FF counter in the arithmetic encoder cannot encode, the image data is encoded by the MR and MMR encoding which is a different encoding from the arithmetic code, and the reduction processing is performed. As a result, image data that could not be encoded by the JBIG method can be encoded. Although the present embodiment has been described by using the MR coding, the MH and MMR are used.
Other encoding methods such as the above may be used. Also, as the processing on the decoder side, decoding is performed by the encoder used in the normal JBIG, and if there is a "COMMENT" marker code in the middle, the decoding processing of the stripe there, and the fourth In the encoder according to the embodiment, the data following the marker code may be replaced with the image data on the resolution side. Then, in the present embodiment, the MR code may be input to the MR decoder to restore the high resolution image data.
At this time, the reduction processing is performed on the encoding side even when the other encoding processing is being performed, so hierarchical encoding may be used. [Sixth Embodiment] In the fourth and fifth embodiments, the input image data is divided into stripes, and the encoding process is performed for each stripe.
Consider the case where the input image is not divided into stripes. In this case, one stripe described in the fourth and fifth embodiments is
If one stripe is considered for the input image, the coding can be easily performed even when the stripe division is not performed.

【0077】すなわち、図15のレジスタ・メモリ4の
中のYサイズ・フィールド119に、入力画像のYサイ
ズをそのまま入れる。また、FFカウンタがオーバーフ
ローし、別符号化処理を行なう場合には、上記第4、第
5の実施例では、そのストライプの先頭に制御を戻した
が、ここでは、画像の先頭に制御を戻し別符号化を行な
う。
That is, the Y size of the input image is directly entered in the Y size field 119 in the register memory 4 of FIG. Further, when the FF counter overflows and another encoding process is performed, the control is returned to the head of the stripe in the fourth and fifth embodiments, but here, the control is returned to the head of the image. Separate encoding is performed.

【0078】さらに、階層を使って符号化を行なわない
場合には、シーケンシャル・オンリ・モード、すなわ
ち、階層符号化のlowest-layerの符号化を直接、入力画
像に対して行なう。このときの動作は、上述の実施例に
ついての動作と同様である。また、復号器側の処理も、
上記の処理と同様である。また、上記の手法で作成した
ビットストリームは、JBIGで規定しているビットス
トリームの形式に合致しているため、復号器側で算術符
号器とは別の符号器/復号器を持っていない復号器に、
ここで作成したビットストリームを入力すると、FFカ
ウンタがオーバー・フローして符号化処理ができなかっ
たストライプのみが復号できないだけなので、後のスト
ライプは正常に復号できる。
Further, when the coding is not performed using the hierarchy, the sequential only mode, that is, the lowest-layer coding of the hierarchy coding is directly performed on the input image. The operation at this time is similar to that of the above-described embodiment. Also, the processing on the decoder side
It is similar to the above processing. In addition, since the bitstream created by the above method conforms to the bitstream format defined by JBIG, the decoder side does not have an encoder / decoder different from the arithmetic encoder. In a bowl,
When the bitstream created here is input, only the stripes that could not be encoded due to the FF counter overflowing cannot be decoded, so the subsequent stripes can be decoded normally.

【0079】なお、算術符号とは別の符号化方式とし
て、1つの符号化に限定せず複数の符号化手段を設け、
その内、最も圧縮率の高い符号化の符号データを選択す
るようにしてもよい。この場合、どの符号化を選択した
かの識別子を、「COMMENT」マーカー・コードと
符号データとの間に挿入する。なお、本発明は、複数の
機器から構成されるシステムに適用しても、1つの機器
から成る装置に適用しても良い。
As an encoding method different from the arithmetic code, a plurality of encoding means are provided without being limited to one encoding.
Of these, the coded data of the coding with the highest compression rate may be selected. In this case, the identifier of which encoding is selected is inserted between the "COMMENT" marker code and the code data. The present invention may be applied to a system including a plurality of devices or an apparatus including one device.

【0080】[0080]

【発明の効果】以上説明したように、本発明によれば、
算術符号化器内部のカウンタがオーバーフローした場
合、参照画素のテンプレート機能を利用することで、算
術符号器のハード規模を大きくすることなく符号化でき
なかった画像データを再符号化できるという効果があ
る。
As described above, according to the present invention,
When the counter inside the arithmetic encoder overflows, by using the template function of the reference pixel, it is possible to re-encode the image data that could not be encoded without increasing the hardware scale of the arithmetic encoder. .

【0081】また、算術符号化器内部のカウンタがオー
バーフローした場合、算術符号化以外の符号化方法にて
符号化することで、算術符号化では符号化できなかった
画像データを再符号化できる。
Further, when the counter inside the arithmetic encoder overflows, the image data which could not be encoded by the arithmetic encoding can be re-encoded by encoding by an encoding method other than the arithmetic encoding.

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

【図1】本発明の第1実施例に係る画像符号化装置全体
構成の概略ブロック図である。
FIG. 1 is a schematic block diagram of the overall configuration of an image encoding device according to a first embodiment of the present invention.

【図2】第1実施例におけるレジスタ・メモリの内部構
成を示す図である。
FIG. 2 is a diagram showing an internal configuration of a register memory in the first embodiment.

【図3】JBIGにおけるAT画素変換のテンプレート
の一例を示す図である。
FIG. 3 is a diagram showing an example of a template for AT pixel conversion in JBIG.

【図4】JBIGにおけるAT画素変換の画素群を示す
図である。
FIG. 4 is a diagram showing a pixel group for AT pixel conversion in JBIG.

【図5】第1実施例における画像データの符号化手順を
示すフローチャートである。
FIG. 5 is a flowchart showing a procedure for encoding image data in the first embodiment.

【図6】図5に示すコード出力処理の詳細フローチャー
トである。
6 is a detailed flowchart of the code output process shown in FIG.

【図7】第1実施例に係る入力画像とストライプとの関
係を示す図である。
FIG. 7 is a diagram showing a relationship between an input image and stripes according to the first embodiment.

【図8】第1実施例における処理を行なったときのビッ
トストリームの構成例を示す図である。
FIG. 8 is a diagram showing a configuration example of a bitstream when the processing in the first embodiment is performed.

【図9】第2実施例に係るレジスタ・メモリの内部構成
を示す図である。
FIG. 9 is a diagram showing an internal configuration of a register memory according to a second embodiment.

【図10】第2実施例に係る符号化処理を示すフローチ
ャートである。
FIG. 10 is a flowchart showing an encoding process according to the second embodiment.

【図11】図10に示すATlag計算処理を示すフロ
ーチャートである。
11 is a flowchart showing an ATlag calculation process shown in FIG.

【図12】第3実施例に係る入力画像データとストライ
プとの関係を示す図である。
FIG. 12 is a diagram showing a relationship between input image data and stripes according to the third embodiment.

【図13】第3実施例に係るlowest-layerのAT画素を
説明するための図である。
FIG. 13 is a diagram for explaining AT pixels in the lowest-layer according to the third embodiment.

【図14】第3実施例に係るlowest-layerのAT画素を
説明するための図である。
FIG. 14 is a diagram for explaining AT pixels in the lowest-layer according to the third embodiment.

【図15】第4実施例に係る画像符号化装置の全体構成
を示すブロック図である。
FIG. 15 is a block diagram showing an overall configuration of an image encoding device according to a fourth embodiment.

【図16】第4実施例におけるエンコード/デコード器
の符号器部分の内部構成を示すブロック図である。
FIG. 16 is a block diagram showing an internal configuration of an encoder portion of an encoder / decoder in a fourth embodiment.

【図17】第4実施例におけるレジスタ・メモリ4の内
部構成の一例を示す図である。
FIG. 17 is a diagram showing an example of an internal configuration of a register memory 4 in a fourth embodiment.

【図18】入力画像データがFM1にロードされたとき
のフレーム・メモリと画像データ、ストライプとの関係
を示す図である。
FIG. 18 is a diagram showing a relationship between a frame memory, image data, and stripes when input image data is loaded in FM1.

【図19】第4実施例において画像データを符号化する
際の処理を示すフローチャートである。
FIG. 19 is a flowchart showing a process for encoding image data in the fourth embodiment.

【図20】第4実施例における処理を行なったときのビ
ットストリームの構成例を示す図である。
[Fig. 20] Fig. 20 is a diagram illustrating a configuration example of a bit stream when the processing in the fourth embodiment is performed.

【図21】第5実施例における画像データの符号化処理
を示すフローチャートである。
FIG. 21 is a flowchart showing a coding process of image data in the fifth embodiment.

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

1 符号化/復号化器 2 FM1 3 FM2 4 レジスタ・メモリ 5 エンコード/デコード部 5´ エンコード/デコード器 6 コードバッファ・メモリ 7 システムバス 8 CPU 9 メモリ 10 ディスク 111 縮小器 113 算術符号器 114 コード切替えスイッチ 1 Encoding / decoding device 2 FM1 3 FM2 4 Register memory 5 Encoding / decoding unit 5'Encoding / decoding device 6 Code buffer memory 7 System bus 8 CPU 9 Memory 10 Disk 111 Reducer 113 Arithmetic encoder 114 Code switching switch

Claims (11)

【特許請求の範囲】[Claims] 【請求項1】 算術符号器を用いて2値画像データを階
層的に符号化する画像符号化装置において、 前記算術符号器内の桁上り伝播のカウンタ値のオーバー
フローを検出する手段と、 前記オーバーフローが検出された場合、符号化の予測モ
デルとして用いる参照画素のテンプレートを変更する手
段と、 前記テンプレートを用いて、前記オーバーフローにより
符号化できなかった画像データを再度符号化する再符号
化手段とを備えることを特徴とする画像符号化装置。
1. An image encoding apparatus for hierarchically encoding binary image data using an arithmetic encoder, said means for detecting overflow of a carry propagation counter value in said arithmetic encoder, and said overflow. When is detected, means for changing the template of the reference pixel used as a prediction model of encoding, and re-encoding means for re-encoding the image data that could not be encoded due to the overflow using the template. An image encoding device comprising:
【請求項2】 前記再符号化手段は、2値画像データが
ストライプ構造を持っている場合、符号化できなかった
ストライプの先頭に戻って符号化をやり直すことを特徴
とする請求項1に記載の画像符号化装置。
2. The re-encoding means, when the binary image data has a stripe structure, returns to the head of the stripe that could not be encoded and re-encodes. Image encoding device.
【請求項3】 前記再符号化手段は、2値画像データが
ストライプ構造を持っていない場合、該2値画像データ
の先頭に戻って再符号化することを特徴とする請求項1
に記載の画像符号化装置。
3. The re-encoding means, when the binary image data does not have a stripe structure, returns to the beginning of the binary image data and re-encodes.
The image encoding device according to 1.
【請求項4】 前記再符号化手段は、前記算術符号器の
予測テーブルをクリアして初期状態から再符号化を始め
ることを特徴とする請求項1に記載の画像符号化装置。
4. The image coding apparatus according to claim 1, wherein the re-coding unit clears the prediction table of the arithmetic coder and starts re-coding from an initial state.
【請求項5】 参照画素のテンプレートは、一次元また
は二次元で変更することを特徴とする請求項1に記載の
画像符号化装置。
5. The image coding apparatus according to claim 1, wherein the template of the reference pixel is changed in one dimension or two dimensions.
【請求項6】 前記階層的な符号化は、マルチレイヤま
たはシングルレイヤであることを特徴とする請求項1に
記載の画像符号化装置。
6. The image coding apparatus according to claim 1, wherein the hierarchical coding is a multi-layer or a single layer.
【請求項7】 算術符号器を用いて2値画像データを階
層的に符号化する画像符号化装置において、 前記算術符号器内の桁上り伝播のカウンタ値のオーバー
フローを検出する手段と、 前記オーバーフローが検出された場合、前記算術符号器
による算術符号化以外の符号化を選択する手段と、 前記選択された符号化にて、前記オーバーフローにより
符号化できなかった画像データを再度符号化する再符号
化手段とを備え、 前記再符号化手段による符号化データを、前記算術符号
器が出力するビットストリームに入れ込んで、1つのビ
ットストリームにすることを特徴とする画像符号化装
置。
7. An image encoding apparatus for hierarchically encoding binary image data using an arithmetic encoder, a means for detecting overflow of a carry propagation counter value in the arithmetic encoder, and the overflow. When detected, means for selecting encoding other than arithmetic encoding by the arithmetic encoder, and re-encoding for re-encoding image data that could not be encoded due to the overflow in the selected encoding An image encoding device comprising: an encoding unit, and the encoded data by the re-encoding unit is inserted into a bit stream output by the arithmetic encoder to form one bit stream.
【請求項8】 前記再符号化手段は、2値画像データが
ストライプ構造を持っている場合、符号化できなかった
ストライプの先頭に戻って符号化をやり直すことを特徴
とする請求項7に記載の画像符号化装置。
8. The re-encoding means, when the binary image data has a stripe structure, returns to the head of the stripe that could not be encoded and re-encodes. Image encoding device.
【請求項9】 前記再符号化手段は、2値画像データが
ストライプ構造を持っていない場合、該2値画像データ
の先頭に戻って再符号化することを特徴とする請求項7
に記載の画像符号化装置。
9. The re-encoding means, when the binary image data does not have a stripe structure, returns to the beginning of the binary image data and re-encodes.
The image encoding device according to 1.
【請求項10】 前記再符号化手段は、前記算術符号器
の予測テーブルをクリアして初期状態から再符号化を始
めることを特徴とする請求項7に記載の画像符号化装置
10. The image encoding apparatus according to claim 7, wherein the re-encoding means clears the prediction table of the arithmetic encoder and starts re-encoding from an initial state.
【請求項11】 前記階層的な符号化は、マルチレイヤ
またはシングルレイヤであることを特徴とする請求項7
に記載の画像符号化装置。
11. The hierarchical coding is multi-layer or single-layer.
The image encoding device according to 1.
JP23235392A 1992-08-31 1992-08-31 Image coding device Expired - Fee Related JP3167802B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP23235392A JP3167802B2 (en) 1992-08-31 1992-08-31 Image coding device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP23235392A JP3167802B2 (en) 1992-08-31 1992-08-31 Image coding device

Publications (2)

Publication Number Publication Date
JPH0686079A true JPH0686079A (en) 1994-03-25
JP3167802B2 JP3167802B2 (en) 2001-05-21

Family

ID=16937881

Family Applications (1)

Application Number Title Priority Date Filing Date
JP23235392A Expired - Fee Related JP3167802B2 (en) 1992-08-31 1992-08-31 Image coding device

Country Status (1)

Country Link
JP (1) JP3167802B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6553144B1 (en) 1998-07-07 2003-04-22 Nec Corporation Coding method and coding apparatus for bi-level document image
CN110245535A (en) * 2016-11-19 2019-09-17 哈尔滨理工大学 A kind of coding endothecium structure

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6553144B1 (en) 1998-07-07 2003-04-22 Nec Corporation Coding method and coding apparatus for bi-level document image
CN110245535A (en) * 2016-11-19 2019-09-17 哈尔滨理工大学 A kind of coding endothecium structure
CN110245535B (en) * 2016-11-19 2022-06-28 哈尔滨理工大学 Coding inner layer structure

Also Published As

Publication number Publication date
JP3167802B2 (en) 2001-05-21

Similar Documents

Publication Publication Date Title
US7346216B2 (en) Video encoding method, video decoding method, video encoding apparatus, video decoding apparatus, video encoding program, and video decoding program
US5521918A (en) Adaptive bit stream demultiplexing apparatus in a decoding system
CN100531396C (en) Image encoding device and method, image decoding device and method
CN101014124A (en) System and method for reducing storage requirement of context adaptive binary arithmetic coding
JP4812146B2 (en) Data compression method, compressed data decompression method, compressed data transmission method and apparatus
JP2000333173A (en) Method for decoding image data and its system
US20040105497A1 (en) Encoding device and method
JP3167802B2 (en) Image coding device
JP3082585B2 (en) Image information encoding processing device, image information decoding processing device, and image information encoding / decoding processing device
EP0802683A2 (en) Data priority processing for MPEG system
JP3107640B2 (en) Image data storage method and image data storage device
CN101261605A (en) Fusion memory device and method
JPH05103214A (en) Picture data communication equipment
JPH0856324A (en) Av signal editing and sending-out device
US5673119A (en) Encoding processing apparatus
WO2002071759A1 (en) Image compression device, electronic camera, and image processing program
JPH0856326A (en) Av signal editing and sending-out device and av server
JP3082930B2 (en) Image processing device
JPH0335865B2 (en)
JPS59167159A (en) Hdlc data transmitting system
JP2765588B2 (en) Encoding / decoding device
JPH06311294A (en) Facsimile equipment
JPH0396381A (en) Recorder
JPH11252544A (en) Moving image coder, its method and recording medium
JPH0321169A (en) Image data encoder/decoder

Legal Events

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20010205

LAPS Cancellation because of no payment of annual fees