JP3222554B2 - Image processing apparatus and method - Google Patents

Image processing apparatus and method

Info

Publication number
JP3222554B2
JP3222554B2 JP17344392A JP17344392A JP3222554B2 JP 3222554 B2 JP3222554 B2 JP 3222554B2 JP 17344392 A JP17344392 A JP 17344392A JP 17344392 A JP17344392 A JP 17344392A JP 3222554 B2 JP3222554 B2 JP 3222554B2
Authority
JP
Japan
Prior art keywords
code amount
unit
image
quantization
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP17344392A
Other languages
Japanese (ja)
Other versions
JPH0622152A (en
Inventor
信孝 三宅
忠義 中山
一英 長谷川
丈二 大木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP17344392A priority Critical patent/JP3222554B2/en
Publication of JPH0622152A publication Critical patent/JPH0622152A/en
Priority to US08/425,768 priority patent/US6553143B2/en
Application granted granted Critical
Publication of JP3222554B2 publication Critical patent/JP3222554B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Image Processing (AREA)

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、画像をブロック単位で
量子化、符号化するものであり、発生符号量に応じて、
適切な量子化を行おうとする画像処理装置及び方法に関
するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image
Quantization and encoding, and according to the generated code amount,
An image processing apparatus and method for performing appropriate quantization
Is what you do.

【0002】[0002]

【従来の技術】近年は画像表示部の高解像度化とフルカ
ラー化、並びに半導体技術の著しい発展に伴ない、高解
像のフルカラー情報をメモリに格納し、それを画像表示
部に出力する装置が技術的に可能になってきた。とはい
っても、大容量の画像データを格納するには、非常に多
くのメモリを必要とし、これが装置のコストアツプの大
きな要因になっていた。例えば、A3の用紙サイズで4
00ドツト・パー・インチ(以下dpiと略す)の解像
度、レツド(赤)、ブルー(青)、グリーン(緑)の各
色が、8ビツトのフルカラー画像の場合、およそ96メ
ガバイトの情報量になり、この情報を全て格納するには
4メガビツトメモリを192ケも必要としていた。
2. Description of the Related Art In recent years, with the development of high-resolution and full-color image display units and the remarkable development of semiconductor technology, a device that stores high-resolution full-color information in a memory and outputs it to the image display unit has been developed. It has become technically possible. However, storing a large amount of image data requires a very large amount of memory, which has been a major factor in increasing the cost of the apparatus. For example, 4 for A3 paper size
If the resolution of 00 dots per inch (hereinafter abbreviated as dpi), each color of red (red), blue (blue), and green (green) is a full-color image of 8 bits, the information amount is about 96 megabytes, In order to store all this information, 192 4-megabit memories were required.

【0003】そこで、画像圧縮という手法を用いて、画
像の情報量を減らし、少ないメモリでフルカラー画像を
格納出来るような工夫が従来なされてきた。圧縮の方法
には、いろいろなものがあるが、変換符号化として、現
在よく知られている離散コサイン変換(以下、DCT変
換と略す)を例にとって従来の圧縮方法の説明を図21
を用いて以下に行なう。
[0003] Therefore, a technique has been devised so that the amount of image information can be reduced by using a technique called image compression and a full-color image can be stored with a small memory. Although there are various compression methods, a conventional compression method will be described with reference to a discrete cosine transform (hereinafter abbreviated as DCT), which is well known, as an example of transform coding in FIG.
The following is performed using.

【0004】同図において、401は画像データを入力
する入力端子、402は画像データの一部を一時的に格
納するためのバツファ、403は画像をDCT変換する
DCT変換部、404はDCT変換された後の各周波数
成分を再量子化するための量子化部、405はビツト単
位のデータをバイト単位もしくはワード単位のデータに
まとめるためのパツキング処理部、406は圧縮符号化
されたデータを出力する出力端子、407は画像の横サ
イズを入力する入力端子、408は画像の縦サイズを入
力する入力端子、409は画像の横サイズと縦サイズか
らDCT変換する際の基本単位であるブロツクに対し
て、何ビツトの情報が割り当て可能かを演算する符号量
演算部、410は1ブロツク当たりの符号量からDCT
変換後の各周波数成分に対して何ビツトの情報を割り当
てるかを決めるビツト配分演算部である。
In FIG. 1, reference numeral 401 denotes an input terminal for inputting image data; 402, a buffer for temporarily storing a part of the image data; 403, a DCT conversion unit for performing DCT conversion on the image; A quantization unit 405 for requantizing each frequency component after the processing, a packing unit 405 for combining data in units of bits into data in units of bytes or words, and a unit 406 outputs compression-encoded data. An output terminal, 407 is an input terminal for inputting the horizontal size of the image, 408 is an input terminal for inputting the vertical size of the image, and 409 is a block which is a basic unit for performing DCT conversion from the horizontal size and the vertical size of the image. , A code amount calculating unit 410 for calculating how many bits of information can be allocated, and a DCT 410 based on the code amount per block
This is a bit allocation calculation unit that determines how many bits of information are assigned to each frequency component after conversion.

【0005】画像出力装置としては、図20に示す圧縮
処理部以外にホストコンピュータ等から送られるデータ
の転送を制御するインターフェース部、圧縮したデータ
を格納するための記憶部、該記憶部から読み出した圧縮
データを伸張して画像データに復元する伸張部、復元さ
れた画像データを出力する画像出力部等がある(図22
参照)。
As an image output device, in addition to the compression processing unit shown in FIG. 20, an interface unit for controlling the transfer of data sent from a host computer or the like, a storage unit for storing the compressed data, and a readout from the storage unit There are a decompression unit for decompressing the compressed data to restore the image data, an image output unit for outputting the restored image data, and the like (FIG. 22).
reference).

【0006】コンピュータ等の外部装置から送られてき
たデータは501のインターフェース部にて、画像のヘ
ツダ情報と実際の画像情報とに分けられ、ヘツダ情報に
ある画像の横サイズ情報は、図20における端子407
に縦サイズ情報は端子408に入力されると共に、画像
情報は端子401に入力される。端子407,408に
入力された画像の横サイズ,縦サイズ情報は、符号量演
算部409に送られ、1ブロツクに割り当て可能なビツ
ト数が演算され出力される。
Data sent from an external device such as a computer is divided into header information of an image and actual image information by an interface unit 501, and the horizontal size information of the image in the header information is shown in FIG. Terminal 407
The vertical size information is input to a terminal 408, and the image information is input to a terminal 401. The horizontal size and vertical size information of the image input to the terminals 407 and 408 are sent to the code amount calculation unit 409, and the number of bits that can be allocated to one block is calculated and output.

【0007】これは、あらかじめ定められた容量を持つ
記憶部503を最大限有効に活用するために行なう処理
である。例えば、記憶部503の全メモリ容量が128
メガビツト、画像の横サイズが4000、縦サイズが6
000、1画素が赤(R)、青(B)、緑(G)各色8
ビツトから成り、DCTの変換ブロツクの大きさが8×
8画素の場合、まず、全ブロツク数は4000×600
0÷(8×8)×3=1125000となる。
[0007] This is a process performed in order to make maximum use of the storage unit 503 having a predetermined capacity. For example, if the total memory capacity of the storage unit 503 is 128
Megabit, image horizontal size 4000, vertical size 6
000, 1 pixel is red (R), blue (B), green (G) each color 8
The size of the transform block of the DCT is 8 ×
In the case of 8 pixels, first, the total number of blocks is 4000 × 600.
0 ÷ (8 × 8) × 3 = 1125000.

【0008】これより1ブロツク当たりのビツト数は1
28×220÷1125000≒119となる。この値
は、ビツト配分演算部410に送られ、トータルで11
9ビツトとなるように、DCT変換後の各周波数成分に
対して1つ1つ符号化ビツト数を割り当てる。この割り
当ての一例を図22に示す。一方、端子401に入力さ
れた画像情報は、バツファ402にて、一次的に格納さ
れる。通常、画像情報はラスタ状に運転されるが、この
転送順序では、DCT変換部403にてDCT変換を行
なうことが出来ない。そこで、バツファ402で8ライ
ン以上のデータを格納した後、8×8画素のブロツク単
位でデータを読み出し、DCT変換部403に画像情報
データを送る。DCT変換部403は、ブロツク単位で
該画像情報データをDCT変換し、変換後の周波数成分
を量子化部404へ送る。
From this, the number of bits per block is one.
28 × 2 20 ÷ 1125000 ≒ 119. This value is sent to the bit allocation calculator 410, and the total is 11
The number of coded bits is assigned to each frequency component after DCT transformation so as to have 9 bits. An example of this assignment is shown in FIG. On the other hand, the image information input to the terminal 401 is temporarily stored in the buffer 402. Normally, image information is operated in a raster form, but in this transfer order, DCT conversion cannot be performed by DCT conversion section 403. Therefore, after storing data of eight lines or more in the buffer 402, the data is read out in units of 8 × 8 pixel blocks, and the image information data is sent to the DCT conversion unit 403. The DCT transform unit 403 performs DCT transform on the image information data in block units, and sends the transformed frequency components to the quantizing unit 404.

【0009】量子化部404は、該周波数成分データと
各周波数成分に対応したビツト配分情報を受けとり、ビ
ツト配分に応じた量子化を行なう。ここでの量子化は、
一般に非線型量子化を用いる。量子化された後のビツト
情報は、パツキング処理部405へ送られ、バイト単
位、もしくはワード単位の情報にパツキングされて、圧
縮データとして端子406へ出力される。該圧縮データ
は、図21において、圧縮処理部502から出力され、
記憶部503に格納される。
The quantization section 404 receives the frequency component data and bit allocation information corresponding to each frequency component, and performs quantization according to the bit allocation. The quantization here is
Generally, non-linear quantization is used. The quantized bit information is sent to the packing processing unit 405, packed into byte or word information, and output to the terminal 406 as compressed data. The compressed data is output from the compression processing unit 502 in FIG.
It is stored in the storage unit 503.

【0010】更に、従来この種の画像処理装置における
カラー静止画符号化の国際標準化方式として、JPEG
(Joint Photographic Experts Group)にて提案されてい
るベースラインシステム(基本方式)の符号化方式があ
る。この方式の詳細説明は省略するが、概略はDCT後
の量子化係数をハフマン符号化により、可変長符号化す
る方式である。以上の方式は、可変長符号化の為、どの
ような画像でも、ある一定のメモリ内に制御するのは困
難である。
Conventionally, JPEG is used as an international standard for encoding color still images in this type of image processing apparatus.
(Joint Photographic Experts Group) includes a coding method of a baseline system (basic method). Although a detailed description of this method is omitted, it is a method in which the quantized coefficient after DCT is variable-length coded by Huffman coding. In the above-described method, it is difficult to control any image in a certain memory because of variable-length coding.

【0011】また、各ブロックでDCT後の量子化係数
を固定長符号化する方式では、画像の情報量の偏りによ
り、あるブロックでは画質が劣化するということが発生
してしまう。そこで、近年、電子的に撮像してフロッピ
ーディスクやICカード等に格納する、いわゆる電子撮
像カメラに応用する為に、上述のJPEGの方法を利用
した符号量の制御方法が提案されている。
[0011] In the system in which the quantized coefficients after DCT are fixed-length coded in each block, the image quality deteriorates in a certain block due to a bias in the information amount of the image. Therefore, in recent years, a control method of a code amount using the above-described JPEG method has been proposed for application to a so-called electronic imaging camera that electronically captures an image and stores it on a floppy disk, an IC card, or the like.

【0012】図19に、前記電子撮像カメラの応用で提
案されている技術を示す。図19において、1000は
フレームメモリを示し、撮像部(不図示)から入力した
画像データが格納される。その後、ブロック化回路(不
図示)にて8×8画素サイズごとにブロック化されて、
DCT処理1001がなされる。DCT後の変換係数
は、量子化器1002にて量子化処理される。この場
合、パスカウンタ1003は1パス目ということによ
り、スイッチ1004は端子Aに接続してあり、あらか
じめ設定してある量子化テーブル1005の値が量子化
器1002に送信される。
FIG. 19 shows a technique proposed in the application of the electronic imaging camera. In FIG. 19, a frame memory 1000 stores image data input from an imaging unit (not shown). After that, it is divided into blocks of 8 × 8 pixels by a blocking circuit (not shown).
DCT processing 1001 is performed. The transform coefficients after DCT are quantized by a quantizer 1002. In this case, since the path counter 1003 is the first pass, the switch 1004 is connected to the terminal A, and the value of the quantization table 1005 set in advance is transmitted to the quantizer 1002.

【0013】量子化後の係数は、ジグザグスキャン回路
1006により、低周波域から高周波域に一次元的に並
び換えられる。量子化係数は、“0”のラン長と、
“0”以外の有意係数に分類され(不図示)、ハフマン
符号器1007において、ハフマン符号化される。パス
カウンタ1003は、スイッチ1008では端子Dに接
続されていて、符号量測定器1009にて符号量の測定
が行われる。そうして、フレームメモリ1000に格納
されている画像をまず、全画像分符号化してみて、符号
量測定器1009は一画面分の符号量を測定する。
The quantized coefficients are one-dimensionally rearranged by a zigzag scan circuit 1006 from a low frequency band to a high frequency band. The quantization coefficient has a run length of “0”,
The coefficients are classified into significant coefficients other than “0” (not shown), and are subjected to Huffman encoding in the Huffman encoder 1007. The path counter 1003 is connected to the terminal D in the switch 1008, and the code amount is measured by the code amount measuring device 1009. Then, the images stored in the frame memory 1000 are first encoded for all the images, and the code amount measuring device 1009 measures the code amount for one screen.

【0014】この測定結果に基づいて、スケーリングフ
ァクター変更部1010では、ある一定の符号量に納ま
る様に、量子化テーブルに積算する値を経験則から決定
し、掛け算器1011に送信する。2パス目は、パスカ
ウンタはスイッチ1004ではB端子に、スイッチ10
08ではC端子に接続されている。再び、フレームメモ
リ1000から画像情報を入力してDCT処理を行い、
今度は、スケーリングファクターを乗じた量子化テーブ
ルの情報により量子化処理を施し、ジグザグスキャン回
路、ハフマン符号器を通って、端子Cにより符号データ
が出力できる。
Based on the measurement result, the scaling factor changing unit 1010 determines a value to be integrated in the quantization table from an empirical rule so as to be within a certain code amount, and transmits the value to the multiplier 1011. In the second pass, the pass counter is set to the B terminal in the switch 1004 and the switch 10
08 is connected to the C terminal. Again, image information is input from the frame memory 1000 to perform DCT processing,
This time, a quantization process is performed based on the information of the quantization table multiplied by the scaling factor, and code data can be output from a terminal C through a zigzag scan circuit and a Huffman encoder.

【0015】この符号データは、1画面分の情報でみる
と、ある一定内の符号量に制御されている。
This code data is controlled to a certain fixed code amount when viewed from information for one screen.

【0016】[0016]

【0017】[0017]

【発明が解決しようとする課題】しかし、一般的に画像
データというのは情報の偏りが大きい。例えば、雲1つ
無い青空の領域は、直流成分のみでほとんど表現できて
しまうのに対して、細かい木の枝が密集した領域は、直
流成分以外に多くの高周波成分が無いと表現出来ない。
However, image data generally has a large information bias. For example, an area of the blue sky without one cloud can be almost expressed only by a DC component, whereas an area in which fine tree branches are dense cannot be expressed without many high-frequency components other than the DC component.

【0018】こういったことから、画像情報を保存する
ために必要な符号量(ビツト数)はブロツクごとに大き
く異なり、その差は十倍以上になる。
For these reasons, the amount of code (the number of bits) required to store image information greatly differs for each block, and the difference is ten times or more.

【0019】しかしながら、図20に示した上記従来例
では、各ブロツクに同一の符号量を割り当てているた
め、情報量の少ないブロツクではメモリが有効に活用さ
れないという問題点があり、実際に有効に使われるメモ
リの数倍の容量を用意する必要があった。更に、上述し
た図19の方式においては、ある一定のメモリを有する
プリンタに応用した場合、入力する画像サイズが異なる
場合があるという欠点があり、また、フレームメモリを
有していない為に複数パスは困難である欠点(接続先の
ホストコンピュータから複数回送信してもらうとする
と、転送時間が増大する)があつた。
However, in the above conventional example shown in FIG. 20, since the same code amount is assigned to each block, there is a problem that the memory is not effectively used in blocks having a small amount of information. It was necessary to provide several times the capacity of the memory used. Further, in the method of FIG. 19 described above, when applied to a printer having a certain memory, there is a drawback that an input image size may be different. Has a drawback that it is difficult (the transfer time increases if a transmission is made multiple times from the connected host computer).

【0020】[0020]

【課題を解決するための手段】本発明は上記従来例に鑑
みて成されたものであり、画像をブロック単位で量子
化、可変長符号化することにより、一定とは限らない符
号量の符号化データを発生する様な場合において、量子
化マトリクスの選択使用により符号量を適切に抑える様
にすると共に、その量子化マトリクスの選択方法を適切
な単位で効率良く決定できる様にすることを目的とす
る。
SUMMARY OF THE INVENTION The present invention is based on the above-mentioned prior art.
The image was created by
Encoding is not always constant
In such cases as generating encoded data of
The code amount appropriately by selecting and using the optimization matrix
And select the appropriate quantization matrix
The purpose is to be able to determine efficiently in simple units
You.

【0021】上記の目的を達成するために、本発明の画
像処理装置は、入力画像信号を複数画素からなるブロッ
クに分割するブロック化手段と、該ブロツク化手段で分
割したブロックごとに系列変換する変換手段と、該変換
手段で変換された変換係数を量子化マトリクスを用いて
量子化する量子化手段と、該量子化手段で量子化された
変換係数を可変長符号を用いて符号化する符号化手段
と、該符号化手段で符号化された符号量を、所定数のブ
ロック単位毎に累積する符号量累積手段と、該符号量累
積手段で得られる各累積値の合計と、第1閾値との比較
結果に基づいて、前記量子化手段に適用する量子化マト
リクスを選択する量子化マトリクス設定手段と、前記符
号量累積手段で夫々得られる前後の累積値間の差分に基
づいて符号量の増加率を得、該増加率と第2閾値とを比
較する増加率判定手段と、該増加率判定手段による比較
の結果に応じて、前記量子化マトリクス設定手段による
選択に利用される第1閾値を切り換える閾値切り換え手
段とを備える。
In order to achieve the above object, the present invention
The image processing apparatus includes: a blocking unit that divides an input image signal into blocks each including a plurality of pixels; a conversion unit that performs series conversion for each block divided by the blocking unit; and a quantization unit that converts the conversion coefficient converted by the conversion unit. Means for quantizing using a quantization matrix, coding means for coding the transform coefficient quantized by the quantization means using a variable-length code, and code amount coded by the coding means To a certain number of blocks
Code amount accumulating means for accumulating for each lock unit, and comparing the sum of respective accumulated values obtained by the code amount accumulating means with a first threshold value
A quantization matrix setting unit that selects a quantization matrix to be applied to the quantization unit based on a result; and a difference between accumulated values before and after obtained by the code amount accumulation unit.
The rate of increase of the code amount is obtained based on the
And increase rate determining means for compare, comparison by the increase rate determining means
Depending on the result, according to the quantization matrix setting means
Threshold switching means for switching a first threshold used for selection .

【0022】[0022]

【0023】[0023]

【作用】上記の構成によれば、入力画像信号は複数画素
からなるブロックごとに系列変換され、得られた変換係
数は量子化マトリクスを用いて量子化され、量子化され
た変換係数は可変長符号を用いて符号化される。この符
号化によって得られた符号量は所定数のブロック単位毎
に累積され、それら累積値の合計(その時点での全累積
符号量)と第1閾値との比較結果に基づいて上記量子化
に用いる量子化マトリクスが選択される。また、ブロッ
ク単位毎の前回の累積値と今回の累積値との差分が第2
閾値と比較され、この比較結果に応じて、上記第1閾値
が切り換えられる。
According to the above arrangement, the input image signal is composed of a plurality of pixels.
Is converted for each block consisting of
The number is quantized using a quantization matrix and quantized.
The transformed coefficients are encoded using a variable length code. This mark
The amount of code obtained by encoding is a predetermined number of block units.
, And the sum of those cumulative values (all cumulative
Code amount) and the first threshold value.
Is selected. Also, block
The difference between the previous cumulative value and the current cumulative value for each
The first threshold value is compared with a threshold value, and the first threshold value is determined according to the comparison result.
Is switched.

【0024】[0024]

【0025】[0025]

【実施例】以下に添付図面を参照して、本発明に係る一
実施例を詳細に説明する。 <第1の実施例>図1は本発明の画像処理装置をプリン
タに適用した第1の実施例の構成を示すブロツク図であ
る。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment according to the present invention will be described below in detail with reference to the accompanying drawings. <First Embodiment> FIG. 1 is a block diagram showing the configuration of a first embodiment in which the image processing apparatus of the present invention is applied to a printer.

【0026】図1において、11は入力端子であり、本
実施例のプリンタと接続している情報の入力源を示して
いる。情報を出力する接続機器としては、ホストコンピ
ユータ、また近年、実現化しているページ記述言語のイ
ンタプリタを搭載しているフォーマツタ等が挙げられ
る。12はプリンタのI/Oを示し、前述した接続機器
との情報のやりとりを司る。13はバツファメモリを示
し、数ライン分、例えば、ブロツク化を施して直交変換
を利用する圧縮方式の場合には、最低でもそのブロツク
ライン分の情報を格納するメモリである。14は符号量
制御部を示し、I/Oから画像サイズの情報を受信し
て、目標の圧縮率を設定して、符号量が一定値以内な納
まる様に制御するブロツクを示す。
In FIG. 1, reference numeral 11 denotes an input terminal, which indicates an information input source connected to the printer of this embodiment. Examples of connected devices that output information include a host computer and a formatter equipped with a page description language interpreter that has been realized in recent years. Reference numeral 12 denotes an I / O of the printer, which controls exchange of information with the above-described connected device. Reference numeral 13 denotes a buffer memory, which stores information for several lines, for example, at least information for the block lines in the case of a compression system using orthogonal transformation by performing blocking. A code amount control unit 14 receives image size information from the I / O, sets a target compression ratio, and controls the code amount so that the code amount falls within a certain value.

【0027】15は圧縮処理部を示し、バツファ13に
格納してある画像情報を入力して、画像の冗長度を減ら
して可変長符号化するブロツクである。16はメモリを
示し、圧縮処理部14からの符号を格納するブロツクで
ある。当然、このメモリは本実施例に係るプリンタの最
大出力サイズ分のメモリ容量よりも少量で構成されてい
るメモリである。
Reference numeral 15 denotes a compression processing unit, which is a block for inputting image information stored in the buffer 13, reducing the redundancy of the image, and performing variable length coding. Reference numeral 16 denotes a memory, which is a block for storing a code from the compression processing unit 14. Naturally, this memory is a memory configured with a smaller memory capacity than the maximum output size of the printer according to the present embodiment.

【0028】17は符号化領域カウンタを示し、圧縮処
理部15において符号化を進めていく時に、例えば、ブ
ロツク化して符号化を処理する際に現在までに処理した
ブロツク数をカウントする。18は符号量カウンタを示
し、現在までにメモリに格納された符号量をカウントす
る。19は伸張処理部を示し、メモリ16から符号を取
りだし、プリンタエンジン20の都合の良いように(エ
ンジンのプロセススピードのタイミングに合わせて)復
号していくブロツクである。破線で囲んである部分がプ
リンタに相当する。
Reference numeral 17 denotes a coding area counter, which counts the number of blocks processed up to the present time, for example, when the coding is advanced in the compression processing unit 15 and the coding is processed by block processing. Reference numeral 18 denotes a code amount counter, which counts the code amount stored in the memory so far. Reference numeral 19 denotes a decompression processing unit, which is a block for taking out a code from the memory 16 and decoding it according to the convenience of the printer engine 20 (at the timing of the process speed of the engine). A portion surrounded by a broken line corresponds to a printer.

【0029】図2は、図1の符号量制御部14の詳細構
成の一例を示している。破線で囲んだ部分が符号量制御
部14に相当する。また、図3は、図1の圧縮処理部1
5の詳細構成の一例を示している。破線で囲んだ部分が
圧縮処理部15に相当する。図1〜図3を用いて本実施
例の信号の流れを説明する。
FIG. 2 shows an example of the detailed configuration of the code amount control unit 14 in FIG. A portion surrounded by a broken line corresponds to the code amount control unit 14. FIG. 3 shows the compression processing unit 1 of FIG.
5 shows an example of a detailed configuration. A portion surrounded by a broken line corresponds to the compression processing unit 15. The signal flow of this embodiment will be described with reference to FIGS.

【0030】まず、図1の符号量制御部14がI/O1
2からプリンタに出力する画像サイズ情報を受信する。
画像サイズは、画像領域が長方形の場合は、<横画素数
>、<縦画素数>という形式で接続したホストコンピユ
ータから受信する方式、長方形以外の画像領域の場合
は、<画像領域の面積>という形式で受信する方式等が
考えられる。とにかく、画像情報よりも先にヘツダ情報
として受信する必要がある。
First, the code amount control unit 14 shown in FIG.
2 receives image size information to be output to the printer.
When the image area is rectangular, the image size is determined by a method of receiving from a connected host computer in the form of <number of horizontal pixels> and <number of vertical pixels>. For an image area other than a rectangle, <area of image area> And the like. Anyway, it is necessary to receive the information as header information before the image information.

【0031】この画像サイズ情報は、図2に示す基準符
号量演算部21に送信され、そこにおいてブロツク当り
の基準(平均)の符号量を演算する。例えば、プリンタ
の所有しているメモリ容量をA、入力した画像サイズを
8×8のブロツクに分割した場合のブロツク数をBとす
ると、A/Bがブロツク当りの基準(平均)の符号量に
相当する。
This image size information is transmitted to the reference code amount calculation section 21 shown in FIG. 2, where the reference (average) code amount per block is calculated. For example, if the memory capacity of the printer is A and the number of blocks when the input image size is divided into 8 × 8 blocks is B, A / B is the reference (average) code amount per block. Equivalent to.

【0032】画像情報は、I/O12から、1ブロツク
ライン分、バツファ13に格納され、圧縮処理部15の
図3に示すのブロツク化回路31に送信される。圧縮処
理部15では、ブロツク化回路31でブロツク化した1
ブロツク分の画像情報をDCT回路32に送り、ここで
DCT変換を施し、ジグザグスキャン回路33において
ブロツク内低周波域から高周波域に図4に示す様に、ジ
グザグ状に一次元方向に並び換えられる。
The image information is stored in the buffer 13 for one block line from the I / O 12 and transmitted to the block forming circuit 31 of the compression processing unit 15 shown in FIG. In the compression processing unit 15, the 1
The image information for the blocks is sent to the DCT circuit 32, where DCT conversion is performed, and the zigzag scan circuit 33 rearranges the low frequency region in the block from the low frequency region to the high frequency region in a zigzag manner as shown in FIG. .

【0033】続いて量子化部34で、符号量制御部から
の量子化テーブルの情報に従つて量子化処理が行われ、
量子化係数はハフマン符号化35においてエントロピー
符号化が施され、メモリ16に1ブロツク分の符号が格
納される。以上の説明しおいて、符号化領域カウンタ1
7は、ブロツク化して符号化処理の施したブロツクを加
算していくアキユムレータより成つており、現在までの
終了したブロツク数が図2に示す掛け算器22に入力さ
れる。
Subsequently, the quantization unit 34 performs a quantization process according to the information of the quantization table from the code amount control unit.
The quantized coefficients are subjected to entropy coding in Huffman coding 35, and codes for one block are stored in the memory 16. In the above description, the coding area counter 1
Numeral 7 denotes an accumulator for adding the blocks which have been subjected to the block processing and the encoding process, and the number of blocks which have been completed so far is inputted to the multiplier 22 shown in FIG.

【0034】掛け算器22では、基準符号量演算部21
からのブロツク当りの基準となる符号量の情報と、符号
化が終了したブロツク数との積が演算される。例えば、
前述したA/Bがブロツク当りの基準符号量とした場合
には、現在までKブロツク終了していると仮定すると、
(A×K)/Bの値が演算される。全てのブロツクが終
了した場合にはK=Bとなる為、掛け算器の出力はAと
なる。
In the multiplier 22, the reference code amount calculating section 21
The product of the information of the code amount as a reference per block from the above and the number of blocks for which coding has been completed is calculated. For example,
If A / B is the reference code amount per block, assuming that K blocks have been completed up to now,
The value of (A × K) / B is calculated. When all the blocks are completed, K = B, so that the output of the multiplier is A.

【0035】掛け算器の結果は、減算器23において、
あらかじめ定めておいた下限設定値24が減算される。
この掛け算器22,減算器23のそれぞれの出力は、現
在までの符号化の終了した領域で基準となる符号量から
ある値だけ下方向にオフセツトを設定したものである。
すなわち、下限設定値をβとすると、現在まで、Kブロ
ツク終了していると仮定すると、減算器23からは
((A×K)/B)−βが出力される。
The result of the multiplier is calculated by the subtractor 23.
A preset lower limit value 24 is subtracted.
The output of each of the multiplier 22 and the subtractor 23 is obtained by setting the offset downward by a certain value from the reference code amount in the region where the coding has been completed up to the present.
That is, assuming that the lower limit set value is β, the subtractor 23 outputs ((A × K) / B) −β, assuming that the K block has been completed up to the present.

【0036】一方、メモリ16に格納されていく符号量
は、符号量カウンタ18によつてカウントされていく。
いま、Kブロツク符号化が終了した場合のメモリに格納
された符号量をCkとすると比較器25,26におい
て、それぞれ(A×K)/BとCkの大小関係、((A
×K)/B)−βとCkとの大小関係が比較される。判
定手段27では、この比較結果を入力して、 (A×K)/B≦Ck …1 ((A×K)/B)−β≦Ck<(A×K)/B …2 Ck<((A×K)/B)−β …3 のいずれかにあるかを判定する。
On the other hand, the code amount stored in the memory 16 is counted by a code amount counter 18.
Now, assuming that the code amount stored in the memory when the K block coding is completed is Ck, the comparators 25 and 26 determine the magnitude relationship between (A × K) / B and Ck, ((A
× K) / B) The magnitude relationship between -β and Ck is compared. The determination means 27 inputs the result of this comparison, and obtains (A × K) / B ≦ Ck... 1 ((A × K) / B) −β ≦ Ck <(A × K) / B. (A × K) / B) −β 3.

【0037】この判定手段の結果により、もし前記の1
の場合には、圧縮条件変換部28において、もう少し粗
い量子化をする様に変更し、前記3の場合にはもう少し
細かい量子化ができるように条件を変更する。前記2の
場合には、基準となる符号量となる符号量にほぼ沿つて
いる(許容幅に入つている)として、量子化条件は変更
しない。
According to the result of this determination means, if
In the case of (3), the compression condition conversion unit 28 changes so as to perform a little coarser quantization, and in the case of (3) above, the condition is changed so as to perform a slightly finer quantization. In the case of the above 2, the quantization condition is not changed assuming that the code amount is substantially in line with the reference code amount (enters the allowable width).

【0038】圧縮条件変更部28の情報は、圧縮処理部
へと送信され、変更後の条件によつて、それ以降のブロ
ツクが符号化処理される。以上、説明した制御をわかり
やすく示したのが図5である。図5において、横軸は累
積符号化ブロツク数を示し、最終了地点は、入力画像サ
イズ情報に基づき演算された全ブロツク数を示している
(この演算されたブロツク数をBとおく)。
The information of the compression condition changing unit 28 is transmitted to the compression processing unit, and the subsequent blocks are coded according to the changed condition. FIG. 5 shows the above-described control in an easy-to-understand manner. In FIG. 5, the horizontal axis indicates the number of accumulated coding blocks, and the end point indicates the total number of blocks calculated based on the input image size information (the calculated number of blocks is B).

【0039】縦軸は累積符号量を示し、最終地点は、プ
リンタの所有メモリを示す(このプリンタの所有メモリ
をAとおく)。原点を通り、傾きがA/Bの直線が基準
符号量の直線を示している。その直線よりも下限設定値
βだけ下方に引かれた直線が前述した許容幅を示した直
線になる。
The vertical axis indicates the accumulated code amount, and the last point indicates the memory owned by the printer (the memory owned by the printer is A). A straight line passing through the origin and having a slope of A / B indicates a straight line of the reference code amount. A straight line drawn downward from the straight line by the lower limit set value β is a straight line indicating the above-described allowable width.

【0040】すなわち、本実施例は、符号化していつた
軌跡をこの2本の直線間に押さえ込もうと制御するもの
である。このように制御することにより符号量の制御を
1パスで実現できる。なお、当然ではあるが、2種の量
子化テーブルは、符号量に差が表れるようにあらかじめ
実験的に設定しておく必要がある。
That is, in this embodiment, the trajectory encoded is controlled so as to be held between these two straight lines. By controlling in this way, control of the code amount can be realized in one pass. Needless to say, it is necessary to experimentally set the two types of quantization tables in advance so that the difference in the code amount appears.

【0041】以上説明した様に本実施例によれば、画像
情報を格納するメモリを保有するプリンタにおいて、累
積符号量と累積符号化領域の情報により、逐次、符号量
を制御することにより、1回のパスで画像の可変長符号
を一定のメモリ内に符号量を制御することができる。そ
の結果、ホストコンピユータからの画像情報の転送時間
が少なくて済むし、可変長符号化を用いているため、画
像情報の偏りに合つた良好な圧縮処理が実現できる。
As described above, according to the present embodiment, in the printer having the memory for storing the image information, the code amount is sequentially controlled based on the accumulated code amount and the information on the accumulated coding area, whereby It is possible to control the code amount of the variable-length code of the image in a fixed memory in each pass. As a result, the transfer time of the image information from the host computer can be reduced, and since the variable-length coding is used, it is possible to realize a good compression process suited to the bias of the image information.

【0042】<第2の実施例>図6に本発明に係る第2
の実施例の要部ブロツク図を示す。第2の実施例におけ
る符号量制御を説明する図7も参照して本発明に係る第
2の実施例を以下に説明する。第2の実施例は、第1の
実施例の応用であり、上述した図2の符号量制御部のブ
ロツク図と同様構成には同一番号を付し詳細説明を省略
する。
<Second Embodiment> FIG. 6 shows a second embodiment according to the present invention.
The block diagram of the principal part of the Example of FIG. Second Embodiment A second embodiment according to the present invention will be described below with reference to FIG. 7 illustrating code amount control in the second embodiment. The second embodiment is an application of the first embodiment. The same components as those in the block diagram of the code amount control unit in FIG. 2 described above are denoted by the same reference numerals, and detailed description is omitted.

【0043】図中、61は基準符号量演算部を示し、第
1の実施例同様に、ブロツク当りの基準となる符号量を
算出する。第2の本実施例では、ブロツク当りの基準と
なる符号量の設定に特徴がある。第2の実施例では、上
限設定値62からの値(αとおく)を受け取り、所有メ
モリ容量Aよりもα分減算した値を基準となる最終了地
点として設定する。すなわち、ブロツク当りの基準符号
量(図7の直線の傾きに相当する)を(A−α)/Bと
する。
In the figure, reference numeral 61 denotes a reference code amount calculation unit, which calculates a reference code amount per block as in the first embodiment. The second embodiment is characterized by the setting of the code amount serving as a reference per block. In the second embodiment, a value (α) from the upper limit set value 62 is received, and a value obtained by subtracting α from the owned memory capacity A is set as a reference end point. That is, the reference code amount per block (corresponding to the slope of the straight line in FIG. 7) is set to (A-α) / B.

【0044】いま、符号化領域カウンタからの入力がK
ブロツクだと仮定する。すると、掛け算器22の出力は
((A−α)×K)/Bとなる。掛け算器の結果は、加
算器63において、あらかじめ定めておいた上限設定値
62との加算がなされ、また、減算器23においては、
あらかじめ定めておいた下限設定値24(βとおく)が
減算される。
Now, if the input from the coding area counter is K
Assume block. Then, the output of the multiplier 22 is ((A−α) × K) / B. The result of the multiplier is added to a predetermined upper limit set value 62 in an adder 63, and
A predetermined lower limit set value 24 (hereinafter referred to as β) is subtracted.

【0045】この加算器63、減算器23のそれぞれの
出力は、現在までの符号化の終了した領域で基準となる
符号量からある値だけ、上方向と下方向にオフセツトを
設定したものである。すなわち、加算器63からは、
((A−α)×K)/B+α、減算器23からは、
((A−α)×K)/B−βが出力される。
The outputs of the adder 63 and the subtractor 23 are obtained by setting offsets in the upward and downward directions by a certain value from the reference code amount in the region where the coding has been completed up to the present. . That is, from the adder 63,
((A−α) × K) / B + α, from the subtractor 23,
((A−α) × K) / B−β is output.

【0046】いま、Kブロツク符号化が終了した場合の
メモリに格納された符号量をCkとすると比較器27,
28において、それぞれ、((A−α)×K)/B+α
とCkの大小関係、((A−α)×K)/B−βとCk
との大小関係が比較される。判定手段27では、この比
較結果を入力して、 ((A−α)×K/B+α≦CK …1 Ck<((A−α)×K)/B+αかつ ((A−α)×K)/B−β≦Ck …2 Ck<((A−α)×K)/B−β …3 のいずれかにあるかを判定する。
Now, assuming that the code amount stored in the memory when the K block coding is completed is Ck, the comparator 27,
28, ((A−α) × K) / B + α
And Ck, ((A−α) × K) / B−β and Ck
The magnitude relationship with is compared. The determination means 27 inputs the result of this comparison, and obtains ((A−α) × K / B + α ≦ CK 1 Ck <((A−α) × K) / B + α and ((A−α) × K) / B−β ≦ Ck 2 It is determined whether Ck <((A−α) × K) / B−β 3.

【0047】第1の実施例同様に、この判定手段の結果
により、もし、前記の1の場合には圧縮条件変更部28
においてもう少し粗い量子化をする様に変更し、前記3
の場合にはもう少し細かい量子化ができるように条件を
変更する。前記2の場合には、基準となる符号量にほぼ
沿つている(許容幅に入つている)として、量子化条件
は変更しない。
As in the first embodiment, based on the result of this determination means, if the above-mentioned case 1, the compression condition changing unit 28
Was changed to perform a little coarser quantization in
In the case of, the condition is changed so that a finer quantization can be performed. In the case of the above 2, the quantization condition is not changed, assuming that it is substantially in line with the reference code amount (enters the allowable width).

【0048】圧縮条件変更部28の情報は、圧縮処理部
へと送信され、変更後の条件によつてそれ以降のブロツ
クが符号化処理される。すなわち、本実施例において
は、基準となる符号量の上下に幅(オフセツト)を有し
ていること、また、基準符号量の算出が異なつているの
が特徴であり、以上の様に制御することにより、よりブ
ロツクごとの符号量の誤りを許容できるような符号量制
御が可能となる。
The information of the compression condition changing unit 28 is transmitted to the compression processing unit, and the subsequent blocks are coded according to the changed condition. That is, the present embodiment is characterized in that it has widths (offsets) above and below the reference code amount and that the calculation of the reference code amount is different, and the control is performed as described above. This makes it possible to control the code amount so that errors in the code amount for each block can be tolerated.

【0049】<第3の実施例>図8に本発明に係る第3
の実施例の要部ブロツク図を示す。第3の実施例におけ
る符号量制御を説明する図9も参照して本発明に係る第
3の実施例を以下に説明する。第3の実施例では、基準
符号量からのオフセツト分の許容幅を設定するのではな
く、直接、累積符号化ブロツク数と累積符号量の関係か
ら圧縮条件を設定する(第3の実施例では、量子化テー
ブルを5種類保持していると仮定する)。
<Third Embodiment> FIG. 8 shows a third embodiment according to the present invention.
The block diagram of the principal part of the Example of FIG. Third Embodiment A third embodiment according to the present invention will be described below with reference to FIG. 9 illustrating code amount control in the third embodiment. In the third embodiment, instead of setting the allowable width of the offset from the reference code amount, the compression condition is set directly from the relationship between the number of accumulated coding blocks and the accumulated code amount (in the third embodiment, , Five types of quantization tables are held).

【0050】図8において、81は量子化テーブル設定
手段を示し、I/Oからの画像サイズ情報を入力するこ
とにより、全ブロツク数(Bとおく)を算出する。ま
た、符号化領域カウンタから、累積符号化ブロツクの情
報を受信することにより、累積の符号化ブロツクの全ブ
ロツク数Bに対する比率も算出できる。すなわち、図9
に示した様なグラフをROMの構成で、あらかじめ設定
しておくことが可能である。
In FIG. 8, reference numeral 81 denotes a quantization table setting means, which calculates the total number of blocks (B) by inputting image size information from I / O. Further, by receiving information on the cumulative coding blocks from the coding area counter, the ratio of the cumulative coding blocks to the total block number B can be calculated. That is, FIG.
Can be set in advance in a ROM configuration.

【0051】いま、累積符号化ブロツクがKブロツクで
あつたとする。また、保持している量子化テーブルは、
量子化の粗い方からQ4,Q3,Q2,Q1,Q0とナ
ンバーが付けられているとする。量子化テーブル設定手
段81からの出力は<Q3の上限値>、<Q2の上限値
>、<Q1の上限値>、<Q0の上限値>の4種の信号
であり、それぞれ比較器82,83,84,85に送信
される。
Now, assume that the cumulative coding block is a K block. The quantization table held is
It is assumed that numbers Q4, Q3, Q2, Q1 and Q0 are assigned in the order of coarser quantization. Outputs from the quantization table setting means 81 are four kinds of signals, <upper limit value of Q3>, <upper limit value of Q2>, <upper limit value of Q1>, and <upper limit value of Q0>. 83, 84, and 85.

【0052】符号量カウンタからの入力がCkであつた
とすると、それぞれの量子化テーブルの上限値がそれぞ
れの比較器にて比較される。Qnの上限値をQnUPと
おくと、比較結果は、 Q3UP<Ck …1(Q4のテーブ
ル) Q2UP≦Ck<Q3UP …2(Q3のテーブ
ル) Q1UP≦Ck<Q2UP …3(Q2のテーブ
ル) Q0UP≦Ck<Q1UP …4(Q1のテーブ
ル) Ck<Q0UP …5(Q0のテーブル) の5通りに分類できる。
Assuming that the input from the code amount counter is Ck, the upper limit of each quantization table is compared by each comparator. Assuming that the upper limit of Qn is QnUP, the comparison result is as follows: Q3UP <Ck 1 (table of Q4) Q2UP ≦ Ck <Q3UP 2 (table of Q3) Q1UP ≦ Ck <Q2UP 3 (table of Q2) Q0UP ≦ Ck <Q1UP... 4 (table of Q1) Ck <Q0UP... 5 (table of Q0)

【0053】判定手段86は、比較結果を受けてどの量
子化器の範囲に属しているかを判定する。量子化テーブ
ル選択手段87において、前記判定手段86の判定結果
に基づき、保持している量子化テーブルの中から適合す
るテーブルを選択し、圧縮処理部へと送信される。尚、
以上の説明では、比較器を4個保有する構成を述べた
が、累積符号量の変化は連続であることを考えれば、よ
り、簡便な構成(例えば、比較器の数を減らした構成な
ど)でも実現できる。
The determining means 86 receives the comparison result and determines which quantizer range it belongs to. In the quantization table selection means 87, a suitable table is selected from the held quantization tables based on the determination result of the determination means 86, and transmitted to the compression processing unit. still,
In the above description, the configuration in which four comparators are provided has been described. However, considering that the change in the accumulated code amount is continuous, a simpler configuration (for example, a configuration in which the number of comparators is reduced) is provided. But you can.

【0054】また、本実施例では、図9に示す様に、累
積符号化ブロツク数が増す程、各テーブルの切り換え範
囲が狭くなる様な構成も可能である。すなわち、累積符
号化ブロツクが増える程、各ブロツクごとの符号量の偏
りが相殺される様になるためである。とりわけ、プリン
タにおいては、入力画像は、画像読み取り装置等から入
力した自然画像、ホストコンピユータにより人工的に作
成した画像、文字・線画像等の様々な画像情報が、接続
したホストコンピユータ等から合成された形式で送信さ
れることが多い。
Further, in this embodiment, as shown in FIG. 9, it is possible to adopt a configuration in which the switching range of each table becomes narrower as the number of accumulated coding blocks increases. That is, as the number of accumulated coding blocks increases, the bias of the code amount for each block is offset. In particular, in a printer, an input image is composed of various image information such as a natural image input from an image reading device or the like, an image artificially created by a host computer, and a character / line image from a connected host computer or the like. Often sent in a different format.

【0055】そうした場合には、符号化のはじめの段階
では許容幅を大きく設定して、符号量の偏りを取るよう
にして、符号化の広範にて符号量の制御していくように
することが可能だ。以上、量子化条件の切り換えによ
り、符号量制御の例を述べたが、量子化器のテーブル
は、復号時も容易に読みだせることが前提であり、量子
化条件の切り代わつたポイントで切り換え情報を符号化
しても良いし、量子化テーブルをインデツクス情報にし
て符号化しても良い。
In such a case, at the beginning of the encoding, the allowable width is set to be large, so that the code amount is biased, and the code amount is controlled in a wide range of the encoding. Is possible. As described above, the example of the code amount control by switching the quantization condition has been described. However, it is assumed that the table of the quantizer can be easily read even at the time of decoding, and the switching information is switched at the point where the quantization condition is switched. May be encoded, or may be encoded using a quantization table as index information.

【0056】また、前述したように、各々の量子化テー
ブルは、ある代表的な画像を用いて、ある符号量になる
ように、あらかじめ実験的に求めておくのが良い。ま
た、本実施例では、ブロツク単位で、符号量の検知を行
つているが、数ブロツク単位、ブロツクライン単位での
検知も当然、有効である。 <第4の実施例>以下、図面を参照して本発明に係る第
4の実施例について詳細に説明する。
As described above, it is preferable that each quantization table be experimentally obtained in advance so as to have a certain code amount using a certain representative image. Further, in the present embodiment, the detection of the code amount is performed in units of blocks, but the detection in units of several blocks or block lines is naturally effective. <Fourth Embodiment> Hereinafter, a fourth embodiment of the present invention will be described in detail with reference to the drawings.

【0057】(1)第4の実施例における構成の説明 図10において、801は第4の実施例における画像符
号化装置を示すブロツク図である。図において、802
は入力画像信号をブロツク化するブロツク化部、803
はブロツクごとに系列変換を行なう変換部803、80
4は変換係数ブロツクを量子化マトリクスを用いて量子
化する量子化部、805は量子化された変換係数を可変
長符号を用いて符号化する符号化部、806は符号化部
805で符号化された符号量をある単位ごとに累積する
符号量累積部、807は符号量累積部806に格納され
ている符号量から符号量の増加率を判定する増加率判定
部、808は増加率判定部807での判定結果から閾値
を切り換える閾値切り換え部、809は量子化部804
を用いる量子化マトリクスを設定する量子化マトリクス
設定部である。
(1) Description of Configuration in Fourth Embodiment In FIG. 10, reference numeral 801 is a block diagram showing an image coding apparatus according to the fourth embodiment. In the figure, 802
A block 803 for blocking an input image signal.
Are conversion units 803 and 80 for performing series conversion for each block.
Reference numeral 4 denotes a quantization unit for quantizing the transform coefficient block using a quantization matrix, reference numeral 805 denotes an encoding unit for encoding the quantized transform coefficient using a variable length code, and reference numeral 806 denotes an encoding unit for encoding by the encoding unit 805. A code amount accumulating unit that accumulates the obtained code amount for each unit; 807, an increase rate determination unit that determines an increase rate of the code amount from the code amount stored in the code amount accumulation unit 806; A threshold switching unit that switches a threshold based on the determination result in 807, and a quantization unit 809
Is a quantization matrix setting unit that sets a quantization matrix using.

【0058】(2)処理手順の説明 次に、以上の構成を備える第4の実施例における画像符
号化装置801での画像符号化制御を図11に示すフロ
ーチヤートに従つて説明する。画像信号が入力されると
図11の処理に進み、先ずステツプS1で量子化マトリ
クス設定部809においてデフオルトの量子化マトリク
スが設定される。次にステツプS2で入力画像信号はブ
ロツク化部802でn×n画素にブロツク化され、ブロ
ツクの取り出しが行われる。
(2) Description of Processing Procedure Next, image coding control in the image coding apparatus 801 according to the fourth embodiment having the above configuration will be described with reference to a flowchart shown in FIG. When an image signal is input, the process proceeds to the processing of FIG. 11, and first, in step S1, a default quantization matrix is set in a quantization matrix setting unit 809. Next, in step S2, the input image signal is blocked into n.times.n pixels by a blocking section 802, and the block is extracted.

【0059】次にステツプS3で変換部803において
n×n画素のデータに対して系列変換を行い、n×m個
の変換係数を算出する。ここで、変換部803系列変換
として離散コサイン変換を用いた場合における離散コサ
イン変換式は下記に示す数1の変換式を用いるのが望ま
しい。
Next, in step S3, the conversion unit 803 performs series conversion on the data of n × n pixels, and calculates n × m conversion coefficients. Here, as the discrete cosine transform equation in the case where the discrete cosine transform is used as the transform unit 803 series transform, it is desirable to use the following equation (1).

【0060】[0060]

【数1】 (Equation 1)

【0061】次にステツプS3で、量子化部804にお
いて変換係数の位置ごとに変換係数を量子化マトリクス
のそれぞれの値で割り、量子化を行う。ここで、量子化
マトリクスのそれぞれの値が大きいと、量子化により
「0」による係数が多くなり、符号量が少なくなる。続
いてステツプS5で、符号化部805において量子化し
た係数と、量子化に用いたマトリクス情報を符号化す
る。そしてステツプS6で符号量累積部806において
符号量を累積し、格納しておく。次にステツプS7で累
積単位の処理が終了したか否かを調べ、累積単位分の処
理が終了していなければステツプS2に戻り、以上のス
テツプS2〜ステツプS6の処理を1ブロツク・ライン
分繰り返す。
Next, in step S3, the quantizing section 804 divides the transform coefficient for each position of the transform coefficient by each value of the quantization matrix and performs quantization. Here, when each value of the quantization matrix is large, the coefficient by “0” increases due to the quantization, and the code amount decreases. Subsequently, in step S5, the coefficients quantized by the encoding unit 805 and matrix information used for quantization are encoded. Then, in step S6, the code amount is accumulated and stored in the code amount accumulating section 806. Next, at step S7, it is checked whether or not the processing of the cumulative unit has been completed. If the processing of the cumulative unit has not been completed, the process returns to step S2, and the processing of steps S2 to S6 is repeated for one block line. .

【0062】ステツプS7で累積単位の処理が終了した
場合にはステツプS8に進み、増加率判定部807にお
いて前ブロツク・ライン分の符号量と該ブロツク・ライ
ン分の符号量の差Dを、所定の閾値TH1と比較する。
ここで、差Dが閾値TH1よりも大きければ、ステツプ
S9に進み、閾値切り換え部808において量子化マト
リクス設定部809で用いる閾値テーブル(閾値テーブ
ルには各符号化領域(符号化処理の段階)と量子化マト
リクス切換のための閾値TH2との対応が示されてい
る)を切り換えステツプS10に進む。一方、ステツプ
S8で差Dが閾値TH1よりも小さければ直ちにステツ
プS10に進む。
If the processing of the accumulation unit is completed in step S7, the process proceeds to step S8, where the increase rate determination unit 807 determines the difference D between the code amount of the previous block line and the code amount of the block line by a predetermined value. Is compared with the threshold value TH1.
Here, if the difference D is larger than the threshold value TH1, the process proceeds to step S9, where the threshold value switching unit 808 uses a threshold table (threshold table) used in the quantization matrix setting unit 809.
Each coding area (stage of coding process) and quantization matrices
The correspondence with the threshold value TH2 for switching the risk is shown.
That), the process proceeds to step S10 to switch the. On the other hand, if the difference D is smaller than the threshold value TH1 in step S8, the process immediately proceeds to step S10.

【0063】ステツプS10では、該ブロツク・ライン
までの全累積符号量Cと現在設定されている閾値テーブ
ルの該符号化領域での値TH2を比較する。そして累積
符号量が閾値TH2よりも大きければ、ステツプS11
に進み、量子化マトリクス設定部809においてこれま
でよりもそれぞれの値が大きい量子化マトリクス(圧縮
率大)を設定しステツプS13に進む。
In step S10, the total accumulated code amount C up to the block line is compared with the value TH2 in the coding area of the currently set threshold table. If the accumulated code amount is larger than the threshold value TH2, step S11 is executed.
The quantization matrix setting unit 809 sets a quantization matrix (large compression ratio) having a larger value than before, and proceeds to step S13.

【0064】一方、累積符号量が閾値TH2より小さけ
れば、ステツプS12に進み、量子化マトリクス設定部
809においてこれまでよりもそれぞれの値が小さい量
子化マトリクス(圧縮率小)を設定しステツプS13に
進む。ステツプS13では、該処理ブロツクが最終ブロ
ツクであるか否かを判定する。処理ブロツクが最終ブロ
ツクならば処理を終了し、処理ブロツクが最終ブロツク
でなければステツプS2に戻り、以上の処理を最終ブロ
ツクまで繰り返す。
On the other hand, if the accumulated code amount is smaller than the threshold value TH2, the process proceeds to step S12, in which the quantization matrix setting unit 809 sets a quantization matrix (small compression ratio) whose values are smaller than before, and proceeds to step S13. move on. In step S13, it is determined whether or not the processing block is the last block. If the processing block is the final block, the processing is terminated. If the processing block is not the final block, the process returns to step S2, and the above processing is repeated until the final block.

【0065】なお、図11に示すステツプS7における
判定は上述した1ブロツク・ライン毎に行う例に限定さ
れるものでは無く、任意のブロツク毎に行うことも当然
に本実施例の範囲に含まれるものである。例えば、数ブ
ロツク・ラインを対象に行なつてもよい。この場合に
は、ステツプS8では前ブロツク・ラインと該ブロツク
・ラインの符号量の差Dと閾値TH1を比較するのでは
なくて、最終的な目標の符号量に占める数ブロツク・ラ
イン分の符号量の割合D′と、ある閾値TH3を比較す
る。
The determination in step S7 shown in FIG. 11 is not limited to the above-described example in which the determination is made for each block line, and the determination in any block is naturally included in the scope of the present embodiment. Things. For example, the processing may be performed for several block lines. In this case, in step S8, instead of comparing the difference D between the code amount of the previous block line and the block line with the threshold value TH1, the code of several block lines in the final target code amount is used. The ratio D 'of the amount is compared with a certain threshold value TH3.

【0066】更に、図11に示すステツプS8の処理で
用いる閾値TH1も、上述の例に限定されるものでは無
く、例えば画像の位置ごとに複数用意しておいてもよ
い。閾値TH1を画像の位置(符号化処理の段階)に応
じて変化させることによりステツプS9での閾値の切り
換えをより適応的に行なうことができる。更にまた、図
11に示すステツプS8やステツプS10で用いる閾値
TH1,TH2を、上述した様にあらかじめ画像の位置
ごとのテーブルとして用意しておくのではなく、次式に
より画像の位置情報から計算で求めてもよい。
Further, the threshold value TH1 used in the processing of step S8 shown in FIG. 11 is not limited to the above example, and a plurality of threshold values TH1 may be prepared for each image position. By changing the threshold value TH1 according to the position of the image (the stage of the encoding process), the switching of the threshold value in step S9 can be performed more adaptively. Further, the threshold values TH1 and TH2 used in steps S8 and S10 shown in FIG. 11 are not prepared in advance as a table for each image position as described above, but are calculated from the image position information by the following equation. You may ask.

【0067】 TH1=m×画像の位置 TH2=n×画像の位置 このとき、m,nを切り換えることにより閾値の切り換
えを行なうことができる。以上説明したように本実施例
によれば、入力画像信号を複数画素からなるブロツクに
分割するブロツク化部と、ブロツクごとに系列変換する
変換部と、変換された変換係数を量子化マトリクスを用
いて量子化する量子化部と、量子化された変換係数を可
変長符号を用いて符号化する符号化部と、符号化された
符号量を累積する符号累積部と、符号量累積部の累積符
号量を元に量子化部で用いる量子化マトリクスを切り換
える量子化マトリクス設定部とを備え、更に、符号量累
積部において累積された符号量が増加率を判定する増加
率判定部と、増加率判定部での判定結果から量子化マト
リクス設定部で量子化マトリクスの切り換えに用いる閾
値を切り換える閾値切り換え部とを備えることにより、
量子化マトリクスの切り換えに用いる閾値を画像の位置
における符号化情報量に応じて適応的に切り換え、画像
全体での量子化幅を段階的に変化させることができる。
TH1 = m × image position TH2 = n × image position At this time, the threshold value can be switched by switching between m and n. As described above, according to the present embodiment, a block conversion unit that divides an input image signal into blocks of a plurality of pixels, a conversion unit that performs series conversion for each block, and a quantization matrix that converts the converted conversion coefficients are used. A quantizing unit for quantizing the quantized transform coefficients using a variable-length code, a code accumulating unit for accumulating the encoded code amount, and an accumulating unit for accumulating the code amount. A quantization matrix setting unit that switches a quantization matrix used in the quantization unit based on the code amount; and an increase rate determination unit that determines an increase rate of the code amount accumulated in the code amount accumulation unit; By providing a threshold switching unit that switches a threshold used for switching the quantization matrix in the quantization matrix setting unit from the determination result in the determination unit,
The threshold used for switching the quantization matrix can be adaptively switched according to the amount of encoded information at the position of the image, and the quantization width of the entire image can be changed stepwise.

【0068】また、符号後の符号量を目標の値に固定す
ることができる。 <第5の実施例>以下、図面を参照して本発明に係る第
5の実施例を詳細に説明する。図12は本発明に係る第
5の実施例における画像符号化装置を示すブロツク図で
ある。同図において、上述した図21に示す従来例と略
同様構成には同一番号を付し、詳細説明を省略する。即
ち、401〜409(除く404)は画像データ入力端
子、バツフア、DCT変換部、パツキング処理部、圧縮
データ出力端子、横サイズ入力端子、縦サイズ入力端
子、符号量演算部を示している。第5の実施例における
構成と上述した図21に示す構成における細部の異なる
機能については後述する。
Further, the code amount after coding can be fixed to a target value. <Fifth Embodiment> Hereinafter, a fifth embodiment of the present invention will be described in detail with reference to the drawings. FIG. 12 is a block diagram showing an image encoding apparatus according to the fifth embodiment of the present invention. In the figure, the same components as those in the conventional example shown in FIG. 21 described above are denoted by the same reference numerals, and detailed description is omitted. That is, reference numerals 401 to 409 (excluding 404) indicate an image data input terminal, a buffer, a DCT converter, a packing processor, a compressed data output terminal, a horizontal size input terminal, a vertical size input terminal, and a code amount calculator. The functions of the configuration in the fifth embodiment different from those in the configuration shown in FIG. 21 will be described later.

【0069】また本実施例では、さらに量子化後のデー
タを図13に示すスキヤン順序に並び替えるスキヤン変
換部101、スキヤン変換されたデータを、各データの
エントロピーに基づいて符号化を行なうエントロピー符
号化部102、該エントロピー符号化部102にて発生
した全符号化量を計数するための符号量計数部103、
1ブロツクを符号化するたびに1つのパルスを入力する
ための入力端子104、符号量演算部409から出力さ
れる1ブロツクの割り当て符号量を1ブロツク符号化す
るごとに累積加算していくアキユームレータ105、符
号量計数部103の出力からアキユムレータ105の出
力を減算する減算器106、該減算器106の出力結果
に基づき複数の量子化テーブルの切り換えを制御する量
子化テーブル切り替え制御部107、複数の量子化テー
ブルを格納している量子化テーブル格納部108を備え
ている。
Further, in this embodiment, a scan transform unit 101 for rearranging the quantized data in the scan order shown in FIG. 13 and entropy code for encoding the scan-transformed data based on the entropy of each data. Encoding section 102, a code amount counting section 103 for counting the total encoding amount generated in the entropy encoding section 102,
An input terminal 104 for inputting one pulse each time one block is encoded, and an accumulator that accumulatively adds the assigned code amount of one block output from the code amount calculation unit 409 every time one block is encoded. A subtractor 106 for subtracting the output of the accumulator 105 from an output of the code amount counting unit 103; a quantization table switching control unit 107 for controlling switching of a plurality of quantization tables based on an output result of the subtracter 106; And a quantization table storage unit 108 for storing the quantization table of

【0070】第5の実施例における画像符号化装置を用
いた画像出力装置の構成としては、従来例の説明で使用
した図22の構成を用いることができる。従つて、以下
の説明は画像出力装置全体の説明は省略し、以上に説明
した図12の構成における制御動作を説明する。コンピ
ユータ等の外部装置(不図示)から送られてきたデータ
は、図22と同様、インタフエース部501にて画像の
ヘツダー情報と実際の画像データとに分けられ、ヘツダ
ー情報中の画像の横サイズ情報は図12における端子4
07に入力される。一方、縦サイズ情報中の画像の横サ
イズ情報は、図12における端子407に入力される。
縦サイズ情報は端子408に入力される。画像データは
端子401に入力される。端子407,408に入力さ
れた画像の横サイズ、縦サイズ情報は符号量演算部40
9に送られ、1ブロツクに割り当て可能なビツト数が演
算され、出力される。
As the configuration of the image output device using the image encoding device in the fifth embodiment, the configuration shown in FIG. 22 used in the description of the conventional example can be used. Accordingly, in the following description, the description of the entire image output apparatus will be omitted, and the control operation in the configuration of FIG. 12 described above will be described. Data sent from an external device (not shown) such as a computer is divided into header information of an image and actual image data by an interface unit 501 as in FIG. 22, and the horizontal size of the image in the header information is changed. Information is at terminal 4 in FIG.
07. On the other hand, the horizontal size information of the image in the vertical size information is input to the terminal 407 in FIG.
The vertical size information is input to the terminal 408. The image data is input to a terminal 401. The information on the horizontal size and vertical size of the image input to the terminals 407 and 408
9, the number of bits that can be assigned to one block is calculated and output.

【0071】一方、端子401に入力された画像データ
は、バツフア402に格納された後、ブロツク単位で読
み出されDCT変換部403に送られる。1ブロツク分
の画像データをバツフア402からDCT変換部403
へ送るたびに端子104にパルスを入力し、アキユムレ
ータ105に送る。アキユムレータ105は、画像の符
号化処理に先立ち、初期値「0」にクリアされ、端子1
04よりパルスを受けとるごとに、符号量演算部409
の出力値を累積加算して結果を出力する。このアキユム
レータの出力値120は、画像を符号化することによつ
て発生した総符号量の基準となるものであり、以下基準
符号量と呼ぶ。DCT変換部403に送られた画像デー
タは、ブロツク単位でDCT変換が行なわれ、次の量子
化部404′で量子化される。
On the other hand, the image data input to the terminal 401 is stored in the buffer 402, read out in blocks, and sent to the DCT converter 403. The image data for one block is converted from the buffer 402 to the DCT converter 403.
A pulse is input to the terminal 104 each time the signal is sent to the terminal 104 and sent to the accumulator 105. The accumulator 105 is cleared to the initial value “0” prior to the image encoding process,
Each time a pulse is received from the control unit 04, the code amount calculation unit 409
Are cumulatively added and the result is output. The output value 120 of the accumulator serves as a reference for the total code amount generated by encoding the image, and is hereinafter referred to as a reference code amount. The image data sent to the DCT transform unit 403 is subjected to DCT transform for each block, and is quantized by the next quantizing unit 404 '.

【0072】ここで、上述した図21に示す従来例で
は、DCT変換部の各周波数成分に対して、あらかじめ
符号化ビツト数が決められており、そのビツト数に収ま
るよう量子化を行なう必要があつたが、本実施例では、
情報量の少ないブロツクは少ないビツト数で符号化する
ため、各周波数成分に対してあらかじめ符号化ビツト数
を決めるようなことはしない。
In the conventional example shown in FIG. 21 described above, the number of coding bits is determined in advance for each frequency component of the DCT transform unit, and it is necessary to perform quantization so as to be within the number of bits. Atsushi, in this embodiment,
Since a block having a small amount of information is encoded with a small number of bits, the number of encoded bits is not determined in advance for each frequency component.

【0073】そのかわり、各周波数成分に対して量子化
ステツプを定め、それに基づいて量子化を行なう。その
量子化ステツプは、量子化テーブル格納部108から量
子化部404′に与えられる。量子化部404′で量子
化されたデータは、スキヤン変換部101に送られ、こ
こで図13に示す順序にスキヤン変換される。一般に、
自然画像では高域の周波数成分ほど電力が小さく、量子
化後にゼロになりやすい。よつて図13のような順序に
並び替えられると、ゼロが後半に集中しやすくなる。こ
のため、符号化・復号化の際にブロツクの区切りが識別
出来るようにすれば、後側に連続するゼロについては、
符号化を省略することが可能となる。こうすることによ
り、1ブロツクの符号化データが、ブロツクの区切り情
報のみ、あるいは、直流成分とブロツクの区切り情報の
みで済んでしまうといつた場合が出てくる。
Instead, a quantization step is determined for each frequency component, and quantization is performed based on the quantization step. The quantization step is provided from the quantization table storage unit 108 to the quantization unit 404 '. The data quantized by the quantization unit 404 'is sent to the scan conversion unit 101, where it is scan-transformed in the order shown in FIG. In general,
In a natural image, the higher the frequency component in the frequency band, the smaller the power, and tends to be zero after quantization. Therefore, if the data is rearranged in the order as shown in FIG. 13, zeros tend to be concentrated in the latter half. For this reason, if it is possible to identify the block break at the time of encoding / decoding, for the zeros consecutive on the rear side,
The encoding can be omitted. By doing so, it may happen that one block of coded data only needs block delimiter information or only DC component and block delimiter information.

【0074】スキヤン変換部101でのスキヤン変換後
の各周波数成分データは、エントロピー符号化部102
において、各々の値の出現確率に応じて可変長符号に変
換するエントロピー符号化を行なう。このエントロピー
符号化によつて発生した符号データ及び符号量は、それ
ぞれパツキング処理部405、符号量計数部103へ送
られる。
Each frequency component data after the scan conversion by the scan conversion unit 101 is input to the entropy encoding unit 102
, Entropy encoding for converting to a variable length code according to the appearance probability of each value is performed. The code data and code amount generated by the entropy coding are sent to the packing unit 405 and the code amount counting unit 103, respectively.

【0075】パツキング処理部405は、数ビツト単位
で発生する符号データをバイト単位もしくはワード単位
の情報にまとめ、圧縮データとして端子406へ出力す
る。一方、符号量計数部103は、画像の符号化に先立
ちゼロにクリアされ、エントロピー符号化部102から
受け取つた符号量を順次加算してゆき結果を出力する。
The packing section 405 combines code data generated in units of several bits into information in units of bytes or words and outputs the information to the terminal 406 as compressed data. On the other hand, the code amount counting unit 103 is cleared to zero prior to image coding, sequentially adds the code amounts received from the entropy coding unit 102, and outputs a result.

【0076】この符号量計数部の出力値121は、画像
を符号化することによつて実際に発生した符号量の各時
点での総和であり、以下発生符号量と呼ぶ。該発生符号
量121は、符号化する画像の性質によつて大きくもな
り、小さくもなるが、基準符号量120に近い値をとる
ことが望ましい。発生符号量121が基準符号量120
よりあまりにも大きいと、全画像データの符号化が完了
する以前に記憶部503の空き領域が無くなつてしま
い、全画像データを保存することが出来なくなつてしま
う。
The output value 121 of the code amount counting unit is the sum of the code amount actually generated by encoding the image at each point in time, and is hereinafter referred to as the generated code amount. The generated code amount 121 becomes larger or smaller depending on the nature of the image to be coded, but it is desirable to take a value close to the reference code amount 120. The generated code amount 121 is equal to the reference code amount 120
If the size is too large, the free space in the storage unit 503 will be exhausted before the encoding of all image data is completed, and it will not be possible to save all image data.

【0077】また、発生符号量121が基準符号量12
0よりあまりにも小さいと、記憶部503を有効に使つ
ていないことになり、本来、低い圧縮率で画像の劣化を
低くおさえることが可能であつたにもかかわらず、そう
していなことになる。そこで、第5の実施例において
は、減算器106にて、発生符号量121から基準符号
量120を減算して、差分値123を求め、該差分値1
23の絶対値が小さくなるように制御を行なう。
The generated code amount 121 is equal to the reference code amount 12
If the value is smaller than 0, the storage unit 503 is not used effectively, and although it is originally possible to suppress the deterioration of the image with a low compression ratio, it is not so. Become. Therefore, in the fifth embodiment, the subtractor 106 subtracts the reference code amount 120 from the generated code amount 121 to obtain a difference value 123, and obtains the difference value 1
Control is performed so that the absolute value of 23 becomes small.

【0078】即ち、量子化テーブル切り換え制御部10
7では、該差分値123を複数の閾値と比較し、それら
の閾値との大小関係によつて、複数の量子化テーブルの
内の1つを選択する選択信号124を量子化テーブル格
納部108へ出力する。該量子化テーブル格納部108
は、それぞれ圧縮率の異なる複数の量子化テーブルを有
しており、該選択信号124により、その複数の量子化
テーブルの内の1つを選択して、量子化部404′で量
子化される周波数成分に対応した量子化ステツプ信号1
25を該量子化部404′へ出力する。
That is, the quantization table switching control unit 10
In step 7, the difference value 123 is compared with a plurality of threshold values, and a selection signal 124 for selecting one of the plurality of quantization tables is sent to the quantization table storage unit 108 based on the magnitude relation with the threshold values. Output. The quantization table storage unit 108
Has a plurality of quantization tables with different compression ratios. One of the plurality of quantization tables is selected by the selection signal 124 and quantized by the quantization unit 404 '. Quantization step signal 1 corresponding to frequency component
25 is output to the quantization section 404 '.

【0079】差分値123の絶対値が小さくなるように
するには、差分値123が大きくなつたときに、圧縮率
の高い(発生する符号量の少ない)量子化テーブルへ切
り換え、差分値123が小さく(マイナス方向に大き
い)なつたときに圧縮率の低い量子化テーブルへ切り換
えるようにすればよい。以上説明した様に第5の実施例
では、発生符号量121から基準符号量120を減算器
106にて減算し、その差分値123を求めておいてか
ら、量子化テーブルの選択を行なう構成になつている
が、減算器106及び量子化テーブル切換制御部107
の両方の機能を有するものをテーブルとして用意し、こ
のテーブルに発生符号量121、基準符号量120を入
力すると量子化テーブルの選択信号124が出力として
取り出せるようにしてもよい。
In order to reduce the absolute value of the difference value 123, when the difference value 123 increases, the quantization table is switched to a compression table with a high compression ratio (small code amount to be generated). When the size becomes smaller (larger in the minus direction), the quantization table may be switched to a quantization table with a lower compression ratio. As described above, in the fifth embodiment, the reference code amount 120 is subtracted from the generated code amount 121 by the subtractor 106 to obtain the difference value 123, and then the quantization table is selected. However, the subtractor 106 and the quantization table switching control unit 107
A table having both of these functions may be prepared as a table, and when a generated code amount 121 and a reference code amount 120 are input to this table, a quantization table selection signal 124 may be extracted as an output.

【0080】このように、符号化処理によつて発生した
符号量(発生符号量)と基準となる符号量(基準符号
量)とに基づいて圧縮率を制御すると、記憶部を有効に
使用することができるため、該記憶部の容量を従来より
少なくすることができ、コストの安い画像符号化装置、
ひいては、該画像符号化装置を内蔵したコストの安い画
像出力装置を実現できる。
As described above, when the compression rate is controlled based on the code amount (generated code amount) generated by the encoding process and the reference code amount (reference code amount), the storage unit is effectively used. Therefore, the capacity of the storage unit can be made smaller than before, and a low-cost image encoding device,
As a result, a low-cost image output device incorporating the image encoding device can be realized.

【0081】また、記憶部を有効に使用することができ
るよということを別の観点から見ると、限られた記憶容
量で再現可能な最高の画質に近い画像が保存できるとい
うことであり、該装置の高性能化にもつながる。以上説
明した様に第5の実施例によれば、符号化処理により発
生した符号量を計数して得られる発生符号量と、基準符
号量生成手段から得られる基準符号量に基づいて、圧縮
率の制御を行なうことにより、画像の情報に偏りがある
場合にも、記憶部を有効に使用することが出来る。この
ため、記憶部の容量を数十%減らすことができ、記憶部
のコストを大幅に下げることが出来る。
From another point of view that the storage unit can be used effectively, it is possible to store an image close to the highest reproducible image quality with a limited storage capacity. This also leads to higher performance of the device. As described above, according to the fifth embodiment, the compression rate is calculated based on the generated code amount obtained by counting the code amount generated by the encoding process and the reference code amount obtained from the reference code amount generation unit. By performing the above control, the storage unit can be used effectively even when the image information is biased. For this reason, the capacity of the storage unit can be reduced by several tens of percent, and the cost of the storage unit can be significantly reduced.

【0082】特に以上の符号化装置は圧縮した画像を格
納する記憶部を有する画像出力装置に好適であり、該画
像出力装置の低コスト化に寄与できる。 <第6の実施例>図14は、本発明に係る第6の実施例
における画像符号化装置の構成を示すブロツク図であ
る。図14において、上述した第5の実施例における図
12と同様構成には同一番号を付している。第6の実施
例では、第5の実施例と比し、画像出力装置が1度に出
力できる1ページの画像が、それぞれ性質の異なる複数
の小画像から成る場合に対応するものである。
In particular, the coding apparatus described above is suitable for an image output apparatus having a storage unit for storing a compressed image, and can contribute to cost reduction of the image output apparatus. <Sixth Embodiment> FIG. 14 is a block diagram showing a configuration of an image coding apparatus according to a sixth embodiment of the present invention. In FIG. 14, the same components as those in FIG. 12 in the fifth embodiment described above are denoted by the same reference numerals. The sixth embodiment is different from the fifth embodiment in that an image of one page which can be output at one time by the image output apparatus is composed of a plurality of small images having different properties.

【0083】符号化する順序は各々の小画像を1つずつ
順番に行なうものとする。本実施例では、第5の実施例
における量子化テーブル切換制御部107の替わりに、
量子化ステツプ幅の制御を行なうためのスケールフアク
タ切換制御部201を備え、該スケールフアクタ切換制
御部201から出力されるスケール値を、量子化テーブ
ル格納部108から出力される値に掛け合せるための乗
算器202を使用している。
The encoding order is such that each of the small images is performed one by one. In the present embodiment, instead of the quantization table switching control unit 107 in the fifth embodiment,
A scale factor switching control unit 201 for controlling the quantization step width is provided. The scale value output from the scale factor switching control unit 201 is multiplied by the value output from the quantization table storage unit 108. Is used.

【0084】又、第1の実施例において、画像の横サイ
ズ情報と縦サイズ情報を入力していた端子407,40
8には、各々複数画像の属性情報(画像サイズ情報を含
む)と複数画像の識別情報を入力することにする。1つ
の画像の中でも領域により情報の偏りがあることはすで
に述べたが、性質の異なる画像、例えばコンピユータグ
ラフィツクス等で生成した画像とスキヤナ等で読み込ん
だ画像の間でも、高域周波数成分に大きな差がある。よ
つて、それらの画像を同じ符号量の割り当てで符号化し
たのでは、高域周波数成分を多く持つ高画質な画像が大
きく劣化してしまうことになる。そこで、このような場
合、各画像の入力源や自己相関等のパラメータを用い
て、符号量の割り当てに重みを付ければ、圧縮による各
画像の劣化をバランスさせることができる。
Also, in the first embodiment, the terminals 407, 40 to which the horizontal size information and the vertical size information of the image are input.
In 8, attribute information (including image size information) and identification information of a plurality of images are input. Although it has already been described that there is information bias depending on the area in one image, even in an image having different properties, for example, an image generated by computer graphics or the like and an image read by a scanner or the like, a large frequency component is large. There is a difference. Therefore, if these images are coded with the same code amount allocation, a high quality image having many high frequency components will be greatly deteriorated. Therefore, in such a case, if the allocation of the code amount is weighted using parameters such as the input source and the autocorrelation of each image, the deterioration of each image due to compression can be balanced.

【0085】そこで、第6の実施例では、画像の符号化
に先立ち、複数の画像の各々の属性情報を入力端子40
7より入力し、符号量演算部409にて、各画像ごとに
所定の画像データ量に対する割り当て符号量を計算す
る。例えば、A,Bという2つの画像があり、各々のデ
ータ量がDa,Dbブロツクあり、割り当て符号量の重
みをWa,Wbとし、記憶部の容量をMビツトとする
と、画像Aに対して割り当てられる1ブロツク当たりの
符号量は、Wa・M/(Wa・Da+Wb・Db)ビツ
トとなり、画像Bに対して割り当てられる1ブロツク当
たりの符号量は、Wb・M/(Wa・Da+Wb・D
b)ビツトとなる。
Therefore, in the sixth embodiment, prior to image encoding, attribute information of each of a plurality of images is input to the input terminal 40.
7 and the code amount calculation unit 409 calculates the code amount allocated to a predetermined image data amount for each image. For example, if there are two images A and B, each data amount is Da and Db blocks, the weight of the allocated code amount is Wa and Wb, and the capacity of the storage unit is M bits, the image is allocated to image A. The code amount per block is Wa · M / (Wa · Da + Wb · Db) bits, and the code amount per block allocated to image B is Wb · M / (Wa · Da + Wb · D).
b) Bits.

【0086】そこで、前記2つの式の共通項であるF=
M/(Wa・Da+Wb・Db)をあらかじめ計算して
おいて、画像Aを符号化する際にはWa・Fを、画像B
を符号化する際には、Wb・Fを、符号量演算部409
より出力する。画像A,Bのどちらを符号化中であるか
を知るには、上述したインタフエース部501にて、画
像データの転送を管理し、どちらの画像が転送中である
のかを認識し、その情報を端子408に入力すればよ
い。
Then, the common term F =
M / (Wa · Da + Wb · Db) is calculated in advance, and when encoding the image A, Wa · F is calculated and the image B is calculated.
Is encoded, Wb · F is calculated by the code amount calculation unit 409
Output more. In order to know which of the images A and B is being encoded, the above-described interface unit 501 manages the transfer of image data, recognizes which image is being transferred, and obtains information on the image. May be input to the terminal 408.

【0087】符号量演算部409は、その情報をもと
に、各画像に対応した割り当て符号量を出力する。実際
には、画像データの転送と符号化タイミングの間には多
少の時間的なずれがあるので、そのずれはインタフエー
ス部501または符号量演算部501で吸収する必要が
ある。まず最初に、画像Aが転送され、それを符号化す
るものとする。符号量計数部103及びアキユムレータ
105は、リセツト信号(不図示)により初期値ゼロに
クリアされる。画像Aの転送、並びに符号化が始まる
と、符号量演算部409は、Wa・Fという割り当て符
号量をアキユムレータ105に出力する。1ブロツクを
符号化するごとに、端子104からパルスが入力され、
アキユムレータ105は、Wa・Fという値を累積加算
していく。
The code amount calculation section 409 outputs an assigned code amount corresponding to each image based on the information. Actually, there is a slight time lag between the transfer of the image data and the encoding timing, and the lag needs to be absorbed by the interface unit 501 or the code amount calculation unit 501. First, it is assumed that an image A is transferred and encoded. The code amount counter 103 and the accumulator 105 are cleared to an initial value of zero by a reset signal (not shown). When the transfer of the image A and the encoding start, the code amount calculation unit 409 outputs the allocated code amount of Wa · F to the accumulator 105. Each time one block is encoded, a pulse is input from terminal 104,
The accumulator 105 accumulates the value Wa · F.

【0088】一方、画像データは、第1の実施例と同
様、バツフア402にてブロツク化されDCT変換部4
03、量子化部404′、スキヤン変換部101を経
て、エントロピー符号化部102にて符号化される。エ
ントロピー符号化部102にて符号化された符号量が符
号量計数部103で計数される。ここで、第6の実施例
においては、上述した第5の実施例と異なり、量子化部
404′で用いられる量子化ステツプは、量子化テーブ
ル格納部108の出力にスケールフアクタ切換制御部2
01から出力されるスケール値を乗算器202にて乗算
して作られる。
On the other hand, similarly to the first embodiment, the image data is blocked by the buffer 402 and
03, through a quantization unit 404 ′ and a scan transformation unit 101, and is encoded by an entropy encoding unit 102. The code amount encoded by the entropy encoding unit 102 is counted by the code amount counting unit 103. Here, in the sixth embodiment, unlike the above-described fifth embodiment, the quantization step used in the quantization unit 404 'is different from the output of the quantization table storage unit 108 by the scale factor switching control unit 2.
It is created by multiplying the scale value output from 01 by the multiplier 202.

【0089】従つて、符号化開始直後においては、減算
器106の2つの入力はゼロであるためその出力も勿論
ゼロとなる。このため、結局スケールフアクタ切換制御
部201にはゼロが入力され、それに対応したスケール
値が乗算器202に入力される。そして、符号化が進む
につれて、アキユムレータ105出力の基準符号量12
0と、符号量計数部103の出力の発生符号量121と
の間に差が生じ、減算器106の出力にその差分値12
3が現われる。
Therefore, immediately after the start of the encoding, the two inputs of the subtractor 106 are zero, so that the outputs are of course zero. Therefore, zero is eventually input to the scale factor switching control unit 201, and the corresponding scale value is input to the multiplier 202. Then, as the encoding proceeds, the reference code amount 12 of the output of the accumulator 105 is increased.
0 and the generated code amount 121 output from the code amount counting unit 103, and the difference value 12 is output to the output of the subtractor 106.
3 appears.

【0090】第5の実施例と同様、本実施例において
も、差分値123の絶対値が小さくなるようにスケール
フアクタの制御が行なわれる。即ち、差分値123が大
きくなつたらスケール値を大きくして量子化ステツプを
粗くすることにより発生符号量を少なくし、逆に差分値
123が小さくなつたらスケール値を小さくして量子化
ステツプを細かくすることにより、発生情報量を増や
す。
As in the fifth embodiment, also in this embodiment, the scale factor is controlled so that the absolute value of the difference value 123 becomes smaller. That is, when the difference value 123 increases, the scale value is increased to coarsen the quantization step to reduce the amount of generated code, and conversely, when the difference value 123 decreases, the scale value is reduced to make the quantization step fine. By doing so, the amount of generated information is increased.

【0091】以上説明した動作内容で、画像Aの符号化
が行なわれ、該画像Aの符号化が終了すると、次は画像
Bが転送され符号化される。画像Bの符号化に先立ち、
符号量計数部103及びアキユムレータ105をリセツ
ト信号(不図示)により、ゼロクリアすると共に、符号
量演算部409にてWb・Fという割り当て符号量を演
算し、アキユムレータ105に出力する。以後、画像B
の符号化は、画像Aの符号化と同様に行なわれる。
With the operation described above, the image A is encoded. When the encoding of the image A is completed, the image B is transferred and encoded next. Prior to encoding image B,
The code amount counting unit 103 and the accumulator 105 are cleared to zero by a reset signal (not shown), and the code amount calculation unit 409 calculates the assigned code amount of Wb · F and outputs it to the accumulator 105. Hereafter, image B
Is performed in the same manner as the encoding of the image A.

【0092】このように、第6の実施例によれば、複数
の画像を符号化する場合においても、発生符号量と基準
符号量とに基づいて圧縮率を制御することにより、記憶
部を有効に使用することができるため、該記憶部の容量
を従来より少なくすることが出来る。なお、第6の実施
例では、スケールフアクタを制御することにより量子化
条件を変更する構成について示したが、本発明は以上の
レインい限定されるものでは無く、第5の実施例で述べ
たような、量子化テーブルを切り換える方法であつても
かまわないし、他の方法であつてもよい。
As described above, according to the sixth embodiment, even when encoding a plurality of images, the compression ratio is controlled on the basis of the generated code amount and the reference code amount, so that the storage unit can be effectively used. Therefore, the capacity of the storage unit can be made smaller than before. In the sixth embodiment, the configuration in which the quantization condition is changed by controlling the scale factor has been described. However, the present invention is not limited to the above, and is described in the fifth embodiment. Such a method of switching the quantization table may be used, or another method may be used.

【0093】以上の説明では、画像Aの符号化が終了し
て、画像Bの符号化を始める際に、符号量計数部103
及びアキユムレータ105をゼロにクリアしたが、この
クリアは無くてもよい。このクリアが無いと、画像Aの
符号化が終了した時点で、発生符号量が基準符号量より
小さかつた場合、その差の記憶容量を画像Bの符号化の
際に有効に活用できる。しかし、逆に発生符号量が基準
符号量より大きかつた場合、その分だけ画像Bを符号化
する際に使用できる記憶容量が減つてしまうことにな
る。
In the above description, when the coding of the image A is completed and the coding of the image B is started, the code amount counting section 103
And the accumulator 105 is cleared to zero, but this clearing may not be necessary. Without this clearing, if the generated code amount is smaller than the reference code amount at the time when the encoding of the image A is completed, the storage capacity of the difference can be effectively used when encoding the image B. However, if the generated code amount is larger than the reference code amount, on the other hand, the storage capacity that can be used when encoding the image B is reduced by that amount.

【0094】<第7の実施例>本発明に係る第7の実施
例における画像符号化装置のブロツク構成を図15に示
す。図15において、図12及び図14と同様構成には
同一番号を付して詳細説明を省略し、主に相違する点に
ついて説明する。第7の実施例においては、所定の画像
データ量に対する発生符号量がいつも基準符号量以内に
収まるよう圧縮率の制御を行なうものである(以下で
は、所定の画像データ量をKブロツクとして話を進め
る)。
<Seventh Embodiment> FIG. 15 shows a block configuration of an image coding apparatus according to a seventh embodiment of the present invention. 15, the same components as those in FIGS. 12 and 14 are denoted by the same reference numerals, detailed description thereof will be omitted, and different points will be mainly described. In the seventh embodiment, the compression rate is controlled so that the generated code amount for a predetermined image data amount always falls within the reference code amount (hereinafter, the predetermined image data amount will be referred to as K blocks). Proceed).

【0095】即ち、Kブロツクの画像データをある量子
化条件の元で符号化した際に発生した符号量が、基準符
号量をオーバーしてしまつた場合、量子化条件を発生符
号量が減る方向に変更して、再度、同じKブロツクの画
像データを符号化するわけである。2度目の符号化で発
生した発生符号量が基準符号量以下であれば、該Kブロ
ツクの画像データの符号化は終了して、次のKブロツク
の画像データの符号化を行なう。しかしながら2度目の
符号化で発生した発生符号量が基準符号量以下でなけれ
ば、さらに量子化条件を変更して、3度目の符号化を行
なう。以下、発生符号量が、基準符号量以下になるま
で、量子化条件を変更しながら繰り返し、符号化を行な
うわけである。
That is, if the code amount generated when the image data of the K block is coded under a certain quantization condition exceeds the reference code size, the quantization condition is changed to a direction in which the generated code size decreases. And the image data of the same K block is encoded again. If the generated code amount generated in the second encoding is equal to or less than the reference code amount, the encoding of the image data of the K block is completed, and the image data of the next K block is encoded. However, if the generated code amount generated in the second encoding is not less than or equal to the reference code amount, the quantization condition is further changed and the third encoding is performed. Hereinafter, until the generated code amount becomes equal to or smaller than the reference code amount, coding is repeatedly performed while changing the quantization condition.

【0096】第7の実施例において、以上説明した処理
を行なう場合、これまで説明した第5、第6の実施例の
ように、わざわざ符号量演算部409とアキユムレータ
105を用いて基準符号量を生成する必要が無く、記憶
部の容量、符号化する画像の全データ量、並びに該Kブ
ロツクのKの値から、基準符号量を演算することができ
る。
In the seventh embodiment, when the above-described processing is performed, the reference code amount is deliberately calculated by using the code amount calculation unit 409 and the accumulator 105 as in the fifth and sixth embodiments described above. There is no need to generate the reference code amount, and the reference code amount can be calculated from the capacity of the storage unit, the total data amount of the image to be encoded, and the K value of the K block.

【0097】そこで図15に示す第7の実施例では、基
準符号量演算部301にて基準符号量を演算して出力す
る(信号線120は基準符号量となる)。該基準符号量
の演算に必要な情報は端子302より入力する。また、
第7の実施例では、基準符号量と発生符号量との差分値
は必要ではなく、それらの値の大小関係が解ればよい。
このため、比較器303にてその関係を判定する。その
他の構成は、基本的に第6の実施例と同じである。但
し、制御方法が多少異なるブロツクがいくつか存在する
が、以下の動作説明でその都度説明することにする。
In the seventh embodiment shown in FIG. 15, the reference code amount calculation section 301 calculates and outputs the reference code amount (the signal line 120 has the reference code amount). Information necessary for calculating the reference code amount is input from a terminal 302. Also,
In the seventh embodiment, a difference value between the reference code amount and the generated code amount is not necessary, and the magnitude relationship between these values may be understood.
Therefore, the comparator 303 determines the relationship. Other configurations are basically the same as those of the sixth embodiment. However, there are some blocks whose control methods are slightly different, and will be described each time in the following operation description.

【0098】以下、図15の構成を備える第7の実施例
の動作を説明する。まず、最初にこれから符号化する画
像の全データ量等、Kブロツクに対する基準符号量を演
算するのに必要な情報が、端子302を通して基準符号
量演算部301に入力される。そして、該基準符号量演
算部301にて、基準符号量が演算され、その結果が信
号線120に出力される。一方、画像データは、第5、
第6の実施例と同様にバツフア402にてブロツク化さ
れ、DCT変換部403、量子化部404′、スキヤン
変換部101を経てエントロピー符号化部102にて符
号化される。
The operation of the seventh embodiment having the configuration shown in FIG. 15 will be described below. First, information necessary for calculating the reference code amount for the K block, such as the total data amount of an image to be encoded, is input to the reference code amount calculation unit 301 through the terminal 302. Then, the reference code amount calculation section 301 calculates the reference code amount, and outputs the result to the signal line 120. On the other hand, the image data is the fifth,
Similarly to the sixth embodiment, the data is blocked by the buffer 402, and is coded by the entropy coding unit 102 through the DCT transform unit 403, the quantization unit 404 ', and the scan transform unit 101.

【0099】そして、エントロピー符号化部102にて
符号化された符号量が符号量計数部103で計数され
る。該符号量計数部103は、符号化処理に先立ち、勿
論初期値としてゼロにクリアされている。またこの時、
スケールフアクタ制御部201も初期状態にリセツトさ
れており、初期状態に対応したスケール値を出力してい
る。そして、乗算器202は、量子化テーブル格納部1
08の出力にそのスケール値を乗算し、結果を量子化部
404′に送る。
Then, the code amount encoded by the entropy encoding unit 102 is counted by the code amount counting unit 103. Prior to the encoding process, the code amount counting unit 103 is cleared to zero as an initial value. At this time,
The scale factor control section 201 is also reset to the initial state, and outputs a scale value corresponding to the initial state. Then, the multiplier 202 includes the quantization table storage 1
08 is multiplied by the scale value, and the result is sent to the quantization unit 404 '.

【0100】Kブロツクの画像データの符号化が済んだ
ところで、符号量計数部103から出力される発生符号
量121と基準符号量120を比較器303にて比較
し、どちらの値が大きいか判定する。もし、発生符号量
121が基準符号量120以下であれば、該Kブロツク
の画像データの符号化を終了し、次のKブロツクの画像
データの符号化を開始する。
When the image data of the K block is encoded, the generated code amount 121 output from the code amount counting unit 103 and the reference code amount 120 are compared by the comparator 303 to determine which value is larger. I do. If the generated code amount 121 is equal to or smaller than the reference code amount 120, the coding of the image data of the K block is terminated, and the coding of the image data of the next K block is started.

【0101】逆に発生符号量121が基準符号量120
より大きい時は、その情報をスケールフアクタ切換制御
部201に送り、再度該Kブロツクの画像データをバツ
フア402より読み出し、符号化を行なう。そこでバツ
フア402は、一度読み出された画像データが再度読み
出されても大丈夫なように、しばらく該画像データを保
持するといつた制御が必要になる。スケールフアクタ切
換制御部201では、受けとつた情報から、以前出力し
ていたスケール値よりも大きなスケール値を出力し、そ
れにより、発生符号量を以前より少なくする。
On the contrary, the generated code amount 121 is equal to the reference code amount 120.
If it is larger, the information is sent to the scale factor switching control unit 201, and the image data of the K block is read out again from the buffer 402 and encoded. Therefore, the buffer 402 needs to be controlled when the image data once held is held for a while so that it is safe to read the image data once. The scale factor switching control unit 201 outputs a scale value larger than the previously output scale value based on the received information, thereby reducing the amount of generated codes.

【0102】こうして、再度Kブロツクの画像データを
符号化し、発生した符号化データはパツキング処理部4
05を経由して、記憶部503に格納する。第7の実施
例においては、この格納の際に、第5、第6の実施例と
は異なる制御が必要となる。即ち、同一の画像データを
2度、3度と符号化して、発生した符号化データをシー
ケンシヤルに記憶部503へ格納していつたのでは、記
憶部503に不要なデータが格納され、記憶容量が一杯
になつてしまう。
Thus, the image data of the K block is encoded again, and the generated encoded data is
05, and is stored in the storage unit 503. In the seventh embodiment, at the time of this storage, control different from that in the fifth and sixth embodiments is required. That is, if the same image data is encoded twice and three times, and the generated encoded data is sequentially stored in the storage unit 503, unnecessary data is stored in the storage unit 503, and the storage capacity is full. It will be.

【0103】そこで、同一の画像データを複数回符号化
した際には、2度目以降の符号化データは、1度目の符
号化データの格納場所へ上書きすることで、不要なデー
タが残らないように制御する必要がある。このため、第
7の実施例においては、符号化され格納されたデータ量
(発生符号量)が、基準符号量より大きい場合、再度ス
ケール値を大きくして、再符号化を行ない、発生符号量
が、基準符号量以下になるまで繰り返す。
Therefore, when the same image data is encoded a plurality of times, the second and subsequent encoded data are overwritten on the storage location of the first encoded data so that unnecessary data does not remain. Need to be controlled. For this reason, in the seventh embodiment, when the encoded and stored data amount (generated code amount) is larger than the reference code amount, the scale value is increased again, and re-encoding is performed. Is repeated until it becomes equal to or less than the reference code amount.

【0104】なお、第7の実施例において、Kブロツク
のKの値は任意であるが、K=1の場合というのは従来
例にて発生した問題と同様のことが、また問題になる。
よつて、該問題を改善するには、K>1である必要があ
る。 <第8の実施例>図16に本発明に係る第8の実施例に
おける画像符号化装置のブロツク構成を示す。第8の本
実施例においては、符号量計数手段として、記憶部50
3を構成する1ユニツトであるアドレス発生器を用いた
場合の構成例である。
In the seventh embodiment, the value of K in the K block is arbitrary. However, the case where K = 1 is the same as the problem that occurred in the conventional example.
Therefore, in order to improve the problem, it is necessary that K> 1. <Eighth Embodiment> FIG. 16 shows a block configuration of an image coding apparatus according to an eighth embodiment of the present invention. In the eighth embodiment, the storage unit 50 serves as a code amount counting unit.
3 is a configuration example in the case of using an address generator, which is one unit constituting 3.

【0105】従つて、これまで述べた第5〜第7の実施
例では、符号量計数手段として、記憶部をまつたく含ま
ない、符号化処理部のみのブロツク図として説明してき
たが、本実施例においては、該記憶部503を含むブロ
ツク図で説明する。該記憶部503は、図16におい
て、破線で囲まれた領域に対応し、符号化データを格納
するメモリ601、メモリ601にアドレス信号を送る
アドレス発生器602、アドレス発生器602の制御、
及びメモリ601の制御信号を生成するメモリ制御部6
03より構成される。
Therefore, in the fifth to seventh embodiments described so far, the code amount counting means has been described as a block diagram of only the coding processing unit which does not include a storage unit, but this embodiment. In the example, a block diagram including the storage unit 503 will be described. The storage unit 503 corresponds to a region surrounded by a broken line in FIG. 16, and stores a memory 601 for storing encoded data, an address generator 602 for sending an address signal to the memory 601, a control of the address generator 602,
And a memory control unit 6 for generating a control signal for the memory 601
03.

【0106】端子604は、データを伸張する際に、メ
モリ601から読み出した符号化データを出力する端子
である。すでに述べたように、符号量計数手段としてア
ドレス発生器を用いるため、第8の実施例では、上述し
た図12、図14及び図17に示すような符号量のみを
専用に計数する符号量計数部103が不要となる。その
他の構成ユニツトは、図12に示す第5の実施例と同様
であるため、同一番号を付し、詳細説明を省略する。ま
た、符号化装置全体の動作内容も、第1の実施例とまつ
たく同じであるため、説明を省略し、以下では、アドレ
ス発生器602に関してさらに詳しく説明する。
A terminal 604 is a terminal for outputting encoded data read from the memory 601 when data is expanded. As described above, since the address generator is used as the code amount counting means, in the eighth embodiment, the code amount counting device exclusively counts only the code amount as shown in FIGS. 12, 14 and 17 described above. The unit 103 becomes unnecessary. The other components are the same as those of the fifth embodiment shown in FIG. 12, and therefore, are denoted by the same reference numerals and detailed description thereof will be omitted. Further, the operation content of the entire encoding apparatus is exactly the same as that of the first embodiment, and therefore the description is omitted, and the address generator 602 will be described in more detail below.

【0107】第8の実施例の如く、符号量計数手段とし
て、アドレス発生器602が使用可能な理由は、該アド
レス発生器602から出力されるアドレス情報が、メモ
リの使用量、即ち、符号化データの発生量を表すことが
できるからである。実際に、アドレス情報が符号化デー
タの発生量を表すには、該アドレス値は、ゼロからスタ
ートして、1つずつアドレスが増加するという動作が前
提になり、第8の実施例も、この動作を前提としてい
る。
As in the eighth embodiment, the reason why the address generator 602 can be used as the code amount counting means is that the address information output from the address generator 602 is the memory usage amount, that is, the coding amount. This is because the amount of generated data can be represented. Actually, in order for the address information to represent the amount of encoded data generated, it is premised that the address value starts from zero and the address is increased one by one. Operation is assumed.

【0108】ところで、本実施例のアドレス値の発生順
序は上述の順序以外にもいろいろある。例えば、アドレ
ス値を大きい方から順に発生させることもできる。この
ような場合には、該アドレス値を反転した値が符号化デ
ータの発生量を表わすので、該反転値を符号量計数手段
の出力とすればよい。また、メモリの0番地から、L−
1番地までが、他の情報を格納する領域として確保され
ていて、L番地以降から順に符号化データを格納する場
合には該アドレス値からLを減算した値を符号量計数手
段の出力とすればよい。
The order in which the address values are generated in this embodiment is not limited to the order described above, but may be various. For example, the address values can be generated in order from the larger one. In such a case, since the value obtained by inverting the address value indicates the amount of encoded data generated, the inverted value may be used as the output of the code amount counting means. Also, from address 0 of the memory, L-
Up to address 1 is reserved as an area for storing other information, and when coded data is stored sequentially from address L onward, a value obtained by subtracting L from the address value is used as the output of the code amount counting means. I just need.

【0109】以上説明したように、上述の各実施例によ
れば、符号化処理により発生した符号量を計数して得ら
れる発生符号量と、基準符号量生成手段から得られる基
準符号量に基づいて、圧縮率の制御を行なうことによ
り、画像の情報に偏りがある場合にも、記憶部を有効に
使用することが出来る。よつて、記憶部の容量を数十%
減らすことができ、記憶部のコストを大幅に下げること
が出来る。
As described above, according to each of the above-described embodiments, the code amount generated by counting the code amount generated by the encoding process and the reference code amount obtained from the reference code amount generation means are determined. By controlling the compression ratio, the storage unit can be used effectively even when the image information is biased. Therefore, the capacity of the storage unit is
Thus, the cost of the storage unit can be significantly reduced.

【0110】また、圧縮した画像を格納する記憶部を有
する画像出力装置に好適であり、該画像出力装置の低コ
スト化に寄与できる。 <第9の実施例>図17は本発明に係る第9の実施例に
おける画像符号化装置の構成を示すブロツク図である。
同図において、上述した第5実施例〜第8実施例の図1
2〜図16と同様構成には同一番号を付し詳細説明を省
略する。
The present invention is suitable for an image output device having a storage unit for storing a compressed image, and can contribute to cost reduction of the image output device. <Ninth Embodiment> FIG. 17 is a block diagram showing a configuration of an image coding apparatus according to a ninth embodiment of the present invention.
In the same figure, FIG. 1 of the fifth to eighth embodiments described above.
2 to FIG. 16 are denoted by the same reference numerals, and detailed description thereof will be omitted.

【0111】第9の実施例では、特有のユニツトとし
て、符号量計数部103にて計数した発生符号量を記憶
部の容量で割り算する第1の除算器154、符号化する
1画素もしくは1ブロツクの画像データごとに1つのパ
ルスが入力されるパルス入力端子155、該入力端子1
55よりのパルスをカウントして符号化した画像データ
量を計数する画像データ計数部156、符号化する全画
像のデータ量を入力する入力端子157、画像データ計
数部156の出力を全画像データ量で割り算する第2の
除算器158、第1の除算器154の出力から第2の除
算器158の出力を減算する減算器159、該減算器1
59の出力結果に基づく、複数の量子化テーブルの切り
換えを制御する量子化テーブル切換制御部160を備え
ている。
In the ninth embodiment, as a unique unit, a first divider 154 for dividing the generated code amount counted by the code amount counting unit 103 by the capacity of the storage unit, one pixel or one block for encoding. Input terminal 155 to which one pulse is input for each image data of
55, an image data counting unit 156 for counting the amount of encoded image data by counting pulses, an input terminal 157 for inputting the data amount of all images to be encoded, and an output of the image data counting unit 156 for the total image data amount. A second divider 158 that divides the output of the first divider 154 by a subtracter 159 that subtracts the output of the second divider 158 from the output of the first divider 154.
A quantization table switching control unit 160 that controls switching of a plurality of quantization tables based on the output result of 59 is provided.

【0112】第9の実施例においても、画像出力装置の
全体構成は上述した第5実施例〜第7実施例と同様で良
い。以下、以上の構成を備える第9の実施例の動作説明
を行なう。コンピユータ等の外部装置(不図示)から送
られてきたデータは、上述実施例と同様、インターフエ
ース部501において画像のヘツダ情報と実際の画像デ
ータとに分けられ、ヘツダ情報中の画像のサイズ情報は
全画像データ量を示す数値に変換された後、入力端子1
57に入力されると共に、画像データは入力端子401
に入力される。
Also in the ninth embodiment, the overall configuration of the image output apparatus may be the same as in the above-described fifth to seventh embodiments. The operation of the ninth embodiment having the above configuration will be described below. Data sent from an external device (not shown) such as a computer is divided into header information of an image and actual image data in the interface unit 501, as in the above-described embodiment, and the size information of the image in the header information is obtained. Is input terminal 1 after being converted into a numerical value indicating the total image data amount.
57, and the image data is input to an input terminal 401.
Is input to

【0113】入力端子401に入力された画像データ
は、上述実施例と同様バツフア402、DCT変換部4
03、量子化部404′、スキャン変換部101を経て
エントロピー符号化部102にて符号化される。符号化
されたビツト単位のデータは、パツキング処理部にてバ
イト単位もしくはワード単位のデータにパツキングさ
れ、端子406′に出力された後、記憶部503に格納
される。
The image data input to the input terminal 401 is supplied to the buffer 402 and the DCT converter 4 in the same manner as in the above embodiment.
03, a quantization unit 404 ′, and a scan conversion unit 101, and are encoded by an entropy encoding unit 102. The encoded bit-unit data is packed into byte-unit or word-unit data by the packing unit, output to the terminal 406 ', and stored in the storage unit 503.

【0114】この時、バツフア402から画像データが
読み出されるたびに入力端子155にパルスが入力さ
れ、画像データ計数部156に送られる。該画像データ
計数部156は、画像データの符号化に先立ち、リセツ
ト信号(不図示)によりゼロにクリアされ、その後に入
力されるパルスをカウントする。カウントされた値は第
2の除算器158に送られ、入力端子157から入力さ
れた画像サイズ情報で除算される。
At this time, each time image data is read from the buffer 402, a pulse is input to the input terminal 155 and sent to the image data counting unit 156. The image data counting unit 156 counts pulses that are cleared to zero by a reset signal (not shown) before the image data is encoded, and that are subsequently input. The counted value is sent to the second divider 158, where it is divided by the image size information input from the input terminal 157.

【0115】その結果、第2の除算器158からは全画
像データ量に対する符号化済み画像データ量(符号化中
の画像データも含む)の割合が出力される。符号量計数
部103は、上述した様に画像の符号化に先立ち、ゼロ
にクリアされ、エントロピー符号化部102から受けと
つた符号量を順次加算してゆき、結果を出力する。第9
の実施例では、符号量計数部103よりの出力値は第1
の除算器154にて、符号化データを格納する記憶部5
03の容量で割り算され、該記憶部の使用割合が求めら
れ、出力される。
As a result, the ratio of the encoded image data amount (including the image data being encoded) to the total image data amount is output from the second divider 158. As described above, the code amount counting unit 103 sequentially adds the code amounts that have been cleared to zero and received from the entropy coding unit 102 before encoding the image, and outputs the result. Ninth
In the embodiment, the output value from the code amount counting unit 103 is the first value.
Storage unit 5 for storing encoded data in divider 154
03, and the usage ratio of the storage unit is obtained and output.

【0116】ここで、第1の除算器154から出力され
る記憶部の使用割合は、前記第2の除算器158から出
力される符号化済み画像データ量の割合(以下、前者を
第1の割合、後者を第2の割合と呼ぶ)に近い値をとる
ことが望ましい。すなわち、第1の割合が第2の割合よ
りあまりにも大きいと、全画像データの符号化が完了す
る以前に、記憶部503の空き領域が無くなつてしま
い、全画像データを保存することが出来なくなつてしま
う。
Here, the use ratio of the storage unit output from the first divider 154 is determined by the ratio of the encoded image data amount output from the second divider 158 (hereinafter, the former is referred to as the first ratio). Ratio, the latter is referred to as a second ratio). That is, if the first ratio is too large than the second ratio, the free space in the storage unit 503 is exhausted before the encoding of all the image data is completed, and the entire image data can be saved. It will be gone.

【0117】また、第1の割合が第2の割合よりあまり
にも小さいと、記憶部503を有効に使つていないこと
になり、本来、低い圧縮率で画像の劣化を低く抑えるこ
とが可能であるにもかかわらず低く押さえていないこと
になる。この点を解決するため、第9の実施例では減算
器159にて、前記第1の割合から第2の割合を減算し
て差分値170を求め、差分値170の絶対値が小さく
なるように制御を行なう。
If the first ratio is much smaller than the second ratio, the storage unit 503 is not effectively used, and the deterioration of the image can be suppressed at a low compression ratio. Despite the fact, it is not kept low. In order to solve this point, in the ninth embodiment, the subtractor 159 subtracts the second ratio from the first ratio to obtain a difference value 170, and the difference value 170 is set so that the absolute value of the difference value 170 becomes smaller. Perform control.

【0118】このため、量子化テーブル切換制御部16
0では、差分値170を受けとり、それを複数の閾値と
比較し、それらの閾値との大小関係によつて、複数の量
子化テーブルの内の1つを選択する選択信号124を量
子化テーブル格納部108へ出力することになる。以後
の動作は上述実施例と同様である。なお、上述実施例で
も同様であるが、復号化時に使用する量子化テーブル
は、符号化時に使用した量子化テーブルと同一のもので
なければならない。よつて符号化時に量子化テーブルを
切り換えた場合、復号化時にもまつたく同じタイミング
で量子化テーブルを切り換える必要がある。
For this reason, the quantization table switching control unit 16
In the case of 0, the difference value 170 is received, it is compared with a plurality of threshold values, and the selection signal 124 for selecting one of the plurality of quantization tables is stored in the quantization table according to the magnitude relation with the threshold values. Output to the unit 108. Subsequent operations are the same as in the above embodiment. Although the same applies to the above-described embodiment, the quantization table used at the time of decoding must be the same as the quantization table used at the time of encoding. Therefore, when the quantization table is switched during encoding, it is necessary to switch the quantization table at the same timing during decoding.

【0119】そこで、前記量子化テーブル切換制御部1
60にて量子化テーブルの切換えがなされた場合、その
切換え情報を信号線173を通してエントロピー符号化
部120へ送り、該切換え情報を符号化し、圧縮符号化
された画像データと共に記憶部に保存する。以上説明し
た制御方法で、全画像データを圧縮符号化すると、第2
の除算器158から出力される第2の割合(符号化済み
画像データの割合)は、最終的に“1”という値にな
る。それに対して、第1の除算器154から出力される
第1の割合(記憶部の使用割合)は、最終的に“1”と
いう値の近傍に落ち付くことになる。“1”の近傍とい
うことは“1”を越える場合があることを意味し、該第
1の割合が“1”を越えることは、記憶部を全部使いき
つてしまつて容量が足りなくなることを意味する。
Therefore, the quantization table switching control unit 1
When the quantization table is switched at 60, the switching information is sent to the entropy encoding unit 120 via the signal line 173, the switching information is encoded, and stored in the storage unit together with the compression-encoded image data. When all the image data are compression-encoded by the control method described above, the second
The second ratio (the ratio of the encoded image data) output from the divider 158 of (1) finally has a value of “1”. On the other hand, the first ratio (the usage ratio of the storage unit) output from the first divider 154 eventually falls near the value of “1”. Being close to "1" means that the value may exceed "1". When the first ratio exceeds "1", it means that the storage capacity is exhausted and the capacity becomes insufficient. means.

【0120】よつて、前記第1の割合が最終的に“1”
を越さないよう、符号化の後半の方では減算器159出
力の差分値が0以下になるよう量子化テーブル切換え制
御部160の制御方法を変えていく。そのためには、符
号化がどこまで済んだかを該量子化テーブル切換制御部
160で知る必要があるので、信号線174にて第2の
除算器158からの符号化済み画像データの割合を、量
子化テーブル切換制御部160に送る。
Therefore, the first ratio finally becomes "1".
In the latter half of the encoding, the control method of the quantization table switching control unit 160 is changed so that the difference value of the output of the subtracter 159 becomes 0 or less in the latter half of the encoding. To do so, it is necessary for the quantization table switching control unit 160 to know how far the encoding has been completed. Therefore, the signal line 174 calculates the ratio of the encoded image data from the second divider 158 by quantization. It is sent to table switching control section 160.

【0121】以上説明した様に第9の実施例によれば、
符号化データを格納する記憶部の容量に対する発生符号
量割合と、全画像データ量に対する符号化済み画像デー
タ量の割合に基づいて圧縮率を制御することにより、記
憶部を有効に使用することができ、該記憶部の容量を数
十%減らしても、十分に動作させることができ、記憶部
のコストを大幅に下げることができる。
As described above, according to the ninth embodiment,
By controlling the compression ratio based on the ratio of the generated code amount to the capacity of the storage unit that stores the encoded data and the ratio of the encoded image data amount to the total image data amount, the storage unit can be used effectively. Even if the capacity of the storage unit is reduced by several tens of percent, the storage unit can be sufficiently operated and the cost of the storage unit can be significantly reduced.

【0122】<第10の実施例>図18は本発明に係る
第10の実施例における画像符号化装置の構成を示すブ
ロツク図である。第10の実施例は、全画像データ量に
対する符号化済み画像データ量の割合を第9の実施例と
は異なる構成で求めるものである。又、第9の実施例に
おいて、除算器154から出力される記憶部の使用割合
が最終的に“1”を越さないように信号線174を付加
し、量子化テーブル切換制御部160に、符号化済み画
像データの割合を知らせていたが、該信号線174を使
用しなくても記憶部が途中で足りなくなるようなことが
ないような構成とした。よつて、第10の実施例では前
記信号線174が不要になつた点、及び全画像データ量
に対する符号化済み画像データ量を求める方法が異なる
以外は、第9の実施例とまつたく同じであり、同一ユニ
ツトには同一部番を付し説明を省略する。
<Tenth Embodiment> FIG. 18 is a block diagram showing a configuration of an image coding apparatus according to a tenth embodiment of the present invention. In the tenth embodiment, the ratio of the encoded image data amount to the total image data amount is obtained by a configuration different from that of the ninth embodiment. In the ninth embodiment, a signal line 174 is added so that the use ratio of the storage unit output from the divider 154 does not finally exceed “1”. Although the ratio of the encoded image data has been notified, the configuration is such that the storage unit does not run short even if the signal line 174 is not used. Therefore, the tenth embodiment is exactly the same as the ninth embodiment except that the signal line 174 is unnecessary and the method of obtaining the encoded image data amount with respect to the total image data amount is different. In this case, the same unit is given the same part number and the description is omitted.

【0123】以下、第10の実施例に固有の構成ユニツ
トについて説明する。図18において、161は入力端
子157から入力された画像データ量の逆数を演算する
逆数器、105は入力端子104からパルスが入力され
る度に逆数器161の出力値を累積して加算する図12
に示す第5実施例と同様のアキユムレータ、163はア
キユムレータ105から出力される値に所定の値を乗算
する乗算器である。
The following is a description of a structural unit unique to the tenth embodiment. In FIG. 18, reference numeral 161 denotes a reciprocal device for calculating the reciprocal of the amount of image data input from the input terminal 157, and 105 denotes a diagram for accumulating and adding the output values of the reciprocal device 161 every time a pulse is input from the input terminal 104. 12
163 is a multiplier for multiplying the value output from the accumulator 105 by a predetermined value.

【0124】次に、以上の構成を備える第10実施例の
動作説明を行なう。コンピユータ等の外部装置から送ら
れてきたデータは、インターフエース部501にて画像
のヘツダ情報と画像データとに分けられ、該画像データ
については、第9の実施例と同様に、バツフア402、
DCT変換部403、量子化部404′、スキャン変換
部101を経てエントロピー符号化部102にて符号化
される。符号化されたビツト単位のデータは、パツキン
グ処理部405にてバイト単位もしくはワード単位のデ
ータにパツキングされ、端子406に出力された後、記
憶部503に格納される。符号化部で発生した符号量
は、すべて符号量計数部103にて計数された後、除算
器154にて記憶部の容量で割り算され、記憶部をどれ
だけ使用したかを示す数値(記憶部使用割合)が出力さ
れる。
Next, the operation of the tenth embodiment having the above configuration will be described. Data sent from an external device such as a computer is divided into header information and image data of an image by an interface unit 501, and the image data is transmitted to a buffer 402, as in the ninth embodiment.
The data is encoded by the entropy encoding unit 102 via the DCT transform unit 403, the quantization unit 404 ', and the scan transform unit 101. The encoded bit-unit data is packed into byte-unit or word-unit data by the packing unit 405, output to the terminal 406, and stored in the storage unit 503. The code amount generated by the encoding unit is all counted by the code amount counting unit 103, and then divided by the capacity of the storage unit by the divider 154, and a numerical value indicating how much the storage unit is used (the storage unit) Is output.

【0125】一方、画像のヘツダ情報に含まれる画像サ
イズ情報は符号化する画像の全データ量を示す数値に変
換された後、入力端子157に入力される。入力端子1
57に入力された数値は、逆数器161にて、該数値の
逆数に変換され、全画像データに対する1画素の割合が
求められる。この数値はアキユムレータ162に入力さ
れ、符号化する画像データの1画素ごとに入力されるパ
ルス(入力端子156より入力される)によつて累積加
算される。
On the other hand, the image size information included in the header information of the image is converted into a numerical value indicating the total data amount of the image to be coded, and then input to the input terminal 157. Input terminal 1
The numerical value input to 57 is converted to the reciprocal of the numerical value by the reciprocal unit 161 and the ratio of one pixel to all image data is obtained. This numerical value is input to the accumulator 162, and is cumulatively added by a pulse (input from the input terminal 156) input for each pixel of the image data to be encoded.

【0126】アキユムレータ162の出力値は、全画像
データに対する符号化済み画像データの割合であり、全
画像データを符号化した後は勿論“1”という値にな
る。第9の実施例では、該符号化済みデータの割合なる
数値を直接、減算器159に入力していたので、除算器
154の出力値(記憶部の使用割合を表わす)が、
“1”を越さないような制御が必要であつた。
The output value of the accumulator 162 is the ratio of the coded image data to all the image data, and of course becomes "1" after all the image data is coded. In the ninth embodiment, since the numerical value indicating the ratio of the encoded data is directly input to the subtractor 159, the output value of the divider 154 (representing the use ratio of the storage unit) is
Control that does not exceed "1" was required.

【0127】本実施例では、アキユムレータ162と減
算器159の間に乗算器163を配し、該乗算器163
にて“1”より小さな値αを乗ずることにより、除算器
154の出力値が“1”を越えないようにする。第9の
実施例の動作説明で述べた様に、乗算器163の最終出
力がαであれば、除算器154からの最終出力はαの近
傍になることが分かる。よつて、該[αの近傍]の最大
値が1以下になるようにαを設定すれば、符号化済み画
像データの割合に応じて量子化テーブル切換の制御方法
を変える必要がなくなる。
In this embodiment, a multiplier 163 is provided between the accumulator 162 and the subtractor 159, and the multiplier 163
Is multiplied by a value α smaller than “1” so that the output value of the divider 154 does not exceed “1”. As described in the description of the operation of the ninth embodiment, if the final output of the multiplier 163 is α, it can be seen that the final output from the divider 154 is near α. Therefore, if α is set such that the maximum value of [near α] is 1 or less, it is not necessary to change the control method for switching the quantization table in accordance with the ratio of the encoded image data.

【0128】以上、説明した動作に基づいて、画像デー
タの符号化を行えば、記憶部を有効に使用した圧縮が可
能となり、全画像データを確実に符号化できる。なお、
本実施例において、乗算器163は、アキユムレータ1
62と減算器159の間に配したが、アキユムレータ2
62と逆数器161の間に配してもよい。その際、逆数
器161及び乗算器163における演算は、1つの画像
に対して各々1回の演算で済むため、演算スピードは遅
くてもよい。よつて、それらの演算は専用回路で行なう
必要がなく、他の制御に使用されている不図示のCPU
等を用いて演算してもよい。また、除算器154は、記
憶部の容量が2のべき乗の場合、単なるビツトシフト回
路に置き替えることが出来る。
If the image data is encoded based on the operation described above, the compression can be effectively performed using the storage unit, and the entire image data can be encoded reliably. In addition,
In the present embodiment, the multiplier 163 is the accumulator 1
62 and the subtractor 159, but the accumulator 2
62 and the reciprocal unit 161. At this time, the operation in the reciprocal unit 161 and the multiplier 163 only needs to be performed once for one image, and thus the operation speed may be slow. Therefore, these calculations do not need to be performed by a dedicated circuit, and a CPU (not shown) used for other control.
Or the like may be used. When the capacity of the storage unit is a power of 2, the divider 154 can be replaced with a simple bit shift circuit.

【0129】尚、本発明は、複数の機器から構成される
システムに適用しても、1つの機器から成る装置に適用
しても良い。また、本発明はシステム或は装置にプログ
ラムを供給することによつて達成される場合にも適用で
きることは言うまでもない。
Note that the present invention may be applied to a system composed of a plurality of devices or to an apparatus composed of a single device. It is needless to say that the present invention can be applied to a case where the present invention is achieved by supplying a program to a system or an apparatus.

【0130】以上、説明したように、上記各実施形態に
よれば、画像情報を格納するメモリを保有するプリンタ
において、累積符号量と累積符号化領域の情報により、
逐次、符号量を制御することにより、1回のパスで画像
の可変長符号を一定のメモリ内に符号量を制御すること
ができる。
As described above, in each of the above embodiments,
According to a printer having a memory for storing image information, the accumulated code amount and the information of the accumulated coding area
By sequentially controlling the code amount, the variable-length code of the image can be controlled in a fixed memory in a single pass.

【0131】その結果、ホストコンピユータからの画像
情報の転送時間が少なくて済むし、可変長符号化を用い
ているため、画像情報の偏りに合つた良好な圧縮処理が
実現できる。その結果、大容量を必要とするプリンタ、
特に、カラープリンタにおいても少量の所有メモリで製
品化を実現できる。
As a result, the transfer time of the image information from the host computer can be reduced, and since the variable length coding is used, a good compression process suitable for the bias of the image information can be realized. As a result, printers that require large capacity,
In particular, a color printer can be commercialized with a small amount of owned memory.

【0132】また、量子化マトリクスの切り換えに用い
る閾値を画像の位置における符号化情報量に応じて適応
的に切り換え、画像全体での量子化幅を段階的に変化さ
せることができ、また、符号後の符号量を目標の値に固
定することができる。更に、符号化処理により発生した
符号量を計数して得られる発生符号量と、基準符号量生
成手段から得られる基準符号量に基づいて、圧縮率の制
御を行なうことにより、画像の情報に偏りがある場合に
も、記憶部を有効に使用することが出来る。よって、記
憶部の容量を数十%減らすことができ、記憶部のコスト
を大幅に下げることが出来る。また、圧縮した画像を格
納する記憶部を有する画像出力装置に好適であり、該画
像出力装置の低コスト化に寄与できる。
Further, the threshold value used for switching the quantization matrix is adaptively switched according to the amount of coded information at the position of the image, so that the quantization width of the entire image can be changed stepwise. The subsequent code amount can be fixed to a target value. Further, by controlling the compression ratio based on the generated code amount obtained by counting the code amount generated by the encoding process and the reference code amount obtained from the reference code amount generation means, the bias of the image information is improved. When there is, the storage unit can be used effectively. Therefore, the capacity of the storage unit can be reduced by several tens of percent, and the cost of the storage unit can be significantly reduced. Further, the present invention is suitable for an image output device having a storage unit for storing a compressed image, and can contribute to cost reduction of the image output device.

【発明の効果】以上説明したように、本発明によれば、
画像をブロック単位で量子化、可変長符号化することに
より、一定とは限らない符号量の符号化データを発生す
る様な場合において、符号化済みブロックまでの累積符
号量に基づいて、量子化マトリクスを複数から選択使用
することにより符号量を適切に抑えることができ、特
に、その選択基準に使用される閾値(TH2)を、符号
化中の近隣の符号化増加率(ブロック・ライン分の符号
量の差D)に応じて、適切に切り換える様にしたので、
その量子化マトリクスの選択方法を適切な単位で効率良
く決定できる。
As described above, according to the present invention,
Quantizing and variable-length coding of images in block units
Generates encoded data with a code amount that is not necessarily constant.
The accumulated code up to the coded block
Select and use multiple quantization matrices based on signal volume
By doing so, the code amount can be suppressed appropriately,
And the threshold (TH2) used for the selection criterion is
Rate of coding increase of neighboring
Since the switching is appropriately performed according to the difference D) in the amount,
Efficient selection of the quantization matrix in appropriate units
Can be determined.

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

【図1】本発明に係る一実施例の画像出力装置の構成を
示すブロツク図である。
FIG. 1 is a block diagram showing a configuration of an image output device according to an embodiment of the present invention.

【図2】図1の符号量制御部の詳細構成を示す図であ
る。
FIG. 2 is a diagram illustrating a detailed configuration of a code amount control unit in FIG. 1;

【図3】図1の圧縮処理部の詳細構成を示す図である。FIG. 3 is a diagram illustrating a detailed configuration of a compression processing unit in FIG. 1;

【図4】本実施例の一般的なジグザグスキャンの説明図
である。
FIG. 4 is an explanatory diagram of a general zigzag scan according to the present embodiment.

【図5】本実施例の制御をグラフ化した図である。FIG. 5 is a graph showing the control of the embodiment.

【図6】本発明に係る第2の実施例の構成を示すブロツ
ク図である。
FIG. 6 is a block diagram showing a configuration of a second embodiment according to the present invention.

【図7】第2の実施例の制御をグラフ化した図である。FIG. 7 is a graph showing the control of the second embodiment.

【図8】本発明に係る第3の実施例の構成を示すブロツ
ク図である。
FIG. 8 is a block diagram showing a configuration of a third embodiment according to the present invention.

【図9】第3の実施例の制御をグラフ化した図である。FIG. 9 is a graph showing the control of the third embodiment.

【図10】本発明に係る第4の実施例における画像符号
化処理装置を示すブロツク図である。
FIG. 10 is a block diagram showing an image coding processing apparatus according to a fourth embodiment of the present invention.

【図11】第4の実施例での画像符号化制御を示すフロ
ーチヤートである。
FIG. 11 is a flowchart showing image coding control in a fourth embodiment.

【図12】本発明に係る第5の実施例における画像符号
化装置の構成を示すブロック図である。
FIG. 12 is a block diagram illustrating a configuration of an image encoding device according to a fifth embodiment of the present invention.

【図13】第5の実施例におけるDCT変換後の各周波
数成分をスキャン変換部で並び替える際の順序を示す図
である。
FIG. 13 is a diagram showing an order when rearranging each frequency component after DCT conversion by a scan conversion unit in the fifth embodiment.

【図14】本発明に係る第6の実施例における画像符号
化装置の構成を示すブロック図である。
FIG. 14 is a block diagram illustrating a configuration of an image encoding device according to a sixth embodiment of the present invention.

【図15】本発明に係る第7の実施例における画像符号
化装置の構成を示すブロック図である。
FIG. 15 is a block diagram illustrating a configuration of an image encoding device according to a seventh embodiment of the present invention.

【図16】本発明に係る第8の実施例における画像符号
化装置の構成を示すブロック図である。
FIG. 16 is a block diagram illustrating a configuration of an image encoding device according to an eighth embodiment of the present invention.

【図17】本発明に係る第9実施例における画像符号化
装置の構成を示すブロツク図である。
FIG. 17 is a block diagram illustrating a configuration of an image encoding device according to a ninth embodiment of the present invention.

【図18】本発明に係る第10実施例における画像符号
化装置の構成を示すブロツク図である。
FIG. 18 is a block diagram illustrating a configuration of an image encoding device according to a tenth embodiment of the present invention.

【図19】従来の技術を示すブロツク図である。FIG. 19 is a block diagram showing a conventional technique.

【図20】従来例による画像符号化装置の構成を示すブ
ロック図である。
FIG. 20 is a block diagram illustrating a configuration of an image encoding device according to a conventional example.

【図21】本実施例に適用可能な画像符号化装置の好適
な応用例である画像出力装置を示すブロック図である。
FIG. 21 is a block diagram illustrating an image output device that is a preferable application example of the image encoding device applicable to the present embodiment.

【図22】一般的なDCT変換後の各周波数成分を符号
化する際のビット配分を示す図である。
FIG. 22 is a diagram illustrating bit allocation when encoding each frequency component after a general DCT transform.

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

11,401,407,408 入力端子 12 プリンタのI/O 13 バツファメモリ 14 符号量制御部 15,502 圧縮処理部 16,601 メモリ 17 符号化領域カウンタ 18 符号量カウンタ 19 伸張処理部 20 プリンタエンジン 21,61 基準符号量演算部 22 掛け算器 23,106,159 減算器 24 下限設定値 25,26,82〜85,303 比較器 27,86 判定手段 28 圧縮条件変換部 31 ブロツク化回路 32 DCT回路 33,1006 ジグザグスキャン回路 34,404,2004 量子化部 35 ハフマン符号化 62 上限設定値 63 加算器 81 量子化テーブル設定手段 87 量子化テーブル選択手段 101 スキヤン変換部 102 エントロピー符号化部 103 符号量計数部 105,162 アキユムレータ 107 量子化テーブル 108 量子化テーブル格納部 154,158 除算器 156 画像データ計数部 160 量子化テーブル切換制御部 161 逆数器 163,202 乗算器 201 スケールフアクタ切換制御部 301 基準符号量演算部 402 バツフア 403 DCT変換部 404 量子化部 405 パツキング処理部 409 符号量演算部 410 ビット配分演算部 501 インターフェース部 502 圧縮処理部 503 記憶部 504 伸長部 505 画像出力部 602 アドレス発生器 603 メモリ制御部 801 画像符号化制御装置 802 ブロツク化部 803 変換部 804 量子化部 805 符号化部 806 符号量累積部 807 増加率判定部 808 閾値切り換え部 809 量子化マトリクス設定部 1000 フレームメモリ 1001 DCT処理 1002 量子化器 1003 パスカウンタ 1004,1008 スイッチ 1005 量子化テーブル 1009 符号量測定器 1010 スケーリングファクター変更部 11, 401, 407, 408 input terminal 12 printer I / O 13 buffer memory 14 code amount control unit 15, 502 compression processing unit 16, 601 memory 17 coding area counter 18 code amount counter 19 decompression processing unit 20 printer engine 21, 61 Reference code amount calculation unit 22 Multiplier 23, 106, 159 Subtractor 24 Lower limit set value 25, 26, 82 to 85, 303 Comparator 27, 86 Judging means 28 Compression condition conversion unit 31 Blocking circuit 32 DCT circuit 33, 1006 Zigzag scan circuit 34, 404, 2004 Quantization unit 35 Huffman coding 62 Upper limit setting value 63 Adder 81 Quantization table setting means 87 Quantization table selection means 101 Scan conversion unit 102 Entropy encoding unit 103 Code amount counting unit 105 , 162 Aki Murator 107 Quantization table 108 Quantization table storage unit 154, 158 Divider 156 Image data counting unit 160 Quantization table switching control unit 161 Reciprocal unit 163, 202 Multiplier 201 Scale factor switching control unit 301 Reference code amount calculation unit 402 Buffer 403 DCT transformation unit 404 Quantization unit 405 Packing processing unit 409 Code amount calculation unit 410 Bit allocation calculation unit 501 Interface unit 502 Compression processing unit 503 Storage unit 504 Decompression unit 505 Image output unit 602 Address generator 603 Memory control unit 801 Image Encoding control device 802 Blocking unit 803 Transforming unit 804 Quantizing unit 805 Encoding unit 806 Code amount accumulating unit 807 Increase rate determining unit 808 Threshold switching unit 809 Quantization matrix setting unit 1000 Frameme Li 1001 DCT processing 1002 quantizer 1003 pass counter 1004, 1008 Switch 1005 quantization table 1009 code amount measuring device 1010 scaling factor changing section

フロントページの続き (72)発明者 大木 丈二 東京都大田区下丸子3丁目30番2号 キ ヤノン株式会社内 (56)参考文献 特開 平4−145781(JP,A) 特開 平4−18857(JP,A) (58)調査した分野(Int.Cl.7,DB名) H04N 1/41 - 1/419 H04N 7/30 Continuation of the front page (72) Inventor Joji Oki 3-30-2 Shimomaruko, Ota-ku, Tokyo Canon Inc. (56) References JP-A-4-1455781 (JP, A) JP-A-4-18857 ( JP, A) (58) Field surveyed (Int. Cl. 7 , DB name) H04N 1/41-1/419 H04N 7/30

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 入力画像信号を複数画素からなるブロッ
クに分割するブロック化手段と、 該ブロツク化手段で分割したブロックごとに系列変換す
る変換手段と、 該変換手段で変換された変換係数を量子化マトリクスを
用いて量子化する量子化手段と、 該量子化手段で量子化された変換係数を可変長符号を用
いて符号化する符号化手段と、 該符号化手段で符号化された符号量を、所定数のブロッ
ク単位毎に累積する符号量累積手段と、 該符号量累積手段で得られる各累積値の合計と、第1閾
値との比較結果に基づいて、前記量子化手段に適用する
量子化マトリクスを選択する量子化マトリクス設定手段
と、 前記符号量累積手段で夫々得られる前後の累積値間の差
分に基づいて符号量の増加率を得、該増加率と第2閾値
とを比較する増加率判定手段と、 該増加率判定手段による比較の結果に応じて、前記量子
化マトリクス設定手段による選択に利用される第1閾値
を切り換える閾値切り換え手段とを備えることを特徴と
する画像処理装置。
1. Blocking means for dividing an input image signal into blocks consisting of a plurality of pixels, transforming means for performing series conversion for each block divided by the blocking means, and quantizing transform coefficients transformed by the transforming means. Quantization means for quantizing using the quantization matrix, coding means for coding the transform coefficient quantized by the quantization means using a variable-length code, code amount coded by the coding means The number of blocks
Code amount accumulating means for accumulating each code unit, a sum of accumulated values obtained by the code amount accumulating means, a first threshold
A quantization matrix setting unit for selecting a quantization matrix to be applied to the quantization unit based on a result of comparison with a value, and a difference between before and after accumulated values respectively obtained by the code amount accumulation unit.
The rate of increase of the code amount is obtained based on the
And a threshold switching means for switching a first threshold used for selection by the quantization matrix setting means in accordance with a result of the comparison by the increase rate determining means. An image processing apparatus characterized by the above-mentioned.
【請求項2】 入力画像信号を複数画素からなるブロッ
クに分割するブロック化工程と、 該ブロツク化工程で分割したブロックごとに系列変換す
る変換工程と、 該変換工程で変換された変換係数を量子化マトリクスを
用いて量子化する量子化工程と、 該量子化工程で量子化された変換係数を可変長符号を用
いて符号化する符号化工程と、 該符号化工程で符号化された符号量を、所定数のブロッ
ク単位毎に累積する符号量累積工程と、 該符号量累積工程で得られる各累積値の合計と、第1閾
値との比較結果に基づいて、前記量子化工程に適用する
量子化マトリクスを選択する量子化マトリクス設定工程
と、 前記符号量累積工程で夫々得られる前後の累積値間の差
分に基づいて符号量の増加率を得、該増加率と第2閾値
とを比較する増加率判定工程と、 該増加率判定工程による比較の結果に応じて、前記量子
化マトリクス設定工程による選択に利用される第1閾値
を切り換える閾値切り換え工程とを備えることを特徴と
する画像処理方法。
2. A block forming step of dividing an input image signal into blocks each including a plurality of pixels; a converting step of performing series conversion for each block divided in the block forming step; A quantization step of quantizing using the quantization matrix, an encoding step of encoding the transform coefficient quantized in the quantization step using a variable length code, and a code amount encoded in the encoding step The number of blocks
A code amount accumulating step for accumulating each code unit, a sum of accumulated values obtained in the code amount accumulating step, a first threshold
A quantization matrix setting step of selecting a quantization matrix to be applied to the quantization step based on a result of comparison with a value, and a difference between accumulated values before and after obtained in the code amount accumulation step , respectively.
The rate of increase of the code amount is obtained based on the
And a threshold switching step of switching a first threshold used for selection in the quantization matrix setting step in accordance with a result of the comparison in the increase rate determining step. An image processing method comprising:
JP17344392A 1992-06-30 1992-06-30 Image processing apparatus and method Expired - Fee Related JP3222554B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP17344392A JP3222554B2 (en) 1992-06-30 1992-06-30 Image processing apparatus and method
US08/425,768 US6553143B2 (en) 1992-06-30 1995-04-20 Image encoding method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP17344392A JP3222554B2 (en) 1992-06-30 1992-06-30 Image processing apparatus and method

Publications (2)

Publication Number Publication Date
JPH0622152A JPH0622152A (en) 1994-01-28
JP3222554B2 true JP3222554B2 (en) 2001-10-29

Family

ID=15960572

Family Applications (1)

Application Number Title Priority Date Filing Date
JP17344392A Expired - Fee Related JP3222554B2 (en) 1992-06-30 1992-06-30 Image processing apparatus and method

Country Status (1)

Country Link
JP (1) JP3222554B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007013956A (en) * 2005-06-29 2007-01-18 Xerox Corp Data transferability predictor

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3082585B2 (en) * 1994-09-09 2000-08-28 富士ゼロックス株式会社 Image information encoding processing device, image information decoding processing device, and image information encoding / decoding processing device
US7228000B2 (en) 2002-03-15 2007-06-05 Ricoh Co., Ltd. Image data generation with reduced amount of processing
EP1349393A1 (en) 2002-03-15 2003-10-01 Ricoh Company Image compression device, image decompression device, image compression/decompression device, program for executing on a computer to perform functions of such devices, and recording medium storing such a program
JP2007036745A (en) * 2005-07-27 2007-02-08 Sharp Corp Image data encoding device, image data encoding amount control method, and electronic information apparatus
JP4682102B2 (en) 2005-09-02 2011-05-11 キヤノン株式会社 Image coding apparatus and image coding method
JP4828925B2 (en) * 2005-11-30 2011-11-30 パナソニック株式会社 Encoder
JP5149427B2 (en) 2011-06-22 2013-02-20 シャープ株式会社 Encoding device, decoding device, codec decoding system, encoding method, and decoding method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007013956A (en) * 2005-06-29 2007-01-18 Xerox Corp Data transferability predictor

Also Published As

Publication number Publication date
JPH0622152A (en) 1994-01-28

Similar Documents

Publication Publication Date Title
US7227998B2 (en) Image processing apparatus, control method of the same, computer program, and computer-readable storage medium
US7257264B2 (en) Image processing apparatus and method for compression-encoding image area information
US6909811B1 (en) Image processing apparatus and method and storage medium storing steps realizing such method
US20060045362A1 (en) Image encoding apparatus and method, computer program, and computer-readable storage medium
JP2549013B2 (en) Data compression device
US20110123127A1 (en) Image processing apparatus, control method for the same, program
US5761345A (en) Image processing apparatus suitable for multistage compression
JP3222554B2 (en) Image processing apparatus and method
KR100475041B1 (en) Image information high-speed compressing method and real-time moving picture transferring method using the same
JP2001045301A (en) Image processor
JP3278948B2 (en) Variable length coding method
JP3681828B2 (en) Code amount control method and apparatus for image data
JPH0487460A (en) Picture processor
JPH05103212A (en) Data transmission equipment
CN112672164B (en) Video compression system and method, and video decompression system and method
JPH06189140A (en) Image compression device
JP3218220B2 (en) Image information compression method and image information compression system
US20020001414A1 (en) System for building a data compression encoder
JP3205087B2 (en) Image processing apparatus and method
US20020176630A1 (en) Image data processing method
JP3205028B2 (en) Image compression apparatus and method
JP4715175B2 (en) Image forming apparatus and method
KR100375313B1 (en) Method for compression and extract layered using DPCM
JP3190118B2 (en) Image processing device
JP2821614B2 (en) Image transmission apparatus and image transmission method

Legal Events

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20010719

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

Free format text: PAYMENT UNTIL: 20070817

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20080817

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees