JPH04179371A - Device and method for encoding picture data - Google Patents

Device and method for encoding picture data

Info

Publication number
JPH04179371A
JPH04179371A JP2306071A JP30607190A JPH04179371A JP H04179371 A JPH04179371 A JP H04179371A JP 2306071 A JP2306071 A JP 2306071A JP 30607190 A JP30607190 A JP 30607190A JP H04179371 A JPH04179371 A JP H04179371A
Authority
JP
Japan
Prior art keywords
block
code amount
encoding
code
allocated
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2306071A
Other languages
Japanese (ja)
Inventor
Chihiro Nakagawa
千尋 中川
Chikako Mogi
茂木 千佳子
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.)
Olympus Corp
Original Assignee
Olympus Optical Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Olympus Optical Co Ltd filed Critical Olympus Optical Co Ltd
Priority to JP2306071A priority Critical patent/JPH04179371A/en
Publication of JPH04179371A publication Critical patent/JPH04179371A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To encode a picture within prescribed time and within a prescribed code amount without damaging the quality of the picture by controlling the code amount so that it is within an allocated code amount obtained by means of combining the excess and lack of the allocated code amount of respective blocks and the allocated code amount till a previous block in accordance with the encoding order of respective decided color components. CONSTITUTION:An encoding circuit 80 is provided with an orthogonal conversion circuit 4, a quantizing circuit 6, a Huffman encoding circuit 8 as a variable length encoding, a quantizing width prediction circuit 12, a code amount calculation circuit 14, a code amount allocation circuit 20 and a code stop circuit 16. Optimum quantizing width and the allocated code amount for respective blocks are decided from the code amounts for respective blocks, which are obtained from a statistical processing, and a difference between the code amount generated by encoding in the processed block and the allocated code amount is added to the allocated code amount of the block being the object of a processing, and variable length encoding is stopped lest it exceeds the allocated code amount. On the other hand, a processing order by the individual color components is decided in correspondence with code amount prediction values by the individual color components. Thus, the encoding processing can be executed within prescribed processing time and within the prescribed code amount without damaging the quality of the picture.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は画像データを所定の容量に高圧縮符号化するた
めの符号化装置および符号化方法に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to an encoding device and encoding method for highly compression encoding image data to a predetermined capacity.

〔従来の技術〕[Conventional technology]

CCDに代表される固体撮像装置等により撮像された画
像信号をメモリカード、磁気ディスクあるいは磁気テー
プ等の記憶装置にディジタルデータとして記憶する場合
、そのデータ量は膨大なものとなるため、多くのフレー
ム画像を限られた記憶容量の範囲で記録しようとするに
は、得られた画像信号のデータに対し、何らかの高能率
な圧縮を行うことか必要となる。さらに、ディジタル電
子スチルカメラなどにおいては、撮影した画像を銀塩フ
ィルムの代わりに、メモリカード、磁気ディスクあるい
は磁気テープ等の記憶媒体にディジタルデータとして保
存するので、1枚のメモリカード、磁気ディスクあるい
は1巻の磁気テープ装置に記録できる画像の枚数が規定
され、この規定枚数性の画像の記録が保証されなければ
ならず、しかも、データの記録再生処理に要する時間が
短く、且つ、一定である必要かある。
When an image signal captured by a solid-state imaging device such as a CCD is stored as digital data in a storage device such as a memory card, magnetic disk, or magnetic tape, the amount of data is enormous, so many frames are required. In order to record images within a limited storage capacity, it is necessary to perform some kind of highly efficient compression on the obtained image signal data. Furthermore, in digital electronic still cameras, captured images are stored as digital data on storage media such as memory cards, magnetic disks, or magnetic tapes instead of silver halide films. The number of images that can be recorded on one roll of magnetic tape device is specified, and recording of this specified number of images must be guaranteed, and the time required for data recording and reproduction processing is short and constant. Is it necessary?

同様に、ディジタルVTR(ビデオテープレコーダ)、
ディジタル動画ファイル等において動画像を記録する場
合もフレーム当たりの画像のデータ量に影響されること
なく、諸定量のフレームを記録できなければならない。
Similarly, digital VTR (video tape recorder),
When recording moving images such as digital moving image files, it is necessary to be able to record various amounts of frames without being affected by the amount of image data per frame.

すなわち、静止画像であっても、動画像であっても、必
要なコマ数分を確実に記録できる必要があるとともにデ
ータの記録再生処理に要する時間が短く、且つ、−定で
ある必要がある。
In other words, whether it is a still image or a moving image, it is necessary to be able to reliably record the required number of frames, and the time required for data recording and reproduction processing must be short and constant. .

高能率な画像データの圧縮方式として、直交変換符号化
と可変長符号化を組み合わせた符号化方法が広く知られ
ている。
A coding method that combines orthogonal transform coding and variable length coding is widely known as a highly efficient image data compression method.

その代表的なものとして、静止画符号化国際標準化にお
いて検討されている方式がある。
A typical example is a method being considered in the international standardization of still image coding.

この方式について次に概略を説明する。まず画像データ
を所定の大きさのブロックに分割し、分割されたブロッ
ク毎に直交変換として2次元のDCT (離散コサイン
変換)を行う。次に各周波成分に応した線形量子化を行
い、この量子化された値に対[2可変長杆号化としてハ
フマン符号化を行う。この時、直流成分に関しては近傍
ブロックの直流成分との差分値をハフマン符号化する。
An outline of this method will be explained below. First, image data is divided into blocks of a predetermined size, and a two-dimensional DCT (discrete cosine transformation) is performed as orthogonal transformation for each divided block. Next, linear quantization is performed according to each frequency component, and Huffman encoding is performed on the quantized values as [2 variable length rod encoding. At this time, regarding the DC component, the difference value between it and the DC component of the neighboring block is Huffman encoded.

交流成分はジグザグスキャンと呼ばれる低い周波数成分
から高い周波数成分へのスキャンを行い無効(値かO)
の成分の連続する個数とそれに続く有効な成分の値とか
ら2次元のハフマン符号化する。
AC components are invalidated by scanning from low frequency components to high frequency components called zigzag scan (value or O)
Two-dimensional Huffman encoding is performed from the consecutive number of components and the values of the subsequent effective components.

この基本部分たけでは、可変長符号化であるハフマン符
号化を用いているために符号量が画像毎に一定ではなく
なってしまう。
In this basic portion, since Huffman coding, which is variable length coding, is used, the amount of code is not constant for each image.

そこで、符号量の制御の方法として次の方式か提案され
ている。まず、前記基本部分の処理を行うと同時に全画
面の発生した総符号量を求める。
Therefore, the following method has been proposed as a method for controlling the amount of code. First, at the same time as processing the basic part, the total amount of codes generated for the entire screen is determined.

この総符号量と目的とする符号量とからDCT係数に対
する目的とする符号量に近づけるのに最適な量子化幅を
予測する。次にこの量子化幅を用いて前記基本部分の量
子化以降の処理を繰り返す。
From this total code amount and the target code amount, the optimum quantization width for approaching the target code amount for the DCT coefficient is predicted. Next, using this quantization width, the processing after quantization of the basic portion is repeated.

そして、今回発生した総符号量と、前回発生した総符号
量と、目的とする符号量とから再び目的の符号量に近づ
けるのに最適な量子化幅を予測する。
Then, from the total code amount generated this time, the total code amount generated last time, and the target code amount, the optimum quantization width to bring the target code amount closer again is predicted.

そして、この予測した量子化幅と前回の量子化幅が充分
に近づき、かつ目的の符号量よりも今回発生した総符号
量の方か少ない場合には処理を終了し、符号を出力する
。そうでない場合には新しい量子化幅を用いて処理を繰
り返す。
If the predicted quantization width and the previous quantization width are sufficiently close and the total amount of code generated this time is smaller than the target code amount, the process is terminated and the code is output. If not, the process is repeated using a new quantization width.

量子化幅は、各周波数成分に対する相対的な量子化特性
を表す基本形である量子化マトリックスを用意し、この
量子化マトリックスに対して、量子化係数を乗して必要
な量子化幅を得る。具体的には最初に標準的な量子化係
数を用いて得た量子化幅により上述の基本部分での量子
化を行い、これを可変長符号化し、これにより得られた
総符号量の情報と、収めるべき限度となる予め設定した
目標の総符号量との比較を行い、目標総符号量以内に達
したときはその量子化幅を使用して最終的な符号化処理
を行い、目標総符号量以内に収まらなかったときは、発
生総符号量と目標総符号量とから、例えば、線形予測に
より目的総符号量に近づくに最適な量子化係数を求め、
この求めた量子化係数と量子化マトリックスとから、よ
り最適化した量子化幅を計算し、これを用いて最終的な
符号化処理を行う。このような方法で、量子化幅の変更
を行う。
For the quantization width, a quantization matrix is prepared as a basic form representing the relative quantization characteristics for each frequency component, and this quantization matrix is multiplied by a quantization coefficient to obtain the necessary quantization width. Specifically, first, the above-mentioned basic part is quantized using the quantization width obtained using standard quantization coefficients, and then this is variable-length encoded, and the information on the total code amount obtained by this is , a comparison is made with the preset target total code amount, which is the limit that should be accommodated, and when the target total code amount is reached, the final encoding process is performed using that quantization width, and the target total code amount is reached. If the amount does not fall within the amount, the optimal quantization coefficient that approaches the target total code amount is determined by linear prediction from the generated total code amount and the target total code amount, and
A more optimized quantization width is calculated from the obtained quantization coefficient and quantization matrix, and this is used to perform the final encoding process. The quantization width is changed using this method.

しかし、上述の符号量の制御の方法では符号化の基本部
分のパスを何度繰り返すかが画像によって異なるために
処理時間か不定となるばかりでなく、一般的に処理時間
を長く必要とする欠点かあった。
However, with the method of controlling the amount of code described above, the number of times the basic encoding pass is repeated differs depending on the image, which not only makes the processing time unstable, but also generally requires a long processing time. There was.

そこで、この問題を解決する手法として本発明者らは次
のような方式を提案した。(特願平l−283781号
、特願平2−137222号参照)この提案した方式は
、直交変換と可変長符号化を組み合わせた圧縮方式にお
いて、発生符号量の制御を行うために、画像メモリに記
憶した標本化した画像信号を、ブロックに分割し、この
分割されたブロック毎に直交変換を行ってから、この変
換出力を暫定的な量子化幅で量子化した後、この量子化
出力を可変長符号化すると共に、各ブロック毎の発生符
号量と画像全体の総発生符号量を算出し、次に前記暫定
的な量子化幅、前記総発生符号量および、目的とする総
符号量とから、新しい量子化幅を予測する。また、前記
各ブロック毎の発生符号量と、前記総発生符号量と、目
的とする総符号量とから、各ブロック毎の割当符号量を
計算する。そして、新しい量子化幅を用いて再び画像メ
モリの画像信号をブロック分割、直交変換、量子化、可
変長符号化を行うと共に、各ブロックの発生符号量が各
ブロックの割当符号量を越える場合には、途中で可変長
符号化を中止して、次のブロックの処理に移る。これに
より、画像全体の総発生符号量が目的の総符号量を越え
ないように符号量の制御を行おうというものである。
Therefore, the present inventors proposed the following method as a method to solve this problem. (Refer to Japanese Patent Application No. 1-283781 and Japanese Patent Application No. 2-137222.) This proposed method is a compression method that combines orthogonal transform and variable length coding, and in order to control the amount of generated code, The sampled image signal stored in is divided into blocks, orthogonal transformation is performed on each divided block, and the output of this transformation is quantized using a provisional quantization width. At the same time as variable-length encoding, the amount of generated codes for each block and the total amount of generated codes for the entire image are calculated, and then the provisional quantization width, the total amount of generated codes, and the target total amount of codes are calculated. , predict the new quantization width. Further, the allocated code amount for each block is calculated from the generated code amount for each block, the total generated code amount, and the target total code amount. Then, the image signal in the image memory is divided into blocks, orthogonally transformed, quantized, and variable length encoded again using the new quantization width, and if the generated code amount of each block exceeds the allocated code amount of each block, stops variable-length encoding midway through and moves on to processing the next block. This is intended to control the code amount so that the total generated code amount for the entire image does not exceed the target total code amount.

以上の動作を第8図を参照して具体的に説明すると、ま
ず、(a)に示すように、1フレームの画像データ(国
際標準化室で例示されている1フレームの画像は720
57B画素)を所定の大きさのブロック(例えば、8×
8の画素よりなるブロックA、B、C,・・・ )に分
割し、(b)に示すように、この分割されたブロック毎
に直交変換として2次元のDCT (離散コサイン変換
)を行い、8X8のマトリックス上に順次格納する。画
像データは2次元平面で眺めてみると、濃淡情報の分布
に基づく周波数情報である空間周波数を有している。
To explain the above operation in detail with reference to FIG.
57B pixels) into a block of a predetermined size (for example, 8×
) is divided into blocks A, B, C, ...) each consisting of 8 pixels, and as shown in (b), a two-dimensional DCT (discrete cosine transform) is performed as an orthogonal transform for each divided block. Stored sequentially on an 8x8 matrix. When image data is viewed on a two-dimensional plane, it has a spatial frequency that is frequency information based on the distribution of gradation information.

従って、上記DCTを行うことにより、画像データは直
流成分DCと交流成分ACに変換され、8×8のマトリ
ックス上には原点位置(0,0位置)に直流成分DCの
値を示すデータが、そして、0.7位置には横軸方向の
交流成分ACの最大周波数値を示すデータが、そして、
7.0位置には縦軸方向の交流成分ACの最大周波数値
を示すデータが、さらに、7.7位置には斜方向の交流
成分ACの最大周波数値を示すデータがそれぞれ格納さ
れ、中間位置ではそれぞれの座標位置により関係付けら
れる方向における周波数データが、原点側より順次高い
周波数のものが出現する形で格納されることになる。
Therefore, by performing the above DCT, the image data is converted into a direct current component DC and an alternating current component AC, and data indicating the value of the direct current component DC is placed at the origin position (0,0 position) on the 8×8 matrix. At the 0.7 position, there is data indicating the maximum frequency value of the alternating current component AC in the horizontal axis direction, and
Data indicating the maximum frequency value of the alternating current component AC in the vertical axis direction is stored at the 7.0 position, data indicating the maximum frequency value of the alternating current component AC in the diagonal direction is stored at the 7.7 position, and the intermediate position Then, frequency data in directions related to each coordinate position are stored in a form in which higher frequencies appear sequentially from the origin side.

次にこのマトリックスにおける各座標位置の格納データ
を、各周波数成分毎の量子化幅により割ることにより、
各周波数成分に応じた線形量子化を行い(C)、この量
子化された値に対し可変長符号化としてハフマン符号化
を行う。、−この時、直流成分DCに関しては近傍ブロ
ックの直流成分との差分値をグループ番号(付加ビット
数)と付加ビットで表現し、そのグループ番号をハフマ
ン符号化し、得られた符号語と付加ビットを合わせて符
号化データとする( dl、 d2. el、 e2)
Next, by dividing the stored data at each coordinate position in this matrix by the quantization width for each frequency component,
Linear quantization is performed according to each frequency component (C), and Huffman encoding is performed as variable length encoding on this quantized value. , - At this time, regarding the DC component DC, the difference value with the DC component of the neighboring block is expressed by a group number (number of additional bits) and additional bits, the group number is Huffman encoded, and the obtained code word and additional bits are are combined into encoded data (dl, d2. el, e2)
.

交流成分ACに関しても有効でない(値が“0”でない
)係数は、グループ番号と付加ビットで表現する。
Coefficients that are not valid (values other than "0") regarding the alternating current component AC are expressed by group numbers and additional bits.

そのため、交流成分ACはジグザグスキャンと呼ばれる
低い周波数成分から高い周波数成分へのスキャンを行い
、無効(値が“0“)の成分の連続する個数(零のラン
数)と、それに続く有効な成分の値のグループ番号とか
ら2次元のハフマン符号化を行い、得られた符号語と付
加ビットを合わせて符号化データとする。
Therefore, the AC component AC performs a scan called zigzag scan from low frequency components to high frequency components, and detects the number of consecutive invalid (value is "0") components (number of runs of zero) and the following valid components. Two-dimensional Huffman encoding is performed from the group number of the value, and the obtained code word and additional bits are combined to form encoded data.

ハフマン符号化はフレーム画像当たりの上記直流成分D
Cおよび交流成分ACの各々のデータ分布における発生
頻度のピークのものを中心として、この中心のものほど
、データビットを少なくし、周辺になるほどビット数を
−多くするようにしてビット割り当てをした形でデータ
を符号化して符号語を得ることで行う。
Huffman encoding is the above DC component D per frame image.
The data distribution of C and alternating current component AC is centered around the peak frequency of occurrence in the data distribution, and bits are allocated in such a way that the center has fewer data bits, and the closer it is to the periphery, the larger the number of bits. This is done by encoding the data and obtaining a code word.

以上がこの方式の基本部分である。The above is the basic part of this method.

この基本部分だけでは、可変長符号化であるハフマン符
号化を用いているために符号が画像毎に一定ではなくな
ってしまうから、符号量の制御の方法として例えば、次
のように処理する。
If only this basic part is used, the code will not be constant for each image because Huffman coding, which is variable length coding, is used, so the code amount is controlled, for example, as follows.

まず、暫定的な量子化係数を用いて、定められた量子化
マトリックスと量子化係数を掛は合わせて得られる各周
波数成分毎の量子化幅で前記基本部分の処理を行うと同
時に、全画面の発生した総符号量(総ビット数)を求め
る(g)。この総符号量と、目的とする符号量と、用い
た暫定的な量子化係数などからDCT係数に対する目的
とする符号量に近付けるのに最適な量子化係数を予測す
る(h)。次に、この量子化係数を用いて(I)、前述
の基本部分の量子化以降の処理を繰り返す。そして、今
回発生した総符号量と、前回発生した総符号量と、目的
とする符号量と、今回用いた量子化係数と、前回用いた
量子化係数とから、再び目的の符号量に近付けるのに最
適な量子化係数をニュートン・ラブソン イタレーショ
ン(NewtonRaphson Iterratio
n )により予測する。
First, using a provisional quantization coefficient, the basic part is processed with the quantization width for each frequency component obtained by multiplying the predetermined quantization matrix and the quantization coefficient, and at the same time The total amount of generated codes (total number of bits) is determined (g). The optimum quantization coefficient for approaching the target code amount for the DCT coefficient is predicted from this total code amount, the target code amount, and the temporary quantization coefficient used (h). Next, using this quantization coefficient (I), the above-described processing after quantization of the basic part is repeated. Then, from the total code amount generated this time, the total code amount generated last time, the target code amount, the quantization coefficient used this time, and the quantization coefficient used last time, it is possible to approach the target code amount again. Newton-Raphson Iteration (Newton-Raphson Iteration)
n).

そして、この予測した量子化係数と前回の量子化係数が
充分に近づき、かつ目的の符号量よりも今回発生した総
符号量の方が少ない場合には処理を終了し、今回発生し
た符号化データを出力してメモリカードに記憶する(f
)。そうでない場合には量子化係数を変更し、この新し
い量子化係数を用いて処理を繰り返す。
If the predicted quantization coefficient and the previous quantization coefficient are close enough, and the total amount of code generated this time is smaller than the target amount of code, the process is terminated, and the coded data generated this time is Output and store it on the memory card (f
). Otherwise, the quantization coefficient is changed and the process is repeated using this new quantization coefficient.

しかし、上述の符号量の制御の方法では符号化の基本部
分のパスを何度繰り返すかが画像によって異なるために
処理時間が不定となるばかりでなく、一般的に処理時間
を長く必要とする欠点があった。そこで、本発明者らは
次のような方式でこれを解決した。
However, with the above code amount control method, the number of times the basic encoding pass is repeated varies depending on the image, which not only makes the processing time unstable, but also generally requires a long processing time. was there. Therefore, the present inventors solved this problem using the following method.

まず、暫定的な量子化係数を用いて、定められた量子化
マトリックスと量子化係数を掛は合わすて得られる各周
波数成分毎の量子化幅で前記基本部分の処理を行うと同
時に、全画面の発生した総符号量(総ビット数)と各ブ
ロック毎の発生符号量を求める(gl)。この総符号鳳
と、目的とする符号量と、用いた暫定的な量子化係数な
とからDCT係数に対する目的とする符号量に近付ける
のに最適な量子化係数を予測する(hl)。また、総符
号量と、目的とする符号量と、各ブロック毎の発生符号
量から比例配分により、各ブロックの割当符号量を求め
る(h2)。次に、予M1シた量子化係数を用いて(i
)、前述の基本部分の処理を繰り返す。つまり、再び画
像メモリの画像信号をブロック分割、直交変換、量子化
、可変長符号化を行うと共に、各ブロックの発生符号量
が各ブロックの割当符号量を越える場合には、途中で可
変長符号化を中止して、次のブロックの処理に移る。
First, using a provisional quantization coefficient, the basic part is processed with the quantization width for each frequency component obtained by multiplying the predetermined quantization matrix and the quantization coefficient, and at the same time The total amount of generated codes (total number of bits) and the amount of generated codes for each block are determined (gl). The optimum quantization coefficient for approaching the target code amount for the DCT coefficient is predicted from this total code amount, the target code amount, and the used provisional quantization coefficient (hl). Further, the allocated code amount for each block is determined by proportional allocation from the total code amount, the target code amount, and the generated code amount for each block (h2). Next, using the pre-M1 quantized coefficients (i
), repeat the basic process described above. In other words, the image signal in the image memory is divided into blocks, orthogonally transformed, quantized, and variable-length encoded again, and if the generated code amount of each block exceeds the allocated code amount of each block, the variable-length code is Abort the process and move on to processing the next block.

そして、すべてのブロックについて上記の処理を終了し
たら、今回発生した符号化データを出力してメモリカー
ドに記憶する(f)。
When the above processing is completed for all blocks, the encoded data generated this time is output and stored in the memory card (f).

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

上述したように、例えば、ディジタル電子スチルカメラ
などにおいては、1枚のメ、そリカードあるいは磁気デ
ィスク装置あるいは1本の磁気テープ等に記録できる画
像に枚数が保証されていなければならず、そのため、画
像データを圧縮して記録するが、操作性の上からその処
理時間はできるだけ短く、且つ、一定である必要がある
。また、高能率で画像データの圧縮か行えることが望ま
れる。これらはディジタル電子スチルカメラに限らず他
のアプリケーションにおいても少なからず要求される項
目である。
As mentioned above, for example, in a digital electronic still camera, there must be a guaranteed number of images that can be recorded on one medium, card, magnetic disk device, or one magnetic tape. Image data is compressed and recorded, but from the viewpoint of operability, the processing time must be as short as possible and constant. It is also desirable to be able to compress image data with high efficiency. These are items that are required not only for digital electronic still cameras but also for other applications.

そして、このような要求を満たす圧縮方式として上述の
国際標準東方式があり、この方式において、前記基本部
分で例示したようなブロック毎の直交変換と可変長符号
化を組み合わせた手法では、画像データの圧縮を高能率
で行えるものの、可変長符号化を用いているが故に符号
量が一定にならず、1枚のメモリカードあるいは磁気デ
ィスクあるいは1本の磁気テープ等の記録媒体に記憶で
きる画像の枚数が不定になるという欠点があった。
As a compression method that satisfies these requirements, there is the International Standard East method mentioned above. However, because variable-length encoding is used, the amount of code is not constant, and the number of images that can be stored on a recording medium such as a memory card, magnetic disk, or magnetic tape is limited. There was a drawback that the number of sheets was indefinite.

また、これを解決するための従来技術として、上述した
静止画符号化国際標準化において検討されている符号量
制御の方式かあるが、この方式では符号化の基本部分の
パスを何度繰り返すかが画像によって異なるために処理
時間が不定となるばかりでなく、一般的に処理時間を長
(必要とする欠点があった。
In addition, as a conventional technique to solve this problem, there is a code amount control method that is being considered in the international standardization of still image coding mentioned above, but in this method, the number of passes of the basic part of encoding is repeated. Not only does the processing time vary depending on the image, but it also has the disadvantage that it generally requires a long processing time.

この問題を解決する手法として本発明者らか提案した特
願平1−283761号および特願平2−137222
号の方式かある。この提案した方式は、通常の場合、大
変に良好な結果が得られるか、応用するシステムによっ
ては、空間周波数の特に低い、あるいは特に高い画像で
は若干画質が低下し、発生した符号量の目標の符号量に
対する隔たりが通常の場合よりも若干多くなることが極
(稀に生しる。
Japanese Patent Application No. 1-283761 and Japanese Patent Application No. 2-137222 proposed by the present inventors as a method to solve this problem.
There is a number method. The proposed method may usually give very good results, or depending on the system in which it is applied, the image quality may be slightly degraded for images with particularly low or particularly high spatial frequencies, and the amount of code generated may be less than the target amount. In rare cases, the difference in code amount may be slightly larger than in the normal case.

この原因に関して説明する。前述のように、量子化幅を
各周波数成分に対する相対的な量子化特性を表す基本形
である量子化マトリックスに、量子化係数を乗したもの
で表すとき、量子化係数と発生符号量の間にはおよそ次
の関係がある。
The cause of this will be explained. As mentioned above, when expressing the quantization width by multiplying the quantization matrix, which is the basic form expressing the relative quantization characteristics for each frequency component, by the quantization coefficient, there is a difference between the quantization coefficient and the amount of generated code. has approximately the following relationship.

log BR−a log sp+ b      −
(1)ここで、BRは一画素当たりの符号tkcビット
レート)、SFは量子化係数、aおよびbは定数であり
、aは特にシステムに大きく依存し、bは特に画像に大
きく依存する。
log BR-a log sp+ b-
(1) Here, BR is the code tkc bit rate per pixel), SF is the quantization coefficient, and a and b are constants, where a is particularly dependent on the system and b is particularly dependent on the image.

色成分に分離されたカラー画像の量子化の際に、色成分
に対し、複数の量子化マトリ・ノクス、例えば、輝度用
と色差用の二つの量子化マトリックスを用いるとともに
、共通の量子化係数を用いるとすると、 log BRy = a 、 log SF+ b 、
     −(2)log BRc −a、log S
F+ b c−(3)のような関係になる。尚、上記各
式においてはBR。
When quantizing a color image separated into color components, multiple quantization matrices are used for the color components, for example, two quantization matrices, one for luminance and one for color difference, and a common quantization coefficient is used. If we use log BRy = a, log SF+ b,
−(2) log BRc −a, log S
The relationship becomes F+ b c- (3). In addition, in each of the above formulas, BR.

aSbに、それぞれy、cを添えて輝度、色差の区別し
である。ここでもし、B、 、 wm a、であれば、
log(BRy +BRc ) −a y log sp + (10by+ 10” 
)−a log SF+ b        −(4)
のようになり、各ブロック毎の割当符号量の決定は、統
計量に応じて目的の符号量を比例配分して。
y and c are added to aSb to distinguish between brightness and color difference. Here, if B, , wm a, then
log(BRy +BRc) -ay log sp + (10by+10”
)-a log SF+ b-(4)
The code amount to be allocated to each block is determined by proportionally distributing the target code amount according to the statistics.

得れば良いことがわかる。If you get it, you know it's good.

通常の場合%  a7 ” ac−である力(、システ
ムによっては極く稀にa、  と ac の大きさがか
なり異なることがある。
In the normal case, the force is % a7 '' ac- (although, depending on the system, the magnitudes of a, and ac may be quite different depending on the system).

つまり、総符号量log BRをY軸に、量子化係数l
og SFをY軸にとり、式(2)と式(3)の関係を
示すと第9図の如きとなり、量子化係数log SPに
応じた総符号JilogBRの大きさは輝度系と色差系
で少し違いがある。第9図を眺めてみると、符号化する
ときの量子化係数、つまり、最適値と予測される量子化
係数が、特に大きかったり、あるいは小さいとき、言い
換えると特に空間周波数の高い画像のとき、あるいは低
い画像の場合においては、各ブロックの統計量に応じて
目的の符号量を比例配分することによって割当符号量を
決定すると、その予測された量子化係数を用いて実際に
符号化を行った際に、輝度成分のブロックにおいては割
当符号量が不十分となり、色差成分のブロックでは余分
となる、あるいはその逆になる。
In other words, the total code amount log BR is plotted on the Y axis, and the quantization coefficient l
og SF on the Y axis and the relationship between equations (2) and (3) is shown in Figure 9. The magnitude of the total code JilogBR according to the quantization coefficient log SP is slightly different for the luminance system and color difference system. There is a difference. Looking at FIG. 9, we can see that when the quantization coefficient during encoding, that is, the quantization coefficient predicted to be the optimal value, is particularly large or small, in other words, when the image has a particularly high spatial frequency, Alternatively, in the case of a low-quality image, if the allocated code amount is determined by proportionally allocating the target code amount according to the statistics of each block, the actual encoding is performed using the predicted quantization coefficient. In this case, the allocated code amount becomes insufficient for the luminance component block, and becomes redundant for the chrominance component block, or vice versa.

輝度成分における割当符号量が不足するか、色差成分に
おける割当符号量が不足するかは、a、とao、の大小
関係と、予測された量子化係数の大小による。
Whether the allocated code amount for the luminance component is insufficient or the allocated code amount for the chrominance component is insufficient depends on the magnitude relationship between a and ao and the magnitude of the predicted quantization coefficient.

以上の原因から、応用するシステムによっては、空間周
波数の特に低い、あるいは特に高い画像では、若干画質
が低下し、発生した符号量の目標の符号量に対する隔た
りが通常の場合よりも若干多くなることかあった。
Due to the above reasons, depending on the applied system, the image quality may deteriorate slightly for images with particularly low or particularly high spatial frequencies, and the gap between the generated code amount and the target code amount may be slightly larger than in normal cases. There was.

そこで、本発明の目的とするところは、空間周波数分布
傾向が片寄った画像であっても、画質を損なわずに、一
定の処理時間内で一定の符号量内に収まるように符号化
できるようにした画像データの符号化装置および符号化
方法を提供することにある。
Therefore, an object of the present invention is to enable encoding of images within a certain amount of code within a certain processing time without degrading the image quality, even if the image has a biased spatial frequency distribution. An object of the present invention is to provide an encoding device and method for encoding image data.

[課題を解決するための手段] 上記目的を達成するため、本発明は次のよう−に構成す
る。
[Means for Solving the Problems] In order to achieve the above object, the present invention is configured as follows.

すなわち、色成分別に分離されたカラー画像データそれ
ぞれをブロックに分割し、色成分別のこの分割されたブ
ロック毎に直交変換を行ってからこの変換出力を量子化
手段により量子化し、その後、この量子化出力を可変長
符号化手段に与えて可変長符号化し、データの符号化を
行う際に、初めに暫定的に定めた量子化幅で量子化して
可変長符号化し、各ブロック毎の符号量を得る統計処理
を行い、次にこの統計処理により求めた各ブロック毎の
符号量から最適量子化幅と各ブロック毎の割当符号量と
を決定し、この決定した最適量子化幅に従って各ブロッ
ク毎の前記変換出力の量子化を行うと共にこの量子化出
力を各ブロック毎の割当符号量に従って各ブロック毎に
符号量制御を行いながら順次可変長符号化する符号化処
理を実施する符号化装置において、 第1には、前記ブロックのうち、次に符号化処理する処
理対象ブロックの前に処理した処理済みブロックでの符
号化により発生した符号量と当該処理済みブロックでの
割当符号量との差を求めてこれと前記処理対象ブロック
の前記割当符号量とを加え、当該処理対象ブロックでの
割当符号量として割り当てる符号量割当手段と、前記処
理対象ブロックでの符号化処理時に前記符号量割当手段
により割り当てられた割当符号量を越えないように、前
記可変長符号化を打ち切る符号化打ち切り手段と、前記
最適量子化幅にて量子化する際の各色成分別の符号量予
測値に応し前記カラー画像データの符号化処理における
色成分別の処理順位を決定する符号順決定手段と、この
符号順決定手段により決定された処理すべき色成分順位
に従い、順位の高い色成分の前記カラー画像データより
符号化処理させるべく制御する制御手段とを具備して構
成する。
That is, each color image data separated by color component is divided into blocks, orthogonal transformation is performed for each divided block by color component, and the output of this transformation is quantized by a quantization means. The encoded output is given to a variable-length encoding means to be variable-length encoded, and when encoding data, it is first quantized with a provisionally determined quantization width and then variable-length encoded, and the code amount for each block is Then, from the code amount for each block obtained by this statistical processing, the optimal quantization width and the allocated code amount for each block are determined, and according to the determined optimal quantization width, each block is In an encoding device that performs encoding processing of quantizing the transform output of and sequentially variable-length encoding the quantized output while controlling the code amount for each block according to the allocated code amount for each block, First, the difference between the amount of code generated by the encoding of the processed block processed before the block to be encoded next and the amount of allocated code for the processed block is calculated. a code amount allocating means which adds this and the allocated code amount of the processing target block and allocates it as an allocated code amount in the processing target block; and a code amount allocation means when performing encoding processing on the processing target block. a coding aborting unit that aborts the variable length coding so as not to exceed the assigned allocated code amount; code order determining means for determining the processing order for each color component in the encoding process of image data; and a control means for controlling the encoding process.

また、第2には前記ブロックのうち、次に符号化処理す
る処理対象ブロックの前に処理した処理済みブロックで
の符号化により発生した符号量と当該処理済みブロック
での割当符号量との差を求めてこれと前記処理対象ブロ
ックの前記割当符号量とを加え、当該処理対象ブロック
での割当符号量として割り当てる符号量割当手段と、前
記処理対象ブロックでの符号化処理時に前記符号量割当
手段により割り当てられた割当符号量を越えないように
、前記可変長符号化を打ち切る符号化打ち切り手段と、
前記暫定的に定めた量子化幅と最適量子化幅より前記カ
ラー画像データの符号化処理における色成分別の処理順
位を決定する符号順決定手段と、この符号順決定手段に
より決定された処理すべき色成分順位に従い、順位の高
い色成分の前記カラー画像データより符号化処理させる
べく制御する制御手段とを備えて構成する。
Second, the difference between the amount of code generated by encoding in the processed block processed before the block to be encoded next among the blocks and the amount of allocated code in the processed block. a code amount allocating means that calculates and adds this and the allocated code amount of the processing target block and allocates it as the allocated code amount of the processing target block; and the code amount allocation means during encoding processing of the processing target block. encoding terminating means for terminating the variable length encoding so as not to exceed the allocated code amount allocated by;
code order determining means for determining a processing order for each color component in the encoding process of the color image data from the tentatively determined quantization width and the optimum quantization width; and a processing order determined by the code order determining means. and a control means for controlling the color image data of color components having higher ranks to perform encoding processing according to power color component ranks.

また、第3には目的とする圧縮率を選択すると共に、選
択された圧縮率に応じて収めるべき目的の符号量および
前記暫定的量子化幅を決定する圧縮率選択手段と、前記
統計処理における可変長符号化された変換係数の画像全
体の符号量および各ブロック毎の符号量を算出する符号
量算出手段と、この符号量算出手段により算出された画
像全体の符号量と前記酸めるべき目的の符号量と前記暫
定的量子化幅とから前記符号化処理に使用する最適量子
化幅を予測すると共に、前記量子化手段にこの予測した
最適量子化幅を与える量子化幅予測手段と、符号化処理
時において、前記ブロックのうち、次に符号化処理する
処理対象ブロックの前に処理した処理済みブロックでの
符号化により発生した符号量と当該処理済みブロックで
の割当符号量との差を求めてこれと前記処理対象ブロッ
クの前記割当符号量とを加え、当該処理対象ブロックで
の割当符号量として割り当てる符号量割当手段と、符号
化処理時において、前記処理対象ブロックでの符号化の
際に前記符号量割当手段により割り当てられた割当符号
量を越えないように、前記可変長符号化を打ち切る符号
化打ち切り手段と、前記最適量子化幅にて量子化する際
の各色成分別の符号量予測値に応じ前記カラー画像デー
タの符号化処理における色成分別の処理順位を決定する
符号順決定手段と、この符号順決定手段により決定され
た処理すべき色成分順位に従い、順位の高い色成分の前
記カラー画像データより符号化処理させるべく制御する
制御手段とを備える。
Thirdly, a compression rate selection means for selecting a target compression rate and determining the target code amount to be accommodated and the provisional quantization width according to the selected compression rate; a code amount calculation means for calculating the code amount of the entire image of variable-length encoded transform coefficients and the code amount for each block; quantization width prediction means for predicting an optimal quantization width to be used in the encoding process from the target code amount and the provisional quantization width, and providing the predicted optimal quantization width to the quantization means; During encoding processing, the difference between the amount of code generated by encoding in the processed block processed before the next target block to be encoded among the blocks and the amount of code allocated to the processed block. and the code amount allocation means which adds this and the allocated code amount of the processing target block and allocates it as the allocated code amount of the processing target block; a coding aborting means for aborting the variable length coding so as not to exceed the allocated code amount allocated by the code amount allocating means; and a code for each color component when quantizing at the optimum quantization width. code order determining means for determining the processing order for each color component in the encoding process of the color image data according to the amount predicted value; and a control means for controlling encoding processing based on the component color image data.

また、第4には前記統計処理における可変長符号化され
た変換係数の画像全体の符号量および各ブロック毎の符
号量を算出する符号量算出手段と、この符号量算出手段
により算出された画像全体の符号量と収めるべき目的の
符号量と前記暫定的な量子化幅とから前記符号化処理に
使用する最適量子化幅を予Mlすると共に、前記量子化
手段にこの予測した最適量子化幅を与える量子化幅予測
手段と、符号化処理時において、前記ブロックのうち、
次に符号化処理する処理対象ブロックの前に処理した処
理済みブロックでの符号化により発生した符号量と当該
処理済みブロックでの割当符号量との差を求めてこれと
前記処理対象ブロックの前記割当符号量とを加え、当該
処理対象ブロックでの割当符号量として割り当てる符号
量割当手段と、符号化処理時において、前記処理対象ブ
ロックでの符号化の際に前記符号量割当手段により割り
当てられた割当符号量を越えないように、前記可変長符
号化を打ち切る符号化打ち切り手段と、前記最適量子化
幅にて量子化する際の各色成分別の符号量予測値に応じ
前記カラー画像データの符号化処理における色成分別の
処理順位を決定する符号順決定手段と、この符号順決定
手段により決定された処理すべき色成分順位に従い、順
位の高い色成分の前記カラー画像データより符号化処理
させるべく制御する制御手段とを備え、前記可変長符号
化手段は前記直交変換により得られる前記各ブロック単
位の画像データのうち、直流成分については前の処理ブ
ロックでの直流成分との差分を得ると共にこの差分を可
変長符号化する直流成分用の符号化処理部と、この直流
成分について符号化処理部の処理が終わった後、前記交
流成分について可変長符号化する交流成分用の符号化処
理部とを設け、前記符号化打ち切り手段は交流成分用の
符号化処理部にのみ設けて構成する。
Fourth, there is a code amount calculation means for calculating the code amount of the entire image and the code amount for each block of the variable-length encoded transform coefficients in the statistical processing, and the image calculated by the code amount calculation means. The optimum quantization width to be used in the encoding process is pre-Ml based on the total code amount, the target code amount to be stored, and the provisional quantization width, and the predicted optimum quantization width is sent to the quantization means. quantization width prediction means for giving
Next, find the difference between the amount of code generated by encoding in the processed block processed before the target block to be encoded and the allocated code amount in the processed block, and calculate the difference between this and the code amount allocated to the target block. and a code amount allocating means which adds the allocated code amount and allocates it as the allocated code amount in the processing target block; coding aborting means for aborting the variable length coding so as not to exceed the allocated code amount; and coding of the color image data according to the predicted code amount for each color component when quantizing with the optimum quantization width. code order determining means for determining the processing order of each color component in the encoding process; and according to the color component order to be processed determined by the code order determining means, the color image data of the color component having a higher rank is subjected to encoding processing. The variable length encoding means obtains the difference between the DC component and the DC component in the previous processing block among the image data for each block obtained by the orthogonal transformation, and a DC component encoding processing unit that variable-length encodes this difference; and an AC component encoding processing unit that performs variable-length encoding on the AC component after the encoding processing unit finishes processing the DC component. and the encoding aborting means is provided only in the AC component encoding processing section.

また、第5には目的とする圧縮率を選択すると共に、選
択された圧縮率に応じて収めるべき目的の符号量および
前記暫定的量子化幅を決定する圧縮率選択手段と、前記
統計処理における可変長符号化された変換係数の画像全
体の符号量および各ブロック毎の符号量を算出する符号
量算出手段と、この符号量算出手段により算出された画
像全体の符号量と収めるべき目的の符号量と前記暫定的
な量子化幅とから前記符号化処理に使用する最適量子化
幅を予測すると共に、前記量子化手段にこの予測した最
適量子化幅を与える量子化幅予測手段と、符号化処理時
において、前記ブロックのうち、次に符号化処理する処
理対象ブロックの前に処理した処理済みブロックでの符
号化により発生した符号量と当該処理済みブロックでの
割当符号量との差を求めてこれと前記処理対象プロ、ツ
クの前記割当符号量とを加え、当該処理対象ブロックで
の割当符号量として割り当てる符号量割当手段と、符号
化処理時において、前記処理対象ブロックでの符号化の
際に前記符号量割当手段により割り当てられた割当符号
量を越えないように、前記可変長符号化を打ち切る符号
化打ち切り手段と、前記最適量子化幅にて量子化する際
の各色成分別の符号量予測値に応じ前記カラー画像デー
タの符号化処理における色成分別の処理順位を決定する
符号順決定手段と、この符号順決定手段により決定され
た処理すべき色成分順位に従い、順位の高い色成分の前
記カラー画像データより符号化処理させるべく制御する
制御手段とを備え、前記可変長符号化手段は前記直交変
換により得られる前記各ブロック単位の画像データのう
ち、直流成分については前の処理ブロックでの直流成分
との差分を得ると共にこの差分を可変長符号化する直流
成分用の符号化処理部と、この直流成分について符号化
処理部の処理が終わった後、前記交流成分について可変
長符号化する交流成分用の符号化処理部とを設け、前記
符号化打ち切り手段は交流成分用の符号化処理部にのみ
設けて構成する。
Further, fifthly, a compression rate selection means for selecting a target compression rate and determining the target code amount to be accommodated and the provisional quantization width according to the selected compression rate; A code amount calculation means for calculating the code amount for the entire image and the code amount for each block of variable-length encoded transform coefficients, and the code amount for the entire image calculated by the code amount calculation means and the target code to be stored. quantization width prediction means for predicting an optimal quantization width to be used in the encoding process from the amount and the provisional quantization width, and providing the predicted optimal quantization width to the quantization means; At the time of processing, calculate the difference between the amount of code generated by encoding in the processed block processed before the block to be encoded next among the blocks and the amount of code allocated to the processed block. A code amount allocating means which adds this and the allocated code amount of the processing target block and allocates it as the allocated code amount in the processing target block, a coding aborting means for aborting the variable length coding so as not to exceed the allocated code amount allocated by the code amount allocating means; and a code for each color component when quantizing at the optimum quantization width. code order determining means for determining the processing order for each color component in the encoding process of the color image data according to the amount predicted value; control means for controlling the encoding processing based on the component color image data, and the variable length encoding means controls the previous processing for the DC component among the image data in units of blocks obtained by the orthogonal transformation. a DC component encoding processing unit that obtains a difference from a DC component in a block and encodes this difference into a variable length code; and after the encoding processing unit finishes processing this DC component, a variable length An encoding processing section for the alternating current component to be encoded is provided, and the encoding aborting means is provided only in the encoding processing section for the alternating current component.

符号量算出手段と、量子化幅予測手段と、符号量割り当
て手段と、符号化打ち切り手段と、符号化出力手段と、
制御手段とを備え、前記可変長符号化手段は前記直交変
換により得られる前記各ブロック単位の画像データのう
ち、直流成分について前のブロックでの直流成分との差
分を得ると共にこの差分を可変長符号化する直流成分用
の符号化処理部と、この直流成分の符号化処理部の処理
が終わった後、前記交流成分について可変長符号化する
交流成分用の符号化処理部とを設け、前記符号化打ち切
り手段は交流成分用の符号化処理部にのみ設けて構成す
る。
a code amount calculation means, a quantization width prediction means, a code amount allocation means, a coding abort means, a coding output means,
The variable length encoding means obtains a difference between the DC component and the DC component in the previous block among the image data in units of blocks obtained by the orthogonal transformation, and converts this difference into a variable length coder. An encoding processing unit for the DC component to be encoded, and an encoding processing unit for the AC component that performs variable length encoding on the AC component after the processing of the DC component encoding processing unit is completed, and the The encoding aborting means is provided only in the encoding processing section for AC components.

また、第6には色成分別に分離されたカラー画像データ
をブロックに分割し、この分割されたブロック毎に直交
変換を行ってからこの変換出力を量子化手段により量子
化し、その後、この量子化出力を可変長符号化手段に与
えて可変長符号化し、データの符号化を行う際に、予め
求めた各ブロック毎の統計量から決定した各ブロック毎
の割当符号量に従って各ブロック毎に符号量制御を行い
ながら可変長符号化を行うにあたり、前記量子化を暫定
的な量子化幅を使用して行い、これにより得た量子化出
力について符号化処理を行い、最適化するに必要な画像
全体の符号量および各ブロック毎の符号量を調べる第1
のステップと、この第1のステップで得た画像全体の符
号量から最適化に必要な量子化幅の予測を行うと共に、
この予測した量子化幅から各色成分の符号化順位を決定
する第2のステップと、前記各ブロックの符号量から各
ブロック毎の基準割当符号量を求める第3のステップと
、前記予測した量子化幅を用いて前記各ブロック毎の前
記量子化を行う第4のステップと、この第4のステップ
での前記各ブロ、7り毎の量子化出力をそのブロックに
対する割当符号量に収まる範囲で可変長符号化する第5
のステップと、前記第5のステップにおける現在可変長
符号化処理しようとするブロックの、直前に処理したブ
ロックでの可変長符号化による符号量とそのブロックで
の割当符号量との差を求め、これを繰り越し量として前
記現在処理しようとするブロックでの前記基準割当符号
量に加算し、前記現在処理しようとするブロックでの割
当符号量とする第6のステップとを含み、 前記第4のステップは前記第2のステップで得た各色成
分の符号化順位に従って符号化を実施することを特徴と
する。
Sixthly, the color image data separated by color component is divided into blocks, orthogonal transformation is performed for each divided block, and the output of this transformation is quantized by a quantization means. The output is given to variable length encoding means to be variable length encoded, and when encoding data, the amount of code is assigned to each block according to the amount of allocated code for each block determined from the statistics for each block determined in advance. When performing variable length encoding while performing control, the quantization is performed using a provisional quantization width, and the resulting quantized output is encoded to generate the entire image necessary for optimization. The first step is to check the amount of code and the amount of code for each block.
In addition to predicting the quantization width necessary for optimization from the code amount of the entire image obtained in the first step,
a second step of determining the coding order of each color component from the predicted quantization width; a third step of determining a standard allocated code amount for each block from the code amount of each block; and a third step of determining the coding order of each color component from the predicted quantization width. A fourth step of performing the quantization for each block using the width, and varying the quantization output for each block and block in this fourth step within the allocated code amount for the block. 5th long code
of the block to be currently subjected to variable-length encoding processing in the fifth step, determining the difference between the code amount due to variable-length encoding in the block processed immediately before and the allocated code amount in that block; a sixth step of adding this amount as a carryover amount to the reference allocated code amount for the block to be currently processed, and setting it as the allocated code amount for the block to be currently processed; is characterized in that encoding is performed according to the encoding order of each color component obtained in the second step.

〔作 用〕[For production]

このような構成において、色成分別に分離されたカラー
画像データそれぞれを所定画素数のブロックに分割し、
色成分別のこの分割されたブロック毎に直交変換を行っ
てからこの変換出力を量子化手段により量子化し、その
後、この量子化出力を可変長符号化手段に与えて可変長
符号化し、データの符号化を行う際に、初めに暫定的に
定めた量子化幅で量子化して可変長符号化し、各ブロッ
ク毎の符号量を得る統計処理を行い、次にこの統計処理
により求めた各ブロック毎の符号量から最適量子化幅と
各ブロック毎の割当符号量とを決定し、この決定した最
適量子化幅に従って各ブロック毎の前記変換出力の量子
化を行うと共にこの量子化出力を各ブロック毎の割当符
号量に従って各ブロック毎に符号量制御を行いながら順
次可変長符号化する符号化処理を実施するか、第1の構
成の場合、符号量割当手段は前記ブロックのうち、次に
符号化処理する処理対象ブロックの前に処理した処理済
みブロックでの符号化により発生した符号量と当該処理
済みブロックでの割当符号量との差を求めてこれと前記
処理対象ブロックの前記割当符号量とを加え、当該処理
対象ブロックでの割当符号量として割り当てる。そして
、符号化打ち切り手段は前記処理対象ブロックでの符号
化処理時に前記符号量割当手段により割り当てられた割
当符号量を越えないように、前記可変長符号化を打ち切
る。一方、符号順決定手段は前記最適量子化幅にて量子
化する際の各色成分別の符号量予測値に応し前記カラー
画像データの符号化処理における色成分別の処理順位を
決定し、制御手段はこの符号順決定手段により決定され
た処理すべき色成分順位に従い、順位の高い色成分の前
記カラー画像データより符号化処理させるべく制御する
In such a configuration, each color image data separated by color component is divided into blocks of a predetermined number of pixels,
After performing orthogonal transformation for each of these divided blocks for each color component, this transform output is quantized by a quantization means, and then this quantization output is given to a variable length encoding means to be variable length encoded, and the data is When performing encoding, first quantize with a provisionally determined quantization width, perform variable length encoding, perform statistical processing to obtain the code amount for each block, and then perform statistical processing to obtain the code amount for each block. The optimum quantization width and the allocated code amount for each block are determined from the code amount, and the transform output for each block is quantized according to the determined optimum quantization width, and this quantization output is quantized for each block. In the first configuration, the code amount allocating means performs coding processing to sequentially perform variable length encoding while controlling the code amount for each block according to the allocated code amount, or in the case of the first configuration, the code amount allocating means performs encoding The difference between the amount of code generated by encoding in the processed block processed before the target block to be processed and the allocated code amount in the processed block is calculated, and this and the allocated code amount of the target block are calculated. is added and allocated as the allocated code amount for the block to be processed. Then, the encoding aborting means aborts the variable length encoding so as not to exceed the allocated code amount allocated by the code amount allocating means during the encoding process on the processing target block. On the other hand, the code order determining means determines the processing order for each color component in the encoding process of the color image data according to the predicted code amount for each color component when quantizing with the optimum quantization width, and controls the The means performs control in accordance with the order of color components to be processed determined by the code order determining means, so that the color image data of color components having higher ranks are subjected to encoding processing.

また、第2の構成の場合、符号量割当手段は前記ブロッ
クのうち、次に符号化処理する処理対象ブロックの前に
処理した処理済みブロックでの符号化により発生した符
号量と当該処理済みブロックでの割当符号量との差を求
めてこれと前記処理対象ブロックの前記割当符号量とを
加え、当該処理対象ブロックでの割当符号量として割り
当てる。そして、符号化打ち切り手段は前記処理対象ブ
ロックでの符号化処理時に前記符号量割当手段により割
り当てられた割当符号量を越えないように、前記可変長
符号化を打ち切る。一方、符号順決定手段は前記暫定的
に定めた量子化幅と最適量子化幅より前記カラー画像デ
ータの符号化処理における色成分別の処理順位を決定し
、制御手段はこの符号順決定手段により決定された処理
すべき色成分順位に従い、順位の高い色成分の前記カラ
ー画像データより符号化処理させるべく制御する。
In the case of the second configuration, the code amount allocation means includes the code amount generated by encoding in a processed block processed before the next target block to be encoded among the blocks, and the code amount generated by encoding in the processed block. The difference between the allocated code amount and the allocated code amount of the processing target block is calculated, and this difference is added to the allocated code amount of the processing target block, and the difference is allocated as the allocated code amount of the processing target block. Then, the encoding aborting means aborts the variable length encoding so as not to exceed the allocated code amount allocated by the code amount allocating means during the encoding process on the processing target block. On the other hand, the code order determining means determines the processing order for each color component in the encoding process of the color image data from the tentatively determined quantization width and the optimum quantization width, and the control means uses the code order determining means to determine the processing order for each color component in the encoding process of the color image data. In accordance with the determined ranking of color components to be processed, control is performed so that the color image data of color components with higher rankings are subjected to encoding processing.

以上は、統計処理時に暫定的な量子化幅を用いての発生
符号の状態を知り、これらの情報から最適量子化幅を予
測し、かつ、符号量から例えば符号量の少ない色成分か
ら符号化処理するように色成分の処理順位を決め、また
、各ブロック毎の基準割当符号量を決杓、符号化処理は
この処理順位に従って順位の高い(つまり上位のもの)
色成分から開始し、各ブロックの符号化に当たってはそ
のブロックの基準割当符号量に、その前のブロックでの
符号化における符号量と割当符号量の差を繰り越し量と
して加算して割当符号量とし、この割当符号量に収まる
範囲で符号化してゆくと云ったもので、例えば、符号量
の少ない色成分のものから処理を開始すると、先に処理
した色成分の割当符号量の未消化骨を繰り越し分として
後の色成分の符号化に振り向けることができることから
、符号量を多く必要とする色成分では各ブロックでの符
号化打ち切りが少なくなり、画質向上に寄与すると共に
、符号化処理の回数を規定回数に定めると符号化に要す
る時間は一定とすることができる。
The above describes how to know the state of the generated code using the provisional quantization width during statistical processing, predict the optimal quantization width from this information, and calculate the code amount from the color component with the least amount of code, for example. Decide the processing order of the color components to be processed, and also decide the standard allocated code amount for each block, and encode according to this processing order (in other words, the top one)
Starting from the color component, when encoding each block, the difference between the code amount and the allocated code amount in the encoding of the previous block is added as a carryover amount to the standard allocated code amount of that block to obtain the allocated code amount. For example, if you start processing from a color component with a small amount of code, the unused portion of the allocated code amount of the previously processed color component will be encoded within the allocated code amount. Since the carryover amount can be used for encoding later color components, there is less need to abort encoding in each block for color components that require a large amount of code, which contributes to image quality improvement and reduces the time required for encoding processing. By setting the number of times to a specified number, the time required for encoding can be kept constant.

また、第3の構成の場合、目的とする圧縮率を選択する
と、圧縮率選択手段はこの選択された圧縮率に応じて収
めるべき目的の符号量および前記暫定的量子化幅を決定
する。また、符号量算出手段は前記統計処理における可
変長符号化された変換係数の画像全体の符号量および各
ブロック毎の符号量を算出し、量子化幅予測手段はこの
符号量算出手段により算出された画像全体の符号量と前
記収めるべき目的の符号量と前記暫定的量子化幅とから
前記符号化処理に使用する最適量子化幅を予測すると共
に、前記量子化手段にこの予測した最適量子化幅を与え
る。そして、符号量割当手段は符号化処理時において、
前記ブロックのうち、次に符号化処理する処理対象ブロ
ックの前に処理した処理済みブロックでの符号化により
発生した符号量と当該処理済みブロックでの割当符号量
トの差を求めてこれと前記処理対象ブロックの前記割当
符号量とを加え、当該処理対象ブロックでの割当符号量
として割り当てる。また、符号化打ち切り手段は符号化
処理時において、前記処理対象ブロックでの符号化の際
に前記符号量割当手段により割り当てられた割当符号量
を越えないように、前記可変長符号化を打ち切る。符号
順決定手段は前記最適量子化幅にて量子化する際の各色
成分別の符号量予測値に応じ前記カラー画像データの符
号化処理における色成分別の処理順位を決定し、制御手
段はこの符号順決定手段により決定された処理すべき色
成分順位に従い、順位の高い色成分の前記カラー画像デ
ータより符号化処理させるべく制御する。
In the case of the third configuration, when a target compression rate is selected, the compression rate selection means determines the target code amount to be accommodated and the provisional quantization width according to the selected compression rate. Further, the code amount calculation means calculates the code amount of the entire image of the variable-length encoded transform coefficient in the statistical processing and the code amount for each block, and the quantization width prediction means calculates the code amount of the entire image and the code amount for each block. The optimum quantization width to be used in the encoding process is predicted from the code amount of the entire image, the target code amount to be stored, and the provisional quantization width, and the predicted optimum quantization width is applied to the quantization means. Give width. Then, during the encoding process, the code amount allocation means
Among the blocks, the difference between the amount of code generated by encoding in the processed block processed before the block to be encoded next and the allocated code amount in the processed block is calculated. The allocated code amount of the block to be processed is added to the allocated code amount for the block to be processed. Furthermore, the encoding aborting means aborts the variable length encoding during encoding processing so as not to exceed the allocated code amount allocated by the code amount allocating means during encoding of the processing target block. The code order determining means determines the processing order for each color component in the encoding process of the color image data according to the predicted code amount for each color component when quantizing with the optimum quantization width, and the control means In accordance with the order of color components to be processed determined by the code order determining means, control is performed so that the color image data of color components with higher ranks are subjected to encoding processing.

この方式では第1および第2の構成の作用と効果に加え
、目的とする圧縮率を選択することができ、これに対応
じて暫定的量子化幅と収めるべき1画像力たりの目的の
符号量を定めて統計処理を行うので、所望の符号量に収
まる最適量子化幅をより精度良く見付けることができる
ようになる利点が得られる。
In this method, in addition to the functions and effects of the first and second configurations, the target compression rate can be selected, and the provisional quantization width and the target code per image power to be accommodated can be selected accordingly. Since the amount is determined and statistical processing is performed, an advantage is obtained that the optimum quantization width that fits within the desired code amount can be found with higher accuracy.

また、第4の構成の場合、符号量算出手段は前記統計処
理における可変長符号化された変換係数の画像全体の符
号量および各ブロック毎の符号量を算出し、量子化幅予
測手段はこの符号量算出手段により算出された画像全体
の符号量と収めるべき目的の符号量と前記暫定的な量子
化幅とから前記符号化処理に使用する最適量子化幅を予
測すると共に、前記量子化手段にこの予測した最適量子
化幅を与える。また、符号量割当手段は、符号化処理時
において、前記ブロックのうち、次に符号化処理する処
理対象ブロックの前に処理した処理済みブロックでの符
号化により発生した符号量と当該処理済みブロックでの
割当符号量との差を求めてこれと前記処理対象ブロック
の前記割当符号量とを加え、当該処理対象ブロックでの
割当符号量として割り当てる。また、符号化打ち切り手
段は符号化処理時において、前記処理対象ブロックでの
符号化の際に前記符号量割当手段により割り当てられた
割当符号量を越えないように、前記可変長符号化を打ち
切る。一方、符号順決定手段は前記最適量子化幅にて量
子化する際の各色成分別の符号量予測値に応−し前記カ
ラー画像データの符号化処理における色成分別の処理順
位を決定し、制御手段はこの決定された処理すべき色成
分順位に従い、順位の高い色成分の前記カラー画像デー
タより符号化処理させるべく制御する。
Further, in the case of the fourth configuration, the code amount calculation means calculates the code amount of the entire image and the code amount for each block of the variable-length encoded transform coefficient in the statistical processing, and the quantization width prediction means calculates the code amount of the entire image and the code amount for each block. Predicting the optimum quantization width to be used in the encoding process based on the code amount of the entire image calculated by the code amount calculation means, the target code amount to be stored, and the provisional quantization width, and predicting the optimum quantization width to be used in the encoding process, and This predicted optimal quantization width is given to . Further, during the encoding process, the code amount allocation means calculates the amount of code generated by the encoding of the processed block processed before the block to be encoded next among the blocks, and the code amount of the processed block. The difference between the allocated code amount and the allocated code amount of the processing target block is calculated, and this difference is added to the allocated code amount of the processing target block, and the difference is allocated as the allocated code amount of the processing target block. Furthermore, the encoding aborting means aborts the variable length encoding during encoding processing so as not to exceed the allocated code amount allocated by the code amount allocating means during encoding of the processing target block. On the other hand, the code order determining means determines the processing order for each color component in the encoding process of the color image data according to the predicted code amount for each color component when quantizing with the optimum quantization width, The control means performs control in accordance with the determined order of the color components to be processed, so that the color image data of the color component having a higher order is subjected to encoding processing.

ここで、前記可変長符号化手段は前記直交変換により得
られる前記各ブロック単位の画像データのうち、直流成
分については前の処理ブロックでの直流成分との差分を
得ると共にこの差分を可変長符号化し、この直流成分に
ついて符号化処理部の処理が終わった後、前記交流成分
について可変長符号化すると共に前記符号化打ち切りは
交流成分用の符号化処理においてのみ、実施する。
Here, the variable-length encoding means obtains a difference between the DC component and the DC component in the previous processing block among the image data for each block obtained by the orthogonal transformation, and converts this difference into a variable-length code. After the DC component has been processed by the encoding processing section, the AC component is variable-length encoded, and the encoding is terminated only in the encoding process for the AC component.

従って、上記第1、第2のケースに、さらに符号化処理
時の符号化打ち切りを交流成分に対してのみとしたこと
て視覚上、影響の少ない高い周波数領域の打ち切りに止
めることかでき、画質の劣化を防止できる。
Therefore, in addition to the first and second cases above, it is possible to abort only the alternating current component during the encoding process, thereby limiting the abort to the high frequency region that has little visual impact, and improves image quality. can prevent deterioration.

第5のケースでは目的とする圧縮率を選択することがで
きる結果、第4の構成の効果に加え、第3のケースの効
果が得られる。
In the fifth case, the desired compression ratio can be selected, and as a result, the effects of the third case can be obtained in addition to the effects of the fourth configuration.

第6の場合では、量子化を暫定的な量子化幅にて行い、
これにより得た量子化出力について符号化処理を行い、
最適化するに必要な画像全体の符号量および各ブロック
毎の符号量を調べ、これにより得た画像全体の符号量か
ら最適化に必要な量子化幅の予測を行うと共に、この予
測した量子化幅から各色成分の符号化順位を決定し、前
記各ブロックの符号量から各ブロック毎の基準割当符号
量を求め、ついで前記予測した量子化幅を用いて前記各
ブロック毎の前記量子化を行い、ここで得た前記各ブロ
ック毎の量子化出力を、そのブロックに対する割当符号
量に収まる範囲て可変長符号化する。一方、現在可変長
符号化処理しようとするブロックの、直前に処理したブ
ロックでの可変長符号化による符号量とそのブロックで
の割当符号量との差を求め、これを繰り越し量として前
記現在処理しようとするブロックでの前記基準割当符号
量に加算し、前記現在処理しようとするブロックでの割
当符号量とし、この割当符号量の範囲で符号化すなわち
、可変長符号化をする。前記予測した量子化幅を用いて
の量子化にあたっては、前記各色成分の符号化順位に従
って行う。
In the sixth case, quantization is performed with a provisional quantization width,
Perform encoding processing on the quantized output obtained by this,
The amount of code required for the entire image and the amount of code for each block required for optimization are examined, and the quantization width required for optimization is predicted from the amount of code for the entire image obtained. Determining the coding order of each color component from the width, determining the standard allocated code amount for each block from the code amount of each block, and then performing the quantization for each block using the predicted quantization width. The quantized output for each block obtained here is variable-length encoded within the amount of code allocated to that block. On the other hand, the difference between the amount of code generated by variable length coding in the block processed immediately before the block to be currently subjected to variable length coding processing and the amount of allocated code for that block is calculated, and this is used as the carryover amount for the current processing. The code amount is added to the standard allocated code amount for the block to be processed, and the allocated code amount is set as the allocated code amount for the block to be currently processed, and encoding, that is, variable length encoding is performed within the range of this allocated code amount. Quantization using the predicted quantization width is performed according to the coding order of each color component.

このように、最初に暫定的な量子化幅を用いての発生符
号の状態を知り、これらの情報から最適量子化幅を予測
し、かつ、符号量から例えば符号量の少ない色成分から
符号化処理するように色成分の処理順位を決め、また、
各ブロック毎の基準割当符号量を決め、符号化処理はこ
の処理順位に従って順位の高い(つまり上位のもの)色
成分から開始し、各ブロックの符号化に当たってはその
ブロックの基準割当符号量に、その前のブロックでの符
号化における符号量と割当符号量の差を繰り越し量とし
て加算して割当符号量とし、この割当符号量に収まる範
囲で符号化してゆくので、例えば、符号量の少ない色成
分のものから処理を開始すると、先に処理した色成分の
割当符号量の未消化分を繰り越し分として後の色成分の
符号化に振り向けることができることがら、符号量を多
く必要とする色成分では各ブロックでの符号化打ち切り
か少なくなり、画質向上に寄与すると共に、符号化処理
の回数を規定回数に定めると符号化に要する時間は一定
とすることができる。
In this way, the state of the generated code is first known using the provisional quantization width, the optimal quantization width is predicted from this information, and the code amount is determined from the amount of code, for example, from the color component with the smallest amount of code. Decide the processing order of the color components to be processed, and
The standard allocated code amount for each block is determined, and the encoding process starts from the color component with a higher rank (that is, the higher ranking one) according to this processing order, and when encoding each block, the standard allocated code amount for that block is The difference between the amount of code encoded in the previous block and the amount of allocated code is added as a carryover amount to obtain the allocated amount of code, and the code is encoded within the range of this allocated amount of code. If you start processing from the component, the unused portion of the allocated code amount for the color component processed first can be carried over and used for encoding the later color component, so colors that require a large amount of code can be In the component, the number of coding stops in each block is reduced, contributing to improved image quality, and if the number of times of coding processing is set to a prescribed number, the time required for coding can be kept constant.

このように本発明は最初に統計処理を行い、この統計処
理により最適な量子化幅の予測と、各ブロックの割当符
号量の決定に必要な統計量を得、また各色成分の符号化
する順序を決め、これらの情報をもとに符号化の処理に
入り、決定した各色成分の符号化する順序に従って順次
、符号化出力を見ながら、各ブロックの割当符号量と前
のブロックまでの割当符号量の過不足を合わせてえられ
たそのブロックの割当符号量内に収まるように、可変長
符号化を打ち切ることでブロック毎に符号量を制御し、
所望の符号量内で収まった符号化出力を最終出力として
得るようにしたものである。
In this way, the present invention first performs statistical processing, and through this statistical processing, obtains the statistics necessary for predicting the optimal quantization width and determining the amount of code allocated to each block, and also calculates the order in which each color component is encoded. Based on this information, we start the encoding process, and while looking at the encoded output sequentially according to the determined coding order of each color component, we calculate the allocated code amount for each block and the allocated codes up to the previous block. The code amount is controlled for each block by discontinuing variable length coding so that the amount of code is within the allocated code amount of the block obtained by combining the excess and deficiency of the amount.
The encoded output within the desired code amount is obtained as the final output.

これは、次に示す考え方によるものである。This is based on the following idea.

従来例で説明したように、符号化するときの量子化係数
が特に大きかったり小さいとき、言い換えると特に空間
周波数の高いあるいは低い画像の場合においては、各ブ
ロックの統計量に応じて目的の符号量を比例配分するこ
とによって割当符号量を決定すると、その子11された
量子化係数を用いて実際に符号化を行うと輝度成分のブ
ロックにおいては割当符号量か不十分で色差成分のブロ
ックでは余分である、あるいはその逆になることがある
。すると、符号量の不十分だった色成分の方は符号化を
途中で打ち切られるので、当然画質が劣化する。このよ
うな現象が発生するかどうか、輝度における割当符号量
が不足するか1色差における割当符号量か不足するかは
、式(2)のa、と式(3)のac  の大小関係と予
測された量子化係数の大小によって容易に判断すること
ができるが、これは、つまりはシステムと画像によって
決まるものである。そこで、割り当て符号の余分な分を
以降のブロックの符号量に回すとともに、前述の関係か
ら割当符号量が余分になる色成分から符号化を行うよう
に順番を決定し、その順番に従ってブロック毎の符号量
制御を行いながら符号化を実施する。
As explained in the conventional example, when the quantization coefficient during encoding is particularly large or small, in other words, in the case of an image with a particularly high or low spatial frequency, the target code amount is determined according to the statistics of each block. When the allocated code amount is determined by proportionally distributing the quantized coefficients, when actual encoding is performed using the quantized coefficients, the allocated code amount is insufficient for the luminance component block and excessive for the chrominance component block. Yes, or vice versa. Then, the encoding of the color component for which the amount of code is insufficient is aborted midway, and the image quality naturally deteriorates. Whether such a phenomenon occurs or not, whether there is a shortage of allocated code for luminance or for one color difference, depends on the magnitude relationship between a in equation (2) and ac in equation (3) and prediction. This can be easily determined by the magnitude of the quantization coefficients, but this is determined by the system and the image. Therefore, in addition to using the extra allocated code for the code amount of the subsequent blocks, we decided on the order in which the color components with the extra allocated code amount are encoded based on the above-mentioned relationship, and according to that order, the code amount for each block was determined. Encoding is performed while controlling the amount of code.

各色成分を合わせて考えれば、予測した量子化係数を用
いて符号化することにより、ブロック毎の符号量制御を
しなくても目標の符号量にかなり近い値となるので、符
号量が余分になる色成分から符号化を行えば、その割当
符号量は余ることになり、符号量の不足する色成分の割
当符号量の不足分を補うことができ、各色成分ともに良
好な結果が得られる。逆に、もし符号量の不足する色成
分から符号化を実施したとすると、その色成分では次々
と符号化の打ち切りが発生するので画像は劣化し、符号
量の余分になる色成分では次々と符号が余り、その余り
は全く無駄になってしまう。
Considering each color component together, by encoding using the predicted quantization coefficient, the value will be quite close to the target code amount without having to control the code amount for each block, so the amount of code will be unnecessary. If encoding is performed from the color components, the allocated code amount will be left over, and the shortage in the allocated code amount of the color component with insufficient code amount can be compensated for, and good results can be obtained for each color component. On the other hand, if encoding is performed starting from a color component with insufficient code amount, the image will deteriorate because the coding will be discontinued one after another for that color component, and the color component with excess code amount will be decoded one after another. There will be a surplus of codes, and the remainder will be completely wasted.

従って、この発明によれば、幅広い空間周波数の画像に
対し、画質をなるべく損なわずに、簡単な回路により一
定の処理時間内で一定の符号量内に収まるように符号化
できるようになる。
Therefore, according to the present invention, it becomes possible to encode images with a wide range of spatial frequencies within a certain amount of code within a certain processing time using a simple circuit without degrading the image quality as much as possible.

〔実施例〕〔Example〕

以下、本発明の実施例について、図面を参照して説明す
る。本発明はカラー画像データを圧縮符号化する場合に
おいて、従来、各色成分毎に所定の符号量範囲内に収ま
るように処理していたことにより、色成分によっては符
号量に余裕があり、他方では不足すると云ったことが生
しると、不足した色成分の側では高い周波数成分をカッ
トする事態が続出し、一方の色成分ではこのような事態
が生ぜずにむしろ符号量が余り気味であるというような
不合理が生じる。これを余り気味となる可能性のある色
成分を先に圧縮符号化し、余った分を不足気味の色成分
に振り向けることで解消する。
Embodiments of the present invention will be described below with reference to the drawings. When compressing and encoding color image data, the present invention conventionally processes each color component so that it falls within a predetermined code amount range. When a shortage occurs, high frequency components are often cut on the side of the insufficient color component, while this situation does not occur for the other color component, and the amount of code is rather excessive. This kind of irrationality occurs. This can be resolved by compressing and encoding the color components that are likely to be in excess first, and allocating the surplus to color components that are likely to be in short supply.

初めに本発明を分かり易くするために、本発明の基本的
な考え方を説明しておく。
First, in order to make the present invention easier to understand, the basic idea of the present invention will be explained.

すなわち、本発明は例えば、1つのカラー画像(画面)
を色成分毎に分け、これら色成分別のカラー画像データ
を所定画素数サイズのブロックに区分し、これら各ブロ
ックを順に、ブロック単位でそのブロックの構成画素の
データを直交変換してこれを更に量子化し、圧縮符号化
し、圧縮符号化した各色成分の総符号量が目的の符号量
に収まるように符号化するにあたり、最初に色成分に分
離されたカラー画像データに対して統、−1処理を行い
、この統計処理により最適な量子化幅の予測と、各プロ
′ツクの基準割当符号量の決定に必要な統計量を得、ま
た予測した量子化幅からどの色成分から符号化処理を始
めるか、その各色成分の符号化順位を決める。そして、
これらの情報をもとに符号化処理の順位の高いものから
実際の符号化処理を実施する。符号化は色成分別に行う
か、符号化処理はブロック順に順次、ブロック毎に行い
、その符号化出力を見ながら、各ブロックの基準割当符
号量と、その処理ブロックの1つ前のブロックでの発生
符号量における割当符号量に対しての過不足量を合わせ
て得られたそのブロックの割当符号量内に収まるように
、可変長符号化によって得られる符号量を監視しながら
、符号化を進め、EOB符号を含め、発生符号量が割当
符号量に達するとそのブロックの符号化は終了させるが
、直流成分は割当符号量を越える場合でも必ず符号化さ
せ、そのときの割当符号量に対する過不足量を記憶して
おき、次のブロツ先の符号化に移っていくというもので
ある。
That is, the present invention, for example, uses one color image (screen)
The color image data for each color component is divided into blocks of a predetermined number of pixels, and each block is further processed by orthogonally transforming the data of the constituent pixels of that block. When quantizing, compression-encoding, and encoding so that the total code amount of each compression-encoded color component falls within the target code amount, the color image data separated into color components is first processed by -1. Through this statistical processing, we obtain the statistics necessary to predict the optimal quantization width and determine the standard allocated code amount for each program, and also determine from which color component to start the encoding process based on the predicted quantization width. The coding order of each color component is determined. and,
Based on this information, actual encoding processing is performed starting from the one with the highest encoding processing rank. Encoding is performed for each color component, or the encoding process is performed block by block in block order, and while looking at the encoded output, the standard allocated code amount for each block and the block before the processing block are determined. Encoding is performed while monitoring the code amount obtained by variable length encoding so that the amount of generated code is within the allocated code amount of the block obtained by adding up the excess or deficiency of the allocated code amount. When the generated code amount, including EOB code, reaches the allocated code amount, the encoding of that block is terminated, but the DC component is always encoded even if it exceeds the allocated code amount, and the excess or deficiency of the allocated code amount at that time is determined. The amount is memorized and the next block is encoded.

統計処理は最適な量子化幅を予測するとともに、予測し
た量子化幅から各色成分の符号化する順序を決め、さら
に各ブロック毎の割当符号量を決定するための基準とな
る統計量を得るためのものである。
Statistical processing predicts the optimal quantization width, determines the coding order of each color component from the predicted quantization width, and obtains statistics that serve as a reference for determining the amount of code allocated to each block. belongs to.

この最適化された量子化幅を符号化処理で使用すること
で、はぼ目的の符号量に近付けることができるが、1画
像のデータ量の上限が規定されている場合、1バイトは
おろか、1ビツトでも目的の符号量をオーバすることは
できない。
By using this optimized quantization width in the encoding process, it is possible to get close to the desired amount of code, but if the upper limit of the amount of data for one image is specified, let alone 1 byte, Even one bit cannot exceed the target code amount.

そこで、ブロック毎の標準的な割当符号量である基準割
当符号量を決め、この基準割当符号量に、そのブロック
の1つ前の処理ブロックでの割当符号量に対する発生符
号量を差し引いた残りを繰り越し分として貰い、この繰
り越し分を加えて補正した割当符号量を当該ブロックで
の符号化処理の最大枠として、特別の場合を除き、これ
に収まる範囲で符号化するよう符号化制御を行う。
Therefore, a standard allocated code amount, which is the standard allocated code amount for each block, is determined, and the remainder obtained by subtracting the generated code amount from the allocated code amount in the processing block immediately before the block from this standard allocated code amount. The allocated code amount obtained as a carryover amount and corrected by adding this carryover amount is set as the maximum limit for encoding processing in the block, and encoding control is performed so that encoding is performed within this range, except in special cases.

この繰り越しによる割当符号量の調整は、符号化を行っ
たときの符号量かブロック毎に異なるので、余りの生し
るブロックではその余り分を、不足の生しるブロックに
融通して、全体として目的の符号量に収まるように合理
的に配分するためである。これにより、基準符号量をオ
ーバしたときの微調整の機能が得られることになる。各
ブロックの符号化において低い周波数成分がら高い周波
数成分に順次、符号化しながら、ガイドライン(1ブロ
ツク当たりの割当符号量)を越えた時点で、それ以上の
高周波成分の符号化を打ち切る。
Adjustment of the allocated code amount by this carryover differs depending on the code amount at the time of encoding, so in the block where there is a surplus, the surplus is transferred to the block where there is a shortage, and the overall code amount is adjusted by carrying over. This is to rationally allocate the data within the target code amount. This provides a function for fine adjustment when the standard code amount is exceeded. In encoding each block, low frequency components are encoded sequentially from high frequency components, and when the guideline (allocated code amount per block) is exceeded, encoding of further high frequency components is discontinued.

これは、視覚的な影響を最小にするために、各ブロック
の高い周波数成分から省略して行くためである。この交
流成分の打ち切りに関しては、高い周波数成分は特に周
波数か高くなる程、視覚的影響が少ないと云う傾向があ
ることを逆に利用している。
This is because high frequency components of each block are omitted to minimize visual impact. Regarding the termination of the alternating current component, the fact that high frequency components tend to have less visual impact especially as the frequency becomes higher is utilized.

EOBを含めて発生した符号量か、割り当てられた符号
量よりも少なかった、あるいはちょうと同したったブロ
ックは、問題なく符号化を終了、つまり、EOBを圧力
する。そして、その余りを1ブロツクの割当符号量に加
え、次のブロックの割当符号量とする。途中てオーバー
してしまうブロックは符号化を打ち切り、そのブロック
の符号化を終了、つまり、EOBを出力する。そして、
その余りを1ブロツクの割当符号量に加え、次のブロッ
クの割当符号量とする。極端に圧縮率を高くしない限り
現実にはあり得ないか、万一、与えられた割当符号量か
直流成分さえも符号化するに足りない場合には、直流成
分のみは符号化を実施し、そのブロックの符号化を終了
、つまり、EOBを出力する。
For blocks whose amount of code generated including EOB is less than or exactly the same as the allocated code amount, coding is completed without any problem, that is, the EOB is pushed. Then, the remainder is added to the allocated code amount for one block, and is used as the allocated code amount for the next block. Encoding of a block that exceeds the limit is terminated, and the encoding of that block is terminated, that is, an EOB is output. and,
The remainder is added to the allocated code amount for one block, and is used as the allocated code amount for the next block. This is not possible in reality unless the compression rate is extremely high, or in the unlikely event that the allocated amount of code is not enough to encode even the DC component, only the DC component will be encoded. The encoding of the block is completed, that is, the EOB is output.

そして、足りなかった符号量は不足分として、次のブロ
ックに繰り越し、その不足分を1ブロツクの割当符号量
から減じ、次のブロックに繰り越し、その不足分を1ブ
ロツクの割当符号量から減し、次のブロックの割当符号
量とする。この時、EOBも符号の一つであるから、E
OBも含めて割当符号量内に収まるようにする。
Then, the insufficient amount of code is carried over to the next block as a shortage, the shortage is subtracted from the allocated code amount of one block, carried over to the next block, and the shortage is subtracted from the allocated code amount of one block. , is the allocated code amount for the next block. At this time, since EOB is also one of the codes, E
The amount of code including OB should be within the allocated code amount.

この時、割当符号量を無駄にしないようにするのが本発
明の目的であり、発生符号量の割当符号量に対する余剰
分を以降のブロックの割当符号量へと繰り越すとともに
、前述のように符号量が余分になる色成分から符号化を
行えば、その割当符号量は余ることにより、符号量の不
足する色成分の割当符号量の不足分を補うことができ、
各色成分ともに良好な結果が得られる。
At this time, the purpose of the present invention is to prevent the allocated code amount from being wasted. If encoding is performed from a color component with an excess amount, the amount of allocated code will be left over, which can compensate for the shortage of the amount of allocated code for the color component with a shortage of code amount.
Good results are obtained for each color component.

以上から、特に空間周波数の高い、あるいは低い画像の
場合において、各ブロックの統計量に応じて目的の符号
量を比例配分し、割当符号量を決定した場合、予測され
た量子化係数を用いて実際に符号化を行った際、輝度成
分のブロックにおいては割当符号量が不十分で色差成分
のブロックでは余分となったり、あるいはその逆になる
ことがあり、符号量が不十分となった色成分の方は符号
化を途中で打ち切られるので、当然画質が劣化するが、
本発明により幅広い空間周波数の画像に対し、画質をな
るべく損なわずに、一定の処理時間内て一定の符号量内
に収まるように符号化できるようになる。
From the above, especially in the case of images with high or low spatial frequencies, if the target code amount is proportionally allocated according to the statistics of each block and the allocated code amount is determined, the predicted quantization coefficient can be used to When actually encoding, the allocated amount of code may be insufficient for the luminance component block and redundant for the chrominance component block, or vice versa, resulting in colors for which the amount of code is insufficient. Since the encoding of the component is aborted midway through, the image quality naturally deteriorates, but
According to the present invention, it becomes possible to encode images with a wide range of spatial frequencies within a certain amount of code within a certain processing time without degrading the image quality as much as possible.

本発明は基本的には、統計処理と符号化処理の2つを行
って符号化を終了する2パス方式と称する方式を採用し
ているもので、ある量子化幅で量子化してこれを可変長
符号化するに際し、各ブロックに割り当てた基準割当符
号量を一つの基準とし、各ブロックでの発生符号量にば
らつきがあるのを、次のブロックで吸収することで調整
しようと云うもので、この調整したものを割当符号量と
し、この割当符号量の範囲でブロックでの符号化を実施
し、割当符号量を越えるときはそのブロックの符号化を
打ち切るようにする。しかし、画像データは直交変換に
より直流成分と交流成分に分解されおり、視覚的に影響
の大きい直流成分については符号量が仮に割当符号量を
越えても符号化打ち切りは行わず、次のブロックでの割
当符号量をそのオーバした分たけ差し引き、また、交流
成分に入って割当符号量をオーバする危険か生した場合
は符号化を打ち切る。また、符号化により発生した符号
量が割当符号量に満たないときはその余剰分を、次のブ
ロックの割当符号量に加えて、当該次のブロックでの割
当符号量を多くする。このようにして、一つ前の処理ブ
ロックでの符号量が割当符号量に対して過不足を生じた
場合に、その過不足分を次のブロックの割当符号量に反
映させ、調整する。
The present invention basically employs a method called a two-pass method in which two processes, statistical processing and coding processing, are performed to complete the coding. When performing long encoding, the standard allocated code amount assigned to each block is used as a standard, and variations in the generated code amount in each block are adjusted by absorbing it in the next block. This adjusted amount is set as the allocated code amount, and encoding in a block is performed within the range of this allocated code amount, and when the allocated code amount is exceeded, the encoding of that block is discontinued. However, image data is decomposed into DC and AC components by orthogonal transformation, and even if the code amount exceeds the allocated code amount for the DC component, which has a large visual impact, the coding will not be aborted and the next block will be processed. The allocated code amount is subtracted by the amount that exceeds the allocated code amount, and if there is a risk of the AC component entering the allocated code amount exceeding the allocated code amount, the encoding is terminated. Further, when the amount of code generated by encoding is less than the allocated code amount, the surplus is added to the allocated code amount of the next block to increase the allocated code amount of the next block. In this way, when the amount of code in the previous processing block is over or under the allocated code amount, the excess or deficiency is reflected in the allocated code amount of the next block and adjusted.

以上の原理を用いた本装置の実施例を説明する。An embodiment of this device using the above principle will be described.

第1図に本発明による画像データの符号化装置をディジ
タル電子スチルカメラに適用した一実施例を、また、第
2図には本発明による画像データの符号化装置の構成を
それぞれブロック図で示す。なお、本発明とは直接関係
のないディジタル電子スチルカメラの機構は図示および
説明を省略する。
FIG. 1 shows an embodiment in which an image data encoding device according to the present invention is applied to a digital electronic still camera, and FIG. 2 shows a block diagram of the configuration of the image data encoding device according to the present invention. . Note that illustrations and explanations of mechanisms of the digital electronic still camera that are not directly related to the present invention will be omitted.

第1図に示すように、ディジタル電子スチルカメラ本体
(以下、電子カメラ本体と称する)1は画像を撮像する
撮像系40と、この撮影系40の出力に対し、所定の信
号処理を行う信号処理回路60と、直交変換、線形量子
化、可変長符号化機能等を持ち、前記信号処理回路60
の出力を圧縮符号化して出力する符号化回路80と、こ
の符号化回路80により符号化された画像データおよび
量子化幅(またはこれに対応した情報)を記録媒体71
に記録する記録系70と、所望のデータ圧縮率を設定入
力するスイッチ30、システム全体の制御を司る制御回
路90とから構成される。
As shown in FIG. 1, a digital electronic still camera body (hereinafter referred to as electronic camera body) 1 includes an imaging system 40 that captures images, and a signal processing system that performs predetermined signal processing on the output of this imaging system 40. The signal processing circuit 60 has functions such as orthogonal transformation, linear quantization, variable length coding, etc.
An encoding circuit 80 compression-encodes and outputs the output of the encoder 80, and the image data and quantization width (or information corresponding to this) encoded by the encoding circuit 80 are transferred to a recording medium 71.
The system is comprised of a recording system 70 for recording data, a switch 30 for setting and inputting a desired data compression rate, and a control circuit 90 for controlling the entire system.

電子カメラ本体1の操作部には画像の圧縮率を設定する
スイッチ30か設けられており、スイッチ30は制御回
路90に接続されている。
A switch 30 for setting an image compression rate is provided on the operation section of the electronic camera body 1, and the switch 30 is connected to a control circuit 90.

前記撮像系40は光学像を結像するためのレンズ40a
と、CCD等の撮像素子40bとを備える。前記信号処
理回路60は増幅およびノイズ除去等を行うアンプ80
aと、アナログ信号をディジタル信号に変換する^/D
変換器130bと、RAM等からなるバッファメモリ6
0cと、色信号形成等を行うプロセス回路BOdとを備
える。符号化回路80は例えば、DOT  (離散コサ
イン変換)等の直交変換を行う直交変換回路4、線形量
子化を行う量子化回路6、可変長符号化としてハフマン
符号化を行うハフマン符号化回路8を備え、更に量子化
幅予測回路12゜符号量算出回路14、符号量割当回路
20、符号打切回路1Bおよび符号化回路80内の制御
処理を行う制御回路1Bとを有している。
The imaging system 40 includes a lens 40a for forming an optical image.
and an image sensor 40b such as a CCD. The signal processing circuit 60 includes an amplifier 80 that performs amplification, noise removal, etc.
a and convert analog signals to digital signals ^/D
Converter 130b and buffer memory 6 consisting of RAM, etc.
0c, and a process circuit BOd that performs color signal formation and the like. The encoding circuit 80 includes, for example, an orthogonal transform circuit 4 that performs orthogonal transform such as DOT (discrete cosine transform), a quantization circuit 6 that performs linear quantization, and a Huffman encoding circuit 8 that performs Huffman encoding as variable length encoding. It further includes a quantization width prediction circuit 12, a code amount calculation circuit 14, a code amount allocation circuit 20, a code abort circuit 1B, and a control circuit 1B that performs control processing within the encoding circuit 80.

前記記録系70はインタフェース回路70aおよび記録
媒体として用いられるICメモリを内蔵したメモリカー
ド71とからなる。メモリカードア1は電子カメラ本体
1に対し、着脱可能となっている。
The recording system 70 includes an interface circuit 70a and a memory card 71 containing an IC memory used as a recording medium. The memory card door 1 is removably attached to the electronic camera body 1.

制御回路90はマイクロプロセッサ(MPU)により実
現されている。
The control circuit 90 is realized by a microprocessor (MPU).

第6図に電子カメラ本体1の外観を斜視図で示す。図は
双眼鏡形のものを示しており、48は操作部におけるL
CD  (液晶)表示器、30は操作部におけるスイッ
チ30であり、その他、テレ・ワイド切り替えスイッチ
、シャッタ操作ボタン50等が設けられている。また、
49はファインダである。
FIG. 6 shows a perspective view of the external appearance of the electronic camera body 1. The figure shows a binocular type, and 48 is L in the operation section.
A CD (liquid crystal) display 30 is a switch 30 in the operation section, and a tele/wide changeover switch, a shutter operation button 50, etc. are also provided. Also,
49 is a finder.

LCD表示器48には制御回路90の制御のもとに撮影
モードやコマ数、日付、時間等、種々の値や状態が表示
される。本電子カメラでは、電子カメラ本体1の操作部
に設けられたスイッチ30を操作することにより、画像
の圧縮率を所望の値に設定することができる。すなわち
、制御回路90には予め標準的な複数種の圧縮率情報が
設定されており、これがスイッチ30の操作により設定
される撮影可能枚数の値をもとに、装着されているメモ
リカード(記録媒体)の容量から、適用する圧縮率を求
め、この求めた圧縮率の値およびメモリカードに記録で
きる画像の枚数の値に換算されて操作部のLCD表示器
48に表示させるようになっている。そして、ユーザが
スイッチ30を押すと、制御回路90はスイッチ30が
押される毎に、これらの値を変更する。
The LCD display 48 displays various values and conditions such as the shooting mode, number of frames, date, time, etc. under the control of the control circuit 90. In this electronic camera, the image compression ratio can be set to a desired value by operating a switch 30 provided on the operating section of the electronic camera body 1. That is, a plurality of standard compression ratio information is set in advance in the control circuit 90, and this is determined based on the value of the number of recordable images set by operating the switch 30. The compression rate to be applied is determined from the capacity of the medium (medium), and the determined compression rate value and the number of images that can be recorded on the memory card are converted and displayed on the LCD display 48 of the operation unit. . Then, when the user presses the switch 30, the control circuit 90 changes these values each time the switch 30 is pressed.

ユーザは表示される変更値を見ながら、所望の値のとこ
ろでスイッチ30を押すのを止めることにより、制御回
路90はその時点での撮影可能画像枚数指示値に対応す
る指示圧縮率を設定するようになっている。これは圧縮
率に応じて定まる画像当りの標準的な総符号量を制御回
路90が求めて、これを目的符号量設定情報として符号
化回路80に与えることで行う。また、トリガスイッチ
であるシャッタ操作ボタン50か押されることにより、
シャッタ機能が作動して撮像素子40bには被写体像が
結像され、撮像素子40bにはこの像に対応じて電荷像
が蓄積されるので、これを読出し制御することで撮像素
子40bから映像信号を得ることかできる。これらの制
御も制御回路90が司る。
When the user stops pressing the switch 30 at the desired value while looking at the displayed change value, the control circuit 90 sets the command compression rate corresponding to the command value for the number of images that can be taken at that time. It has become. This is done by the control circuit 90 determining the standard total code amount per image determined according to the compression rate, and providing this to the encoding circuit 80 as target code amount setting information. Also, when the shutter operation button 50, which is a trigger switch, is pressed,
When the shutter function is activated, a subject image is formed on the image sensor 40b, and a charge image is accumulated in the image sensor 40b corresponding to this image. Can you get it? These controls are also controlled by the control circuit 90.

第1図における撮像系40は、撮影レンズ40aやCC
D等の撮像デバイスよりなる撮像素子40bを有し、前
記撮影レンズ40aにより撮像素子40b上に結像され
た光学像を画像信号に変換して信号処理回路60に出力
するものである。信号処理回路60は増幅器Boa 、
 A/D変換器60b1バッファメモリ60c1プロセ
ス回路60dが含まれ、このプロセス回路BOdにより
前記撮像素子40bにより得られた画像信号をカラー信
号のY、 R−Y  (以下、この1?−YをCr(ク
ロマレッド)と略称する) 、B−Y(以下、このB−
YをCb(クロマブルー)と略称する)の各色成分に分
離させると共にガンマ補正やホワイトバランス処理等を
行うようにしである。
The imaging system 40 in FIG. 1 includes a photographic lens 40a and a CC
It has an image pickup device 40b made of an image pickup device such as D, and converts an optical image formed on the image pickup device 40b by the photographic lens 40a into an image signal and outputs it to the signal processing circuit 60. The signal processing circuit 60 includes an amplifier Boa,
It includes an A/D converter 60b, a buffer memory 60c, and a process circuit 60d, and the process circuit BOd converts the image signal obtained by the image sensor 40b into color signals Y and RY (hereinafter, 1?-Y is referred to as Cr). (abbreviated as Chroma Red)), B-Y (hereinafter, this B-
In addition to separating Y into each color component (abbreviated as Cb (chroma blue)), gamma correction, white balance processing, etc. are performed.

^/D変換器60bによりディジタル変換された撮像系
40のl力映像信号は、例えば、1フレ一ム分の容量を
有するバッファメモリ60cに画像データか格納され、
読み出されてプロセス回路60dに与えられることによ
り、輝度信号系である Y成分とクロマ(C1色差信号
)系であるCr、 Cb酸成分分離される。バッファメ
モリ60cに格納された画像データは、例えば最初に輝
度系の信号について統計処理を行うべく、プロセス回路
によりプロセス処理して画像信号のY成分データを得、
これを符号化回路80に与えて、Y成分データについて
の符号化処理を行い、該処理か終ったならば、次にクロ
マ系Cr5Cb成分のデータについてプロセス処理した
後、符号化処理を行う。
The output video signal of the imaging system 40 that has been digitally converted by the ^/D converter 60b is stored as image data in a buffer memory 60c having a capacity for one frame, for example.
By being read out and applied to the process circuit 60d, the Y component of the luminance signal system and the Cr and Cb acid components of the chroma (C1 color difference signal) system are separated. The image data stored in the buffer memory 60c is processed by a process circuit to obtain Y component data of the image signal, for example, in order to first perform statistical processing on the luminance signal.
This is supplied to the encoding circuit 80 to perform encoding processing on the Y component data, and when this processing is completed, next processing is performed on the chroma system Cr5Cb component data, and then encoding processing is performed.

信号処理回路60にはブロック化機能かあり、バッファ
メモリfileより読み出され、プロセス処理されて得
たY成分用およびCr、 Cb成分用の画像データ(1
フレ一ム分、若しくは1フイ一ルド分)を、所定の大き
さのブロックに分割するブロック化処理を行うことかで
きる。ここでは例としてブロックサイズは8×8とする
が、このブロックサイズは8×81こ限るものではなく
、まt二YとC(クロマ系)でブロックサイズが異なっ
ても良い。
The signal processing circuit 60 has a blocking function, and image data (1
It is possible to perform a blocking process in which one frame (or one field) is divided into blocks of a predetermined size. Here, as an example, the block size is 8×8, but this block size is not limited to 8×81, and the block size may be different for Y and C (chroma system).

本実施例では、輝度系Yのデータを読出してブロック化
し、後段の処理系に与えて、このY成分データについて
の統計処理を行わせ、該統計処理が終了したならば、次
にクロマ系C「、cb酸成分データについての統計処理
に入るべく該クロマ系Cr5Cb成分のデータの読出し
とブロック化に入る。
In this embodiment, luminance system Y data is read out, divided into blocks, and given to the subsequent processing system to perform statistical processing on this Y component data.Once the statistical processing is completed, next chroma system C ``In order to start statistical processing of the cb acid component data, we begin reading and blocking data of the chroma-based Cr5Cb component.

クロマ系のブロック化は、最初にCr成分の画像データ
についてすべてのブロック化を行い、その後に、cb酸
成分画像データをブロック化して行くものとする。
In the chroma system blocking, all of the Cr component image data is first blocked, and then the CB acid component image data is blocked.

符号化回路80は第2図に示す構成となっている。第2
図において、4は直交変換回路であり、ブロック化され
て入力された各画像データを受けて、この画像データに
対し、各ブロック毎に2次元の直交変換を行うものであ
る。直交変換としてはコサイン変換、サイン変換、フー
リエ変換、アダマール変換などが使用できる。直交変換
を行うことにより、変換係数としての画像データか得ら
れる。この変換係数としての画像データは直交変換であ
るが故に、画像の持つ空間周波数を周波数成分毎に分解
したデータとなる。
The encoding circuit 80 has a configuration shown in FIG. Second
In the figure, reference numeral 4 denotes an orthogonal transformation circuit, which receives input image data in blocks and performs two-dimensional orthogonal transformation on each block of this image data. As the orthogonal transformation, cosine transformation, sine transformation, Fourier transformation, Hadamard transformation, etc. can be used. By performing orthogonal transformation, image data as transformation coefficients can be obtained. Since the image data as the transform coefficient is orthogonally transformed, it is data obtained by decomposing the spatial frequency of the image into each frequency component.

6は量子化回路であり、前記直交変換回路4の出力する
画像データ(変換係数)を受けると、第1回目の量子化
では各色成分に応じて予め設定された各周波数成分毎の
量子化幅に、撮影モードに応じて予め設定された量子化
係数αを掛けて補正した量子化幅で、変換係数の量子化
を行い、第2回目では前回の処理により決定された最適
量子化係数αを用いて量子化を行う構成としである。
6 is a quantization circuit, which receives the image data (transform coefficients) output from the orthogonal transform circuit 4, and in the first quantization, quantization width for each frequency component is set in advance according to each color component. The transform coefficients are quantized using the quantization width corrected by multiplying by the quantization coefficient α set in advance according to the shooting mode, and in the second time, the optimal quantization coefficient α determined by the previous processing is quantized. This is a configuration in which quantization is performed using

8は可変長符号化回路であり、可変長符号化回路8は量
子化回路6の出力する前記量子化出力を可変長符号化す
るものである。可変長符号化としてはハフマン符号化、
算術符号化などを利用する。可変長符号化ではブロック
毎の符号量、画像全体の符号量などが画像毎に変化する
。どのような可変長符号化を用いるかは本発明とは直接
関係が無いが、ここではハフマン符号化を使用した一例
を示すこととする。
8 is a variable length encoding circuit, and the variable length encoding circuit 8 subjects the quantized output output from the quantization circuit 6 to variable length encoding. Huffman coding is used as variable length coding,
Use arithmetic encoding, etc. In variable length coding, the amount of code for each block, the amount of code for the entire image, etc. change for each image. Although the type of variable length encoding used is not directly related to the present invention, an example using Huffman encoding will be shown here.

可変長符号化回路8では、入力した量子化された変換係
数を第7図に示す順序でスキャンするジグザグ・スキャ
ンと呼ばれる手法により、低い周波数成分から高い周波
数成分への走査を行う。
The variable length encoding circuit 8 scans the input quantized transform coefficients from low frequency components to high frequency components by a method called zigzag scan in which the input quantized transform coefficients are scanned in the order shown in FIG.

第7図の走査順序の 1番目の直流成分[DC]のデー
タは、直前に可変長符号化を行ったブロックの直流成分
との差分値をハフマン符号化して出力する。交流成分[
AC]については第7図の走査順序の2番目から64番
目まで順番に変換係数を見て行き、変換係数が0でない
(すなわち、有効な)係数が出て来たらその直前に存在
した連続した0(無効)の係数の数(ゼロラン)とその
有効係数の値とで2次元のハフマン符号化して出力する
と云った動作をする。
The data of the first DC component [DC] in the scanning order in FIG. 7 is output by Huffman encoding the difference value between the data and the DC component of the block that has been subjected to variable length encoding immediately before. AC component [
AC], look at the conversion coefficients in order from the 2nd to the 64th in the scanning order in Figure 7, and if a non-zero (i.e., valid) coefficient appears, it is the same as the one that existed immediately before it. The operation is such that two-dimensional Huffman encoding is performed using the number of 0 (invalid) coefficients (zero run) and the value of its effective coefficients and output.

また、ある係数以降64番目の係数まで連続して無効係
数が続く場合はブロックの終りを示すEOB  (エン
ド・オブ・ブロック)の符号を出力する。また、打ち切
り信号が入力されると符号化を終了し、EOBを付加し
て出力する。そして、その各符号について発生した符号
長を符号量算出回路14に出力する。
Furthermore, if invalid coefficients continue after a certain coefficient up to the 64th coefficient, an EOB (end of block) code indicating the end of the block is output. Furthermore, when a truncation signal is input, encoding is terminated, and an EOB is added and output. Then, the code length generated for each code is output to the code amount calculation circuit 14.

符号量算出回路14は入力されたYlCrs Cb各成
分の各符号毎の符号長の積算を行い、Y、 Cr、cb
各成分の符号量を計算し、この画像全体の符号量のデー
タについて量子化幅予測回路12に出力すると共に、各
色成分毎の符号量と画像全体の符号量のデータについて
は符号量割当て回路20に出力する構成としである。
The code amount calculation circuit 14 integrates the code length for each code of each input YlCrsCb component, and calculates Y, Cr, cb.
The code amount of each component is calculated, and the data of the code amount of the entire image is output to the quantization width prediction circuit 12, and the code amount of each color component and the code amount of the entire image are output to the code amount allocation circuit 20. This is a configuration that outputs to .

量子化幅予測回路12は第1パスの開始にあたり、制御
回路18から目的とする符号量の情報を受け、この符号
量情報から先に説明した(4)式に基づく log(BRy  + BR,)2 a X IogS
P+b但し、BRは符号量(1画素あたりのビット数)
、spは量子化係数、a、bは定数。
At the start of the first pass, the quantization width prediction circuit 12 receives information on the target code amount from the control circuit 18, and uses this code amount information to calculate log(BRy + BR,) based on the equation (4) described earlier. 2 a X IogS
P+b However, BR is the code amount (number of bits per pixel)
, sp is a quantization coefficient, and a and b are constants.

の関係を用いて量子化係数αの初期値を設定し、量子化
回路6に出力し、更には第2バスの開始に先駆けて、符
号量算出回路14から入力された画像全体の符号量と、
1画像当りの許容される最大のデータ量である目的総符
号量とから、例えば、(1)式の関係を用い、線形予測
により目的総符号量に近づけるのに最適な量子化係数α
を、今回実際に使用した量子化係数を勘案して予測する
ものである。
The initial value of the quantization coefficient α is set using the relationship shown in FIG. ,
From the target total code amount, which is the maximum allowable data amount per image, for example, using the relationship in equation (1), calculate the optimal quantization coefficient α to approach the target total code amount by linear prediction.
is predicted by taking into account the quantization coefficients actually used this time.

また、量子化幅予測回路12は最適な量子化係数aと、
第1パス目で使用した量子化係数αとの大小比較により
、符号化する色成分の順序を決定し、制御回路16に出
力する。
Further, the quantization width prediction circuit 12 determines the optimal quantization coefficient a,
The order of the color components to be encoded is determined by comparison with the quantization coefficient α used in the first pass, and is output to the control circuit 16.

ここで、量子化係数を如何にして最適な値にするかが、
重要な課題となるので、この点について少し説明する。
Here, how to set the quantization coefficient to an optimal value is
Since this is an important issue, I will explain this point a little.

画像データを前処理し、この出力を量子化し、この量子
化出力を可変長符号化する場合、この量子化の量子化幅
を変化させると発生する符号量が変化することは良く知
られている。これは、ハフマン符号化に代表される可変
長符号化は、符号化するデータの発生確率の偏りを利用
してそのデータを表現するのに必要な符号量を減少させ
ると云うものであることから、前記「量子化幅を変化さ
せる」と云うことは、量子化値の発生確率を変化させる
ことでもあるから、量子化幅を変化させることにより発
生符号量も変化することがわかる。
It is well known that when image data is preprocessed, this output is quantized, and this quantized output is variable-length coded, the amount of code generated changes when the quantization width of this quantization is changed. . This is because variable length coding, typified by Huffman coding, uses the bias in the probability of occurrence of data to be encoded to reduce the amount of code required to represent that data. Since the above-mentioned "changing the quantization width" also means changing the probability of occurrence of a quantized value, it can be seen that by changing the quantization width, the generated code amount also changes.

ところで、同じ量子化幅で同一の符号化を行っても、そ
のときの画像データによって発生符号量は異なる。しか
し、1つの画像データに対して量子化幅を変化させて同
一の符号化を行った場合は量子化幅と、発生符号量との
間には一定の関係が得られる。また、多くの画像データ
で量子化幅と発生符号量の関係を求めると、最も発生頻
度の高い関係が統計的に得られることが明らかになった
By the way, even if the same encoding is performed with the same quantization width, the amount of generated code will differ depending on the image data at that time. However, when the same encoding is performed on one image data by changing the quantization width, a certain relationship is obtained between the quantization width and the amount of generated code. Furthermore, it has become clear that when the relationship between the quantization width and the amount of generated code is determined for a large amount of image data, the relationship with the highest frequency of occurrence can be statistically obtained.

具体的には多くの場合、次の関係が得られた。Specifically, in many cases, the following relationships were obtained.

すなわち、ある量子化幅に対する相対的な比をSFとし
、発生符号量1画素あたりのビット数(ビットレート)
で表わしてこれをBRとすると上記(1)式の関係が成
立する。(1)式において、aは同一の符号化であれば
、画像によらず略一定であり、bは画像に依存する。こ
のbの値は画像により、一定の分布を持ち、この発生頻
度分布から代表的なりが得られる。
In other words, the relative ratio to a certain quantization width is SF, and the amount of generated code is the number of bits per pixel (bit rate).
When this is expressed as BR, the relationship of the above equation (1) holds true. In equation (1), if the encoding is the same, a is approximately constant regardless of the image, and b depends on the image. The value of b has a certain distribution depending on the image, and a representative value can be obtained from this distribution of frequency of occurrence.

故に(1)式の関係から最適な量子化係数を求めること
ができる。
Therefore, the optimal quantization coefficient can be found from the relationship in equation (1).

上記符号量割当回路20は符号量算出回路14がら入力
された各色成分毎の画像データの符号量、画像全体の符
号量と、目的縁符号量とがら各色成分毎の1ブロツクあ
たりの割当符号量を算出して符号化打切回路I6に出力
するものである。
The code amount allocation circuit 20 calculates the allocated code amount per block for each color component based on the code amount of the image data for each color component inputted from the code amount calculation circuit 14, the code amount of the entire image, and the target edge code amount. It is calculated and output to the encoding abort circuit I6.

ここでの算出の方法は、例えば、各ブロック毎の符号量
の比で、目的縁符号量を比例配分する。
The calculation method here is, for example, to proportionately allocate the target edge code amount based on the ratio of the code amounts for each block.

例えば、あるブロックの符号量と目的縁符号量との乗算
を行い、それを画像全体の符号量で割ることにより、そ
のブロックの割当符号量を決定する。
For example, by multiplying the code amount of a certain block by the target edge code amount and dividing it by the code amount of the entire image, the allocated code amount of the block is determined.

この結果、各ブロックの割当符号量は、そのブロックで
の実際の符号量に応じて符号量か少い場合はそれ相応に
、間に合う程度に抑えられ、符号量の多いブロックには
それ相応に多く割り当てられる。
As a result, the amount of allocated code for each block is reduced depending on the actual amount of code in that block, and if the amount of code is small, it is suppressed to the extent that it is enough to make it in time, and for blocks with a large amount of code, it is increased accordingly. Assigned.

符号量割当回路20は符号量情報テーブルとブロック割
当符号量データテーブルとを持ち、符号量情報テーブル
における該当ブロック位置の符号量情報を符号量算出回
路14から入力された符号量情報に書き替える一方、符
号回算8回路14から入力された各ブロック毎の符号量
および画像全体の符号量と、目的縁符号量とから各ブロ
ックの基準割当符号量を算出し、この算出した各ブロッ
クの基準割当符号量のデータをブロック割当符号量デー
タテーブルに格納する。このブロック割当符号itデー
タテーブルの各ブロック別の基準割当符号量は、該当の
ブロックが可変長符号化処理される際に符号化打切回路
16に与えられる。
The code amount allocation circuit 20 has a code amount information table and a block allocation code amount data table, and rewrites the code amount information of the corresponding block position in the code amount information table with the code amount information input from the code amount calculation circuit 14. , the standard allocation code amount for each block is calculated from the code amount for each block and the code amount for the entire image input from the code rotation 8 circuit 14, and the target edge code amount, and the calculated standard allocation code for each block is calculated. The code amount data is stored in the block allocation code amount data table. The standard allocation code amount for each block in this block allocation code it data table is given to the coding abort circuit 16 when the corresponding block is subjected to variable length coding processing.

符号化打切回路16は、符号量割当回路20からの上記
該当ブロックの基準割当符号量に、このブロックの1つ
前に処理したブロックでの割当符号量に対する発生符号
量の差である過不足量を、前ブロックからの繰り越し分
として加えて、この該当ブロックでの割当符号量とする
と共に、符号量割当回路20からの各ブロックの符号長
を割当符号量から減算し、割当符号量の残りか、送出す
べき符号量とEOBの符号との合計符号量より小さくな
った場合には打切り信号を出力して可変長符号化回路8
に与え、そのブロックの符号化を終了し、該ブロックの
割当符号量から送出した符号量を減じてその値を割当符
号量の余りとして保持すると云った機能を有する。
The encoding abort circuit 16 adds an excess/deficiency amount to the standard allocated code amount of the corresponding block from the code amount allocation circuit 20, which is the difference between the generated code amount and the allocated code amount in the block processed one block before this block. is added as a carryover from the previous block to determine the allocated code amount for this block, and the code length of each block from the code amount allocation circuit 20 is subtracted from the allocated code amount to calculate the remaining allocated code amount. , when the amount of codes to be transmitted and the EOB code become smaller than the total code amount, an abort signal is output and the variable length encoding circuit 8
It has a function to complete the encoding of the block, subtract the transmitted code amount from the allocated code amount of the block, and hold that value as the remainder of the allocated code amount.

従って、符号化打切回路16ではこの割当符号量を参照
し、入力された送出すべき符号量およびEOBの符号を
送出しても割当符号量を越えない場合は、打切りは行わ
れず、そのブロックの符号化を終了し、該ブロックの割
当符号量から送出すべき符号量を減じて、その値を割当
符号量の余りとして保持すると云った動作を行う。
Therefore, the encoding abort circuit 16 refers to this allocated code amount, and if the input code amount to be transmitted and the EOB code do not exceed the allocated code amount even if the EOB code is transmitted, no abort is performed and the block is After the encoding is finished, the amount of code to be sent is subtracted from the allocated code amount of the block, and this value is held as the remainder of the allocated code amount.

また、符号化打切回路16ではこの割当符号量を参照し
、入力された送出すべき直流成分の符号とEOBの符号
を送出するのに割当符号量か十分てない場合には、この
2つの符号を送出した後、そのブロックの符号化を終了
し、該ブロックの割当符号量から送出した符号量を減す
る。すなわち、割当符号量の余りは負の値として保持す
ると云った動作を行う。
In addition, the encoding abort circuit 16 refers to this allocated code amount, and if the allocated code amount is not sufficient to send out the input DC component code and EOB code, these two codes are After sending out the block, the coding of that block is finished, and the sent code amount is subtracted from the allocated code amount of the block. That is, the remainder of the allocated code amount is held as a negative value.

10は符号出力回路であり、この符号出力回路lOは可
変長符号化回路8より入力される可変長の符号をつなぎ
合わせるもので、この繋ぎ合わせた符号をメモリカード
等の記録媒体にて構成される記録系22に書き込むよう
に機能する。
10 is a code output circuit, and this code output circuit IO connects the variable length codes inputted from the variable length encoding circuit 8, and stores the connected codes in a recording medium such as a memory card. It functions to write to the recording system 22 that is stored in the memory.

本システムでは撮影モートに応じて定めた初期時用標準
の量子化係数αを使用して最初に統計処理を行い(第1
バス)、最適化するに必要なブロック毎の情報量や画像
全体の情報量等を調べ、各色成分の符号化する順番を決
定し、次にこの統計処理により得た情報をもとに最適化
された符号化を行うための処理に入る(第2パス)。
This system first performs statistical processing using the initial standard quantization coefficient α determined according to the shooting mode (first
bus), examine the amount of information for each block and the amount of information for the entire image required for optimization, determine the order in which each color component is encoded, and then optimize based on the information obtained through this statistical processing. Then, processing for performing the encoded data is started (second pass).

そのため、最初に画像のブロック化、このブロック化さ
れた画像の要素に対する標準の量子化係数αを使用して
の量子化、量子化により得られた変換係数の可変長符号
化、そして、この可変長符号化により得られる各ブロッ
クの各要素の符号量情報と画像全体の符号量情報より最
適な符号量にするに必要な符号化係数αの予測、各色成
分の符号化の順番の決定、各ブロックの各要素における
基準割当符号量の決定、これらに基づく処理対象画像へ
の最適符号化の処理モードへの移行、この処理モードの
実施における画像のブロック化処理、このブロック化さ
れた画像の要素に対する前記予測量子化係数αを使用し
ての量子化処理、この量子化により得られた変換係数の
可変長符号化、処理対象画像の全符号の保存のための出
力処理と云った手順を実施させるが、その全体の制御管
理は図における制御回路18により行うようにしである
ものとする。
Therefore, we first block the image, quantize the elements of this blocked image using a standard quantization coefficient α, variable-length encoding the transform coefficients obtained by quantization, and then Prediction of the coding coefficient α necessary to obtain the optimal code amount from the code amount information of each element of each block obtained by long encoding and the code amount information of the entire image, determination of the coding order of each color component, Determination of the standard allocated code amount for each element of a block, transition to the processing mode of optimal encoding for the image to be processed based on these, blocking processing of the image in implementing this processing mode, elements of this blocked image quantization processing using the predicted quantization coefficient α, variable-length encoding of the transform coefficients obtained by this quantization, and output processing to save all codes of the image to be processed. However, the overall control management is assumed to be performed by the control circuit 18 in the figure.

尚、制御回路18のこのような機能はマイクロプロセッ
サ(MPU)を使用することで容易に実現できる。また
、各色、成分の符号化の順番の決定は、符号量の少ない
色成分のものから行うように決定するが、これは先に少
ない符号量で済む色成分の符号化処理を行うことで、符
号量の多い色成分に回すことができる割当符号量を増や
せることに狙いがある。
Incidentally, such a function of the control circuit 18 can be easily realized by using a microprocessor (MPU). In addition, the order of coding of each color and component is determined so that the color component with the least amount of code is encoded first. The aim is to increase the amount of allocated code that can be allocated to color components with a large amount of code.

以上が符号化回路80の構成である。The above is the configuration of the encoding circuit 80.

第1図における記録系70はインタフェース回路70a
と、これに着脱自在に接続される記録媒体71があり、
符号化回路80により符号化されて出力された画像デー
タおよび量子化幅(またはこれに対応した情報)はイン
タフェース回路70aを介して記録媒体71に記録され
る構成となっている。
The recording system 70 in FIG. 1 is an interface circuit 70a.
There is a recording medium 71 that is detachably connected to this.
The image data and quantization width (or information corresponding thereto) encoded and output by the encoding circuit 80 are recorded on the recording medium 71 via the interface circuit 70a.

次に上記第1図および第2図に示す構成の本装置の作用
を説明するが、全体の概要を掴むために初めに動作遷移
図である第8図を参照して基本動作を説明する。
Next, the operation of the present apparatus having the structure shown in FIGS. 1 and 2 will be described. In order to get an overall overview, the basic operation will first be explained with reference to FIG. 8, which is an operation transition diagram.

カメラの使用者かカメラを使用するにあたり、スイッチ
30を操作して所望とする撮影可能枚数を設定する。こ
れにより設定撮影可能枚数に応じ、制御回路90が最適
符号量を求めて、これを目的符号量設定情報として符号
化回路80に与える。このようにして撮影可能枚数が設
定される。
When using the camera, the user of the camera operates the switch 30 to set the desired number of images that can be taken. Thereby, the control circuit 90 determines the optimum code amount according to the set number of images that can be photographed, and provides this to the encoding circuit 80 as target code amount setting information. In this way, the number of images that can be taken is set.

次に撮影を行うと、撮影レンズ40aの後方におかれた
撮像素子40b上に被写体像が光学像として結像される
。そして、この撮像素子40bはこの結像された光学像
を画像信号に変換して出力する。
When a photograph is taken next, the subject image is formed as an optical image on the image sensor 40b placed behind the photographic lens 40a. The image sensor 40b converts the formed optical image into an image signal and outputs the image signal.

撮像素子40bにより得られた画像信号は信号処理回路
60に入力され、ここで信号処理回路60内の増幅回路
BOaによる増幅、A/D変換器60bによるA/D変
換後、バッファメモリ8Dcに一時保持される。そして
、この後、バッファメモリ60cから読み出され、信号
処理回路60内のプロセス回路60dにより帯域補正、
色信号形成等の処理が行われる。
The image signal obtained by the image sensor 40b is input to the signal processing circuit 60, where it is amplified by the amplifier circuit BOa in the signal processing circuit 60, A/D converted by the A/D converter 60b, and temporarily stored in the buffer memory 8Dc. Retained. Thereafter, it is read out from the buffer memory 60c, and subjected to band correction by the process circuit 60d in the signal processing circuit 60.
Processing such as color signal formation is performed.

ここで、後の1パス目の処理がY(輝度)、Cr、Cb
(クロマ系、いずれも色差)信号の順序で行われるため
、色信号形成もこれに合わせて行われる。すなわち、画
像信号は8×8のマトリックスでブロック化されて読み
出され、プロセス回路ではこのブロック化された画像信
号データからY成分、Cr成分(1?−Y成分)、Cb
酸成分 B−Y成分)の順序でこれら各色成分の信号を
分離させると共に、ガンマ補正やホワイトバランス処理
等を行う。
Here, the subsequent first pass processing is Y (luminance), Cr, Cb
(Chroma system, both are color difference) Since it is performed in the order of the signals, color signal formation is also performed in accordance with this order. That is, the image signal is divided into blocks in an 8×8 matrix and read out, and the process circuit extracts the Y component, Cr component (1?-Y component), and Cb component from this blocked image signal data.
The signals of these color components are separated in the order of acid component (B-Y component), and gamma correction, white balance processing, etc. are performed.

プロセス回路60dにより分離された8X8のマトリッ
クスのブロック化画像信号における各色成分の画像信号
データは、符号化回路80に入力される。これにより、
1フレ一ム分(若しくは1フイ一ルド分)の画像データ
は、上記所定の大きさのブロックに分割されて順次、符
号化回路80に入力される。尚、プロセス回路80dに
より処理された各色成分の画像信号は、Y、 Cr、 
Cbの各成分別にバッファメモリに記憶させ、後の処理
において、読出して使用するようにしても良い。
The image signal data of each color component in the 8×8 matrix blocked image signal separated by the process circuit 60d is input to the encoding circuit 80. This results in
Image data for one frame (or one field) is divided into blocks of the predetermined size and sequentially input to the encoding circuit 80. The image signals of each color component processed by the process circuit 80d are Y, Cr,
Each component of Cb may be stored in a buffer memory and read out and used in later processing.

本実施例では、信号処理回路60からは1画像分の画像
信号データにおけるY成分(輝度成分)について出力が
行われ、これについての後段での処理(統計処理)が済
んだ後に、次にCr成分の画像データについて総てのブ
ロック化を行い、これについて後段での統計処理を行い
、その後に、cb酸成分画像をブロック化し、これにつ
いて後段での統計処理を行ってゆくと云った処理を行う
In this embodiment, the signal processing circuit 60 outputs the Y component (luminance component) of the image signal data for one image, and after completing the subsequent processing (statistical processing) for this, All the image data of the components are divided into blocks, which are then subjected to statistical processing at a later stage, and then the cb acid component image is divided into blocks, and which are subjected to statistical processing at a later stage. conduct.

符号化回路80では、信号処理回路60より受けたこの
入力データを直交変換回路4に与える。すると、直交変
換回路4はブロック化された入力画像データ(以下、ブ
ロック画像データと呼ぶ)に対し、各ブロック毎に例え
ば、離散コサイン変換(DCT)による2次元の直交変
換を行う。このDCTによる直交変換と云うのは、ある
波形を周波数成分に分割し、これを入力サンプル数と同
じ数だけの各々異なる周波数のコサイン波で表現すると
云った処理である。
The encoding circuit 80 supplies this input data received from the signal processing circuit 60 to the orthogonal transformation circuit 4. Then, the orthogonal transform circuit 4 performs two-dimensional orthogonal transform using, for example, discrete cosine transform (DCT) on each block of the input image data that has been divided into blocks (hereinafter referred to as block image data). This orthogonal transformation using DCT is a process of dividing a certain waveform into frequency components and expressing them with the same number of cosine waves of different frequencies as the number of input samples.

そして、直交変換されたブロック画像データ(変換係数
)は図示しないバッファメモリにおける8X8のマトリ
ックス上の対応する周波数成分位置に格納され(マトリ
ックスの原点位置が直流成分、それ以外は交流成分で原
点位置より離れるに従い周波数が高くなるような関係を
持たせたマトリックスに格納する)、これが量子化回路
6に入力される。
The block image data (transformation coefficients) subjected to orthogonal transformation are stored at corresponding frequency component positions on an 8x8 matrix in a buffer memory (not shown) (the origin position of the matrix is the DC component, and the other AC components are AC components from the origin position). (Stored in a matrix such that the frequency increases as the distance increases), this is input to the quantization circuit 6.

すると量子化回路6は、このブロック画像データ(変換
係数)に対して1パス目(第1回目)の量子化を行う。
Then, the quantization circuit 6 performs a first pass (first time) quantization on this block image data (transform coefficients).

この第1回目の量子化では、予め設定された各周波数成
分毎(周波数成分はブロックの各マトリックス位置に対
応じて決まる)の量子化マトリックスに対し、撮影に当
り使用者が設定した画質設定値に対応じて制御回路18
より与えられる標準(暫定)の量子化係数αを掛けた量
子化幅で、変換係数の量子化を行う(第8図(hl 、
 i))。この時の量子化マトリックスは輝度系とクロ
マ系とでそれぞれで同してあっても良いが、それぞれに
適した量子化マトリツクスを設定する方か良い結果か得
られる。
In this first quantization, the image quality setting value set by the user at the time of shooting is applied to the quantization matrix for each preset frequency component (frequency components are determined corresponding to each matrix position of the block). The control circuit 18 corresponds to
The transform coefficients are quantized using the quantization width multiplied by the standard (provisional) quantization coefficient α given by (Figure 8 (hl,
i)). The quantization matrix at this time may be the same for both the luminance system and the chroma system, but better results can be obtained by setting quantization matrices suitable for each.

量子化されたブロック画像データ(変換係数)は可変長
符号化回路8に入力され、ここで、可変長符号化される
。可変長符号化回路8ては量子化されて入力された変換
係数を第7図に示す順序でジグザグスキャンし、低い周
波数成分から高い周波数成分への走査を行う。すなわち
、変換係数は8×8のマトリックスに、周波数成分に対
応じて格納されており、原点に近いほど、周波数か低い
ので、ジグザグスキャンすることで低い周波数成分から
高い周波数成分へと走査できる。
The quantized block image data (transform coefficients) is input to a variable length encoding circuit 8, where it is variable length encoded. The variable length encoding circuit 8 zigzags scans the quantized input transform coefficients in the order shown in FIG. 7, scanning from low frequency components to high frequency components. That is, the conversion coefficients are stored in an 8×8 matrix corresponding to frequency components, and the closer to the origin the lower the frequency, so zigzag scanning allows scanning from low frequency components to high frequency components.

第7図の走査順序の1番目のデータは直流成分DCであ
るから、この直流成分DCのデータは直前に可変長符号
化を行ったブロック(一つ前のブロック)の直流成分D
Cとの差分値dlf’r−DCをハフマン符号化する(
第8図(di)、 (el))。
Since the first data in the scanning order in FIG. 7 is the DC component DC, the data of this DC component DC is the DC component D of the block (previous block) that was subjected to variable length encoding immediately before.
Huffman encode the difference value dlf'r-DC with C (
Figure 8 (di), (el)).

交流成分ACについては第7図の走査順序の 2番目か
ら64番目まで順番に変換係数を見て行き、変換係数が
0でない(すなわち、有効な)係数が出て来たらその直
前に存在した連続した0(無効)の係数の数(ゼロラン
)とその有効係数の値とで2次元のハフマン符号化を行
う((d2)、  (e2))。
Regarding the AC component AC, look at the conversion coefficients in order from the 2nd to the 64th in the scanning order in Figure 7, and if a conversion coefficient that is not 0 (that is, valid) comes out, it is the continuation that existed immediately before it. Two-dimensional Huffman encoding is performed using the number of 0 (invalid) coefficients (zero run) and the values of their effective coefficients ((d2), (e2)).

また、可変長符号化回路8は、ある係数以降64番目の
係数まで連続して無効係数が続く場合はブロックの終り
を示すEOB  (エンド・オブ・ブロック)の符号を
与える。そして、その符号について発生した符号長を符
号量算出回路14に出力する(gl)。
Further, the variable length encoding circuit 8 provides an EOB (end of block) code indicating the end of the block when invalid coefficients continue after a certain coefficient up to the 64th coefficient. Then, the code length generated for that code is output to the code amount calculation circuit 14 (gl).

1画像分の全ブロックについてこのような処理を実行し
て行く。
Such processing is executed for all blocks of one image.

Y成分についてのこのような処理が終了したなら、次に
Or%cb各成分についても同様の処理を行う。
When such processing for the Y component is completed, the same processing is then performed for each Or%cb component.

一方、符号量算出回路14は入力されたY% Cr。On the other hand, the code amount calculation circuit 14 inputs Y% Cr.

cb各成分の各色成分毎に1画像全体の符号量の計算を
すべく、Y、 Cr、 Cb各成分の各ブロック毎の符
号量の算出と、その符号量の画像全体についての積算を
行う(g2)と共に、各ブロック毎の符号量のデータを
符号量割当回路20に出力する。符号量割当回路20は
この各ブロック毎の符号量のデータを符号量情報テーブ
ルにおける該当ブロック位置の符号量情報として書き込
む。そして、1画像分の全ブロックについて、Y、 C
r、 Cb各成分、全て全体の符号量のデータを量子化
幅予測回路12に出力すると共に、画像全体の符号量の
データを符号量割当回路20に出力する。
In order to calculate the code amount for the entire image for each color component of each cb component, calculate the code amount for each block of each Y, Cr, and Cb component, and integrate the code amount for the entire image ( g2), and outputs the code amount data for each block to the code amount allocation circuit 20. The code amount allocation circuit 20 writes the code amount data for each block as the code amount information of the corresponding block position in the code amount information table. Then, for all blocks of one image, Y, C
Data on the total code amount for each of the r and Cb components is output to the quantization width prediction circuit 12, and data on the code amount for the entire image is output to the code amount allocation circuit 20.

量子化幅予測回路12はこの入力された画像全体の符号
量データと目的総符号量データとから、例えば、線形予
測により目的総符号量の値に近づけるのに最適な量子化
係数αを、実際に使用した量子化係数に基づいて予測す
る(第8図(h2))。
The quantization width prediction circuit 12 actually calculates the optimal quantization coefficient α for approaching the value of the target total code amount by linear prediction, for example, from the input code amount data of the entire image and the target total code amount data. The prediction is made based on the quantization coefficients used in (Fig. 8 (h2)).

また、実際に使用した量子化係数に比べて予測した量子
化係数が大きいか否かにより、各色成分の符号化の順番
を決定し、制−御回路18に出力する。また、符号量割
当回路20は入力された各ブロック毎の符号量および画
像全体の符号量と、目的総符号量とから各ブロックの基
準割当符号量を、例えば各ブロック毎の符号量の比で、
目的総符号量を比例配分する等して算出する(第8図(
h3))。
Furthermore, the coding order of each color component is determined depending on whether the predicted quantization coefficient is larger than the actually used quantization coefficient, and is output to the control circuit 18. Further, the code amount allocation circuit 20 calculates a standard allocated code amount for each block from the input code amount for each block, the code amount for the entire image, and the target total code amount, for example, by calculating the ratio of the code amount for each block. ,
Calculate by proportionally distributing the total target code amount (see Figure 8 (
h3)).

具体的には、あるブロックの基準割当符号量を決定する
には、当該ブロックの符号量と目的総符号量とを乗算し
、それを画像全体の符号量で割ることで得た結果を以て
、そのブロックにおける基準割当符号量とする。
Specifically, to determine the standard allocated code amount for a certain block, multiply the code amount of the block by the target total code amount, and divide it by the code amount of the entire image. This is the standard allocated code amount in a block.

そして、この算出した各ブロックの基準割当符号量のデ
ータを、ブロック割当符号量データテーブルに格納する
。このブロック割当符号量データテーブルの各ブロック
別割当符号量のデータは、該当のブロックが可変長符号
化処理される際に符号化打切回路16に与えられること
になる。
Then, the calculated standard allocated code amount data for each block is stored in the block allocated code amount data table. The data of the allocated code amount for each block in this block allocated code amount data table is given to the encoding abort circuit 16 when the corresponding block is subjected to variable length encoding processing.

以上で1パス目、すなわち、各ブロックの割当符号量の
決定及び量子化幅の最適化のための第1の符号化(統計
処理)を終了する。
This completes the first pass, that is, the first encoding (statistical processing) for determining the allocated code amount for each block and optimizing the quantization width.

次に2バス目の処理に入る。この2バス目の処理は第2
の符号化(符号化処理)であり、目的総符号量に収まる
ように最適化した最終の符号化出力を得る処理である。
Next, processing for the second bus begins. This second bus process is
It is a process to obtain a final encoded output optimized to fit within the target total code amount.

この処理は1パス目で決定した各色成分毎の符号化順序
に従い、実施するようにする。例えば、決定された順序
か、Y、 Cr、 Cbの順であるとしたならば、最初
にY成分について処理を行い、Y成分が終了した後にC
rの処理を行い、その後にcb酸成分ついて行うように
する。決定された順序が、Cr、  Y、 CbO順な
らば、最初にCr成分について処理を行い、Cr成分が
終了した後にy成分の処理を行い、その後にCb酸成分
ついて行うようにすると云った具合である。
This process is performed in accordance with the coding order for each color component determined in the first pass. For example, if the determined order is Y, Cr, and Cb, the Y component is processed first, and after the Y component is processed, the Cb is processed.
After the r treatment, the cb acid component is added. If the determined order is Cr, Y, CbO, then the Cr component is processed first, the y component is processed after the Cr component is completed, and the Cb acid component is then processed. It is.

2バス目の処理は、初めに画像データをブロック化して
読出し、これについて抽出されて信号処理回路60から
出力される最初に符号化すべき色成分の画像信号データ
を符号化回路80に入力する(a)。入力されたブロッ
ク化画像データは符号化回路80における直交変換回路
4に入力され、再び直交変換が行われる(b)。この直
交変換により得られた変換係数は量子化回路6に入力さ
れ、再び量子化が行われる(C)。たたし、このとき使
用する量子化係数αは前回のパスにおいて量子化幅予測
回路12が算出した予測の最適量子化係数αである。
In the processing of the second bus, the image data is first read out in blocks, and the image signal data of the color component to be encoded first, which is extracted and output from the signal processing circuit 60, is input to the encoding circuit 80 ( a). The input blocked image data is input to the orthogonal transformation circuit 4 in the encoding circuit 80, and orthogonal transformation is performed again (b). The transform coefficients obtained by this orthogonal transform are input to the quantization circuit 6 and quantized again (C). However, the quantization coefficient α used at this time is the predicted optimal quantization coefficient α calculated by the quantization width prediction circuit 12 in the previous pass.

次に、量子化したブロック画像データの変換係数は、可
変長符号化回路8に入力される。可変長符号化は統計処
理の時と同様、このブロック画像データの変換係数のう
ち、まず直流成分DCの差分値difr−DCをハフマ
ン符号化しく (di)、 (el))、次に交流成分
ACをジグザグスキャンで順次データ抽出して2次元の
ハフマン符号化を行う((d2)。
Next, the transform coefficients of the quantized block image data are input to the variable length encoding circuit 8. In variable length encoding, as in statistical processing, among the transform coefficients of this block image data, first the difference value difr-DC of the DC component DC is Huffman encoded ((di), (el)), and then the AC component Data is sequentially extracted from AC by zigzag scanning and two-dimensional Huffman encoding is performed ((d2)).

(e2))  。(e2)).

但し、一つの要素(マトリックス内の一つの位置)に対
するハフマン符号が発生する度に符号量割当回路20か
ら、そのブロック割当符号量データテーブルに格納され
ている当該要素における送出すべき基準割当符号量を符
号化打切回路16に出力し、一方、符号化打切回路16
ではこの各ブロックの基準割当符号量と前ブロックでの
符号化処理における割当符号量に対する余りを加えて該
当ブロックの割当符号量とすると共に、送出すべき符号
量およびEOBの符号を送出しても割当符号量を越えな
い場合は、打切り信号を発生せず、該ブロックの割当符
号量から送出すべき符号量を減する処理を行う。
However, each time a Huffman code for one element (one position in the matrix) is generated, the code amount allocation circuit 20 sends the standard allocated code amount to be transmitted for that element stored in the block allocated code amount data table. is output to the encoding terminating circuit 16, while the encoding terminating circuit 16
Now, add the standard allocated code amount for each block and the remainder from the allocated code amount in the encoding process of the previous block to determine the allocated code amount for the block, and also calculate the code amount to be sent and the EOB code. If the allocated code amount is not exceeded, a process is performed to reduce the code amount to be transmitted from the allocated code amount of the block without generating an abort signal.

そして、送出すべき該ブロックの符号量とEOBの符号
との合計の符号量が、割当符号量の残りの符号量を上ま
わったときに、符号化打切回路16は可変長符号化回路
8に打切り信号を出力し、そのブロックのハフマン符号
化を終了させると共に、該ブロックの割当符号量から、
送出した符号量を減して、その値を割当符号量の余りと
して保持する。そして、可変長符号化回路8は量子化回
路6より得られる次のブロックのハフマン符号化に移る
Then, when the total code amount of the code amount of the block to be transmitted and the EOB code exceeds the remaining code amount of the allocated code amount, the encoding abort circuit 16 sends the variable length encoder 8 to the variable length encoder circuit 8. A termination signal is output, Huffman encoding of the block is finished, and from the allocated code amount of the block,
The transmitted code amount is reduced and the value is held as the remainder of the allocated code amount. The variable length encoding circuit 8 then proceeds to Huffman encoding of the next block obtained from the quantization circuit 6.

また、符号化打ち切り回路16では、直流成分とEOB
の符号を送出するに割当符号量が足りない場合には、こ
れらの符号量は送出させた後、符号化打ち切り回路16
は可変長符号化回路8に打ち切り信号を出力し、そのブ
ロックのハフマン符号化を終了させると共に、該ブロッ
クの割当符号量から送出した符号量を減じて割当符号量
の余りを負の値として保持する。
In addition, in the encoding abort circuit 16, the DC component and the EOB
If the amount of allocated codes is insufficient to send out the codes, these codes are sent out and then sent to the coding abort circuit 16.
outputs an abort signal to the variable length encoding circuit 8 to terminate the Huffman encoding of the block, and subtracts the transmitted code amount from the allocated code amount of the block and holds the remainder of the allocated code amount as a negative value. do.

従って、可変長符号化回路8は符号化打切回路16から
打切り信号か入力されるまで、変換されたハフマン符号
を、符号出力回路lOに出力し、打切り信号発生前にマ
トリックスのすべての要素に対するハフマン符号化か終
わった場合には、可変長符号化回路8はEOBの符号を
符号出力回路10に出力する。また、可変長符号化回路
8はマトリックスの全ての要素に対するハフマン符号化
が終わる前に打切り信号か入力された場合には、その符
号の代りにEOBの符号を符号出力回路10に出力する
ことになる。符号出力回路10ではこの符号化されたデ
ータを一時記憶する。
Therefore, the variable length encoding circuit 8 outputs the converted Huffman code to the code output circuit lO until the truncation signal is input from the coding truncation circuit 16, and before the truncation signal is generated, the Huffman code for all elements of the matrix is inputted. When the encoding is completed, the variable length encoding circuit 8 outputs the EOB code to the code output circuit 10. Furthermore, if the variable-length encoding circuit 8 receives an abort signal before completing Huffman encoding for all elements of the matrix, it outputs the EOB code to the code output circuit 10 instead of that code. Become. The code output circuit 10 temporarily stores this encoded data.

そして、可変長符号化回路8は量子化回路6より得られ
る次のブロックのハフマン符号化に移る。
The variable length encoding circuit 8 then proceeds to Huffman encoding of the next block obtained from the quantization circuit 6.

このような動作を繰り返し、1画面の画像の全ブロック
の処理か終わることにより、全ての符号化処理を終了す
る。最初に符号化すべき色成分に対するこのような処理
が終ると、次に同様の手法で次の処理順位の色成分の処
理に入る。この2番手の色成分の処理でも、量子化回路
6は前回のバスにおいて量子化幅予測回路12か算出し
た予〃1の最適量子化係数αを使用する。3番手の色成
分も同様である。
By repeating such operations and completing processing of all blocks of one screen image, all encoding processing is completed. When such processing is completed for the color component to be encoded first, processing of the next color component in the processing order begins in the same manner. In processing this second color component as well, the quantization circuit 6 uses the predetermined optimal quantization coefficient α calculated by the quantization width prediction circuit 12 in the previous bus. The same applies to the third color component.

このようにしてすべての色成分について、1画面分の画
像の全ブロックの上記2パス目の処理か終わることによ
り、全ての符号化処理を終了する。
In this way, all the encoding processing is completed by completing the second pass processing of all blocks of the image for one screen for all color components.

この終了にあたり、符号出力回路10では最適化された
1画像分のハフマン符号化データを記録系22に出力し
、記録系22におけるメモリカートと云った記憶媒体7
1に書き込む(n。これは、符号出力回路10の出力に
より行われるか、符号出力回路10は可変長符号化回路
8からの可変長符号であるハフマン符号をつなぎ合わせ
、記憶媒体71であるメモリカードに与えることで書き
込む。この符号出力回路IOの出力による記憶媒体7I
への書き込みは、第2パスか終わった段階でまとめて行
うようにしても良いか、第1バスか終って第2バス実行
に入った段階で可変長のハフマン符号をつなぎ合わせた
結果か、1バイト若しくは数バイト単位、まとまり次第
、順次、記憶媒体へ書き込むようにしても良い。
At the end of this process, the encoder output circuit 10 outputs the optimized Huffman encoded data for one image to the recording system 22, and stores it in a storage medium 7 such as a memory cart in the recording system 22.
1 (n. This is done by the output of the code output circuit 10, or the code output circuit 10 connects the Huffman code, which is a variable length code from the variable length encoding circuit 8, and writes it to the memory, which is the storage medium 71. It is written by giving it to the card.The storage medium 7I is written by the output of this code output circuit IO.
Is it okay to write to the data all at once at the end of the second pass, or is it the result of stringing together variable-length Huffman codes at the stage where the first bus ends and the second bus is executed? It is also possible to sequentially write data to the storage medium in units of one byte or several bytes as soon as they are collected.

筒、これに先立ち、符号出力回路IOでは符号化に使用
した最適量子化係数αと、各色成分の符号化順序を識別
するための情報を、当該符号化した画像の記憶データに
おけるヘッダ部分に書き込み、再生時の手掛かりとして
残す。
Prior to this, the code output circuit IO writes the optimal quantization coefficient α used for encoding and information for identifying the encoding order of each color component into the header part of the stored data of the encoded image. , leave it as a clue during playback.

以上、本装置においては、最初に統計処理を行い、この
統計処理により最適な量子化幅の予測値と、各ブロック
基準割当符号量の決定に必要な統計量を得、また、各色
成分の符号化する順序を決め、これらの情報をもとに、
符号化の処理に入り、決定した各色成分の符号化する順
序に従って、順次、符号化出力を見ながら、各ブロック
の基準割当符号量と、前ブロックでの割当符号量に対す
る出力符号量の過不足を合わせて得られたそのブロック
の割当符号量内に収まるように、可変長符号化を打ち切
ることで、ブロック毎の符号量を制御し、所望の符号量
内に収まった符号化出力を最終出力として得るようにし
たものであり、この点か本発明の重要なポイントとなっ
ている。
As described above, in this device, statistical processing is first performed, and through this statistical processing, the predicted value of the optimal quantization width and the statistical amount necessary for determining the standard allocated code amount for each block are obtained, and the code of each color component is obtained. Decide on the order in which to
Encoding processing begins, and according to the determined coding order of each color component, while checking the encoded output sequentially, determine the standard allocated code amount for each block and the excess or deficiency of the output code amount with respect to the allocated code amount of the previous block. The code amount for each block is controlled by terminating the variable length encoding so that the code amount falls within the allocated code amount for that block obtained by combining the two blocks, and the encoded output that falls within the desired code amount is output as the final output. This point is an important point of the present invention.

よって、本実施例で使用したブロックサイズ、直交変換
の種類、可変長符号化の種類等に限定されるものではな
い。また、統計処理は必すしも1回である必要はなく、
無くても良いし、複数回でも良い。
Therefore, the block size, the type of orthogonal transformation, the type of variable length encoding, etc. used in this embodiment are not limited. Also, statistical processing does not necessarily have to be done only once;
It may be omitted or may be repeated multiple times.

但し、統計処理を一回実施するのか、処理時間と得られ
る効果の点て最も得策である。また、統計処理は実際に
符号化を行って発生符号量を値認する必要は必すしも無
く、各ブロック毎にアクティビティを求め、その結果か
ら各ブロック毎の基準割当符号量と量子化係数を求める
方式であっても良い。
However, performing the statistical processing once is the best option in terms of processing time and effects obtained. In addition, statistical processing does not necessarily require actual encoding to evaluate the generated code amount; instead, the activity is determined for each block, and the standard allocated code amount and quantization coefficient for each block are calculated from the results. It may be any method you request.

また、必ずしも、目的総符号量を全て各ブロックに割り
当てる必要はなく、例えば、目的総符号量を各ブロック
の割当符号量に割り当てたときの余りを仮に最初のブロ
ックに対して、前の処理ブロックでの過不足分として与
える等しても良い。
In addition, it is not necessarily necessary to allocate the entire target total code amount to each block; for example, if the remaining amount when the target total code amount is allocated to the allocated code amount of each block is used for the first block, the previous processing block It is also possible to give it as an excess or deficiency.

また、本実施例においては、各ブロックの基準割当符号
量の決定および、符号量の制御にEOBの符号量を含め
ていたが、EOBの符号量は量子化幅が変化しても変わ
らないので、予めこのEOBの符号量を除外して各ブロ
ックの基準割当符号量の決定および、符号量の制御を実
施しても勿論差支えなく、むしろこの方が精度が向上す
るので、望ましい。同様に、量子化幅の予測においても
、EOBの符号量を除外した符号量を用いて予測を行う
と良い。
Furthermore, in this embodiment, the EOB code amount was included in the determination of the standard allocated code amount for each block and the code amount control, but the EOB code amount does not change even if the quantization width changes. Of course, there is no problem in determining the standard allocated code amount for each block and controlling the code amount by excluding the EOB code amount in advance, but this is preferable since it improves accuracy. Similarly, in predicting the quantization width, it is preferable to perform prediction using a code amount excluding the EOB code amount.

また、圧縮率は可変でなくとも良く、一種類の圧縮率に
固定であり、目的総符号量、量子化幅、lブロック当た
りの基準割当符号量などが全て、固定値として与えられ
ても良く、このようにした場合にはその構成はより簡単
になる。また、画像データバッファメモリは直交変換回
路4と量子化回路6との間にあっても良く、むしろこの
ようにすると符号化処理におけるブロック化と直交変換
のプロセスを省略できる。しかし、精度を保つためには
、この場合、画像メモリのサイズが大きくなる。
Furthermore, the compression rate does not need to be variable; it may be fixed to one type of compression rate, and the target total code amount, quantization width, standard allocated code amount per l block, etc. may all be given as fixed values. , in this case, the configuration becomes simpler. Further, the image data buffer memory may be located between the orthogonal transform circuit 4 and the quantization circuit 6, and in this case, the blocking and orthogonal transform processes in the encoding process can be omitted. However, in order to maintain accuracy, the size of the image memory becomes large in this case.

また、プロセス処理もA/D変換の前に行うようにし、
その後にディジタル化するようにしても構わない。また
、本装置においては、ブロック毎の可変長符号化を低周
波成分より行い、画質への視覚的影響の比較的少ない高
周波成分が符号化の打ち切りにより省略されるようにし
ているので、画質の劣化を最小限に抑えて、しがも、高
圧縮で符号化できるようになる。
Also, process processing is performed before A/D conversion,
You may digitize it afterwards. In addition, in this device, variable-length encoding is performed for each block starting with low frequency components, and high frequency components, which have relatively little visual impact on image quality, are omitted by aborting the encoding, which improves image quality. This makes it possible to encode with high compression while minimizing deterioration.

以上、詳述した第1図および第2図の構成の本発明は、
要するに、統計処理の結果をもとに、求めた各ブロック
毎の基準割当符号量と、そのブロックの前のブロックで
の発生符号量の、割当符号量に対するの過不足分とを加
えた割当符号量に、符号量が収まるように、ブロック毎
に符号量を監視しながら、符号化を進め、符号量が割当
符号量に達すると、そのブロックの符号化は終了させる
か、直流成分は割当符号量を越える場合でも必ず符号化
させ、そのときの割当符号量の過不足を記憶しておき、
次のブロックの符号化に移ってゆくようにし、また、統
計処理の結果を元に予測した量子化係数の大きさにより
、符号化処理における各色成分の符号化の順序を決定す
るようにし、符号化処理においては、この決定した順序
で各色成分の符号化を進めるというものである。
The present invention having the configuration shown in FIGS. 1 and 2 described above has the following features:
In short, based on the results of statistical processing, the allocated code is the sum of the standard allocated code amount for each block and the excess or deficiency of the generated code amount in the block before that block with respect to the allocated code amount. Encoding is continued while monitoring the code amount for each block so that the code amount is within the allocated code amount, and when the code amount reaches the allocated code amount, the encoding of that block is terminated or the DC component is replaced with the allocated code. Be sure to encode even if the amount exceeds the amount, and remember the excess or deficiency of the allocated code amount at that time.
In addition, the coding order of each color component in the coding process is determined based on the magnitude of the quantization coefficient predicted based on the result of statistical processing. In the encoding process, each color component is encoded in the determined order.

これは、予測した量子化係数を用いて符号化した場合、
ある色成分ではブロック毎の基準割当符号量が余分であ
り、別の色成分ではブロック毎の基準割当符号量が不足
すると云うことがあるが、このような場合でも、各色成
分を合わせて考えれば、予測した量子化係数を用いて符
号化することにより、たとえ、ブロック毎の符号量を制
御しなくても、目的総符号量にがなり近い値となるので
、符号量が余分になる色成分から符号化を行い、各、余
った割当符号量をそれ以降の符号化に利用するようにす
れば、符号量の不足する色成分の割当符号量の不足分を
補うことができ、各色成分ともに、良好な結果が得られ
るようにするためである。
This means that when encoding using the predicted quantization coefficients,
There are cases where the standard allocated code amount per block is redundant for a certain color component, and the standard allocated code amount per block is insufficient for another color component, but even in such a case, if you consider each color component together, By encoding using the predicted quantization coefficient, even if the code amount for each block is not controlled, the total code amount will be close to the target total code amount, so color components that require an extra code amount will be By performing encoding from 1 to 3 and using the remaining allocated code amount for subsequent encoding, it is possible to compensate for the lack of allocated code amount for color components with insufficient code amount, and both color components , in order to obtain good results.

従って、この発明によれば、幅広い空間周波数の画像に
対し、画質を損なうことなく、一定の処理時間内で一定
の符号量内に収まるように符号化できるようになる。
Therefore, according to the present invention, it becomes possible to encode images with a wide range of spatial frequencies within a certain amount of code within a certain processing time without degrading the image quality.

上述した第2図の構成の符号化回路8oは、圧縮符号化
において、一連の処理を目的符号量に基づき、算出した
暫定的な量子化幅で第1パスの処理を行い、その結果を
もとに最適な量子化幅を求めてこの最適な量子化幅によ
り第2パスを実施し、最終的な圧縮符号化データを得る
と云った量目の処理で完成させるもので、第1パスによ
り最適なαを見付けるようにするものである。
In compression encoding, the encoding circuit 8o having the configuration shown in FIG. The process is completed by performing a second pass using this optimal quantization width to obtain the final compressed encoded data. This is to find the optimal α.

第3図においては符号化回路8oの処理の流れをわかり
易くするために、第1パスでの信号の流れを点線の矢印
■で、また、第2バスでの信号の流れを実線の矢印■で
それぞれ図示しである。この信号の流れに沿ってざっと
動作を追ってみると次のようになる。
In FIG. 3, in order to make it easier to understand the processing flow of the encoding circuit 8o, the signal flow in the first path is indicated by a dotted arrow ■, and the signal flow in the second bus is indicated by a solid arrow ■. Each is illustrated. If we briefly follow the operation along the flow of this signal, we will see the following.

画像データの符号化が行われるに当り、目的とする総符
号量が符号化回路8oの制御回路18内に設定される。
When encoding image data, a target total code amount is set in the control circuit 18 of the encoding circuit 8o.

これはスイッチ3oの操作により、使用者が所望の撮影
可能枚数を設定することにより、この設定した撮影可能
枚数に応じて制御回路90か最適符号量を選択し、これ
を目的総符号量の情報として符号化回路80に与えるこ
とで実現している。
By operating the switch 3o, the user sets the desired number of shots that can be taken, and the control circuit 90 selects the optimum code amount according to the set number of shots, and uses this as information on the target total code amount. This is realized by giving the code to the encoding circuit 80 as follows.

尚、初期状態では予め定めた標準的な撮影可能枚数に設
定される。
Note that in the initial state, the number of images that can be taken is set to a predetermined standard number.

撮影が行われると、これにより撮像系40内の撮像素子
から画像信号か出力される。この出力された画像信号は
信号処理回路60内においてディジタル信号に変換され
、バッファメモリに記憶された後、8X8画素のブロッ
ク単位で読み出され、Y成分、次にCr成分、次にCb
酸成分分離される。
When photographing is performed, an image signal is output from the image sensor in the imaging system 40. This output image signal is converted into a digital signal in the signal processing circuit 60, stored in a buffer memory, and then read out in blocks of 8x8 pixels, starting with the Y component, then the Cr component, and then the Cb component.
The acid component is separated.

この分離は最初にY成分について行われ、8×8画素の
ブロック単位で出力される Y成分の画像データは直交
変換回路4に入力されて、ブロック毎に直交変換(本例
ではDCT :離散コサイン変換(Discrete 
Co51ne Transform)が行われる。
This separation is first performed on the Y component, and the image data of the Y component is output in blocks of 8 x 8 pixels. Conversion (Discrete
Co51ne Transform) is performed.

直交変換回路4で得られたDCT変換係数は量子化回路
6に入力され、一方、制御回路18から目的総符号量が
量子化幅予測回路12に圧力され、量子化幅予測回路1
2ては目的総符号量から式(1)の関係を用いて量子化
係数aの初期値を設定し、量子化回路6に出力する。量
子化回路6ては、人力された量子化係数αを用いて、変
換係数を線形量子化する。量子化された変換係数は可変
長符号化回路8に入力され、可変長符号化(本例では)
\フマン符号化)が行われる。
The DCT transform coefficients obtained by the orthogonal transform circuit 4 are input to the quantization circuit 6, and on the other hand, the target total code amount is applied from the control circuit 18 to the quantization width prediction circuit 12.
2, the initial value of the quantization coefficient a is set from the target total code amount using the relationship of equation (1), and is output to the quantization circuit 6. The quantization circuit 6 linearly quantizes the transform coefficients using the manually generated quantization coefficient α. The quantized transform coefficients are input to the variable length encoding circuit 8 and are variable length encoded (in this example).
\Human encoding) is performed.

ここで入力された量子化係数は、ジグザグスキャンと呼
ばれる低周波数成分から高周波数成分への走査か行われ
、一番目の直流成分のデータは直前に可変長符号化を行
ったブロックの直流成分との差分値がハフマン符号化さ
れて出力される。
The quantization coefficients input here are scanned from low frequency components to high frequency components called zigzag scan, and the data of the first DC component is the DC component of the block that was variable-length encoded immediately before. The difference value is Huffman encoded and output.

交流成分については走査順序の2番目から64番目まで
順番に変換係数を見てゆき、変換係数か0でない(すな
わち、有効な)係数か出てきたら、その直前に存在した
連続した0(零;無効)の係数の数(セロラン)とその
有効係数との値で、2次元のハフマン符号化か行われる
。また、ある係数以降、64番目の係数まで、連続して
無効出力か続く場合には、ブロックの終りを示すEOB
の符号を出力する。
For the AC component, look at the conversion coefficients in order from the 2nd to the 64th in the scanning order, and when a conversion coefficient or a non-zero (i.e., valid) coefficient appears, it is the consecutive 0 (zero) that existed immediately before it. Two-dimensional Huffman encoding is performed using the values of the number of coefficients (invalid) (celloran) and their effective coefficients. In addition, if invalid output continues after a certain coefficient up to the 64th coefficient, an EOB indicating the end of the block is output.
Outputs the sign of .

可変長符号化回路8は、以上のような符号化か行われ、
1つの符号か発生する毎に、その符号長を符号量算出回
路14に出力する。
The variable length encoding circuit 8 performs encoding as described above,
Every time one code is generated, the code length is output to the code amount calculation circuit 14.

符号量算出回路14は人力された各符号長を色成分毎に
累積し、記憶する。
The code amount calculation circuit 14 accumulates and stores the manually input code lengths for each color component.

Y成分についてのこのような処理か終了すると、次にC
r成分、そしてCb酸成分ついても同様の処理を行う。
After completing this processing for the Y component, next
Similar treatment is performed for the r component and the Cb acid component.

一画像について、符号化が終了すると、符号量算出回路
14は累積した色成分毎の符号量を加算して画像全体の
符号量を総符号量値として算出する。この総符号量値は
量子化幅予測回路I2に圧力され、また、各色成分毎の
符号量及び画像全体の符号量割当回路2Gに出力される
When the encoding of one image is completed, the code amount calculation circuit 14 adds the accumulated code amounts for each color component and calculates the code amount of the entire image as a total code amount value. This total code amount value is applied to the quantization width prediction circuit I2, and is also output to the code amount allocation circuit 2G for each color component and the code amount for the entire image.

以上の第1パスの符号化処理が終了すると、符号量割当
回路20は符号量算出回路14から入力された各色成分
毎の符号量、画像全体の符号量と、目的符号量およびブ
ロック数から、各色成分毎の1ブロツク当たりの割当符
号量を算出する。また、量子化幅予測回路12では第1
バスでの符号化により求められた絵画像符号量と、制御
回路18から与えられた目的総符号量とから、より適し
た量子化係数αを予測し、量子化回路6に出力する。更
にまた、量子化幅予測回路12ては第1バスで使用した
量子化係数と、予測した量子化係数とを、その大きさを
比較することによって各色成分の符号化の順番を決定し
、制御回路18に比カする。
When the above-described first pass encoding processing is completed, the code amount allocation circuit 20 calculates the code amount from the code amount for each color component inputted from the code amount calculation circuit 14, the code amount for the entire image, the target code amount, and the number of blocks. The allocated code amount per block for each color component is calculated. Also, in the quantization width prediction circuit 12, the first
A more suitable quantization coefficient α is predicted from the picture image code amount obtained by encoding on the bus and the target total code amount given from the control circuit 18, and is output to the quantization circuit 6. Furthermore, the quantization width prediction circuit 12 determines the coding order of each color component by comparing the magnitudes of the quantization coefficients used in the first bus and the predicted quantization coefficients, and performs control. Compared to circuit 18.

続いて同し画像データに対して第2バスの符号化処理か
行イっれる。第2バスでは信号処理回路60内のメモリ
から読み出された画像データは、第1パスで決定した順
序で色成分に分離され、それぞれの成分の画像データは
8X8画素のブロック化等の処理が行われた後、直交変
換回路4に入力され、ブロック毎に直交変換(DCT変
換)され、これにより、直交変換回路4て得られたDC
T変換係数は量子化回路6に入力される。
Subsequently, the same image data is subjected to encoding processing on the second bus. On the second bus, the image data read from the memory in the signal processing circuit 60 is separated into color components in the order determined in the first pass, and the image data of each component undergoes processing such as 8x8 pixel blocks. After the conversion, the DC data obtained by the orthogonal transform circuit 4 is inputted to the orthogonal transform circuit 4, and is orthogonally transformed (DCT transform) for each block.
The T transform coefficients are input to the quantization circuit 6.

一方、量子化回路6においては、与えられたこの予測に
よる新たな量子化係数αによる補正済み量子化幅を用い
て、DCT変換係数を線形量子化する。量子化された係
数は可変長符号化回路8に人力され、第1パスの符号化
時と同様の方式でハフマン符号化される。ここで符号化
時に発生した符号量は第1パスの終了時に求められ、符
号量割当回路20に記憶されている各ブロックの基準割
当符号量と、前ブロックでの割当符号量の過不足とを加
えた当該ブロックの割当符号量との比較が行われ、これ
を越えた場合には符号打切回路16の働きにより、その
ブロック内でそれ以降の符号化が打ち切られる。また、
当該ブロックの符号化を終了した時点での割当符号量の
過不足は、符号量割当回路20に記憶される。
On the other hand, the quantization circuit 6 linearly quantizes the DCT transform coefficients using the corrected quantization width based on the new quantization coefficient α given by this prediction. The quantized coefficients are input to the variable length encoding circuit 8 and Huffman encoded in the same manner as in the first pass encoding. Here, the amount of code generated during encoding is obtained at the end of the first pass, and is calculated based on the standard allocated code amount of each block stored in the code amount allocation circuit 20 and the excess or deficiency of the allocated code amount in the previous block. A comparison is made with the added allocated code amount of the block, and if this is exceeded, the code abort circuit 16 works to abort subsequent encoding within that block. Also,
Excess/deficiency of the allocated code amount at the time when the encoding of the block is finished is stored in the code amount allocation circuit 20.

以上の方法により目的総符号量に制御された符号化デー
タは順次、符号出力回路lOを経由して記録系70に出
力され、記録される。
The encoded data controlled to the target total code amount by the above method is sequentially outputted to the recording system 70 via the code output circuit 10 and recorded.

次に記録系70にて記録された記録媒体71の圧縮符号
化記録画像データの再生について説明する。
Next, reproduction of compressed and encoded recorded image data recorded on the recording medium 71 by the recording system 70 will be explained.

第4図に再生機の構成を示す。図において、100は再
生機本体であり、この再生機本体100は読取部102
、復号化回路104および処理回路10Bおよび制御回
路10gを備える。読取部102は記憶媒体71を着脱
でき、記t8. ff体71p内容をインタフェース回
路110を介して読出すようになっている。
Figure 4 shows the configuration of the player. In the figure, 100 is a main body of the playback machine, and this main body 100 of the playback machine includes a reading section 102.
, a decoding circuit 104, a processing circuit 10B, and a control circuit 10g. The reading unit 102 can attach and detach the storage medium 71, and the reading unit 102 can attach and detach the storage medium 71. The contents of the ff body 71p are read out via the interface circuit 110.

復号化回路104は第5図のような機能ブロックを有す
る。すなわち、112はハフマン符号化データを復号化
するハフマン復号部、114はこのハフマン復号されて
得られたデータを、記憶媒体71から読み出されて設定
入力された量子化幅の情報に基づいて逆量子化する逆量
子化部、11Bはこの逆量子化されて得られたデータを
逆DCT変換して映像信号データとして圧力するIDC
T (逆DCT変換)部、そして、IHIはこれらの制
御を司る制御部である。
The decoding circuit 104 has functional blocks as shown in FIG. That is, 112 is a Huffman decoding unit that decodes Huffman encoded data, and 114 is a Huffman decoding unit that decodes the data obtained by Huffman decoding based on the quantization width information read from the storage medium 71 and set and input. The inverse quantization unit 11B performs quantization, and the IDC performs inverse DCT transformation on the data obtained by inverse quantization and converts it into video signal data.
The T (inverse DCT transform) section and the IHI are control sections that control these.

処理回路106はバッファメモリ120、エンコーダ1
22およびD/A変換器124を備える。バッファメモ
リ120は復号化回路104から出力された映像信号デ
ータを一時保持するメモリであり、エンコーダ122は
このバッファメモリ120から読み出される映像信号デ
ータをNTSC方式の映像信号に変換するものであり、
D/A変換器124はこのNTSC方式の映像信号をア
ナログ変換してテレビ用の映像信号として出力するため
のものである。
The processing circuit 106 includes a buffer memory 120 and an encoder 1.
22 and a D/A converter 124. The buffer memory 120 is a memory that temporarily holds the video signal data output from the decoding circuit 104, and the encoder 122 converts the video signal data read from the buffer memory 120 into an NTSC video signal.
The D/A converter 124 converts this NTSC video signal into analog and outputs it as a television video signal.

前記制御回路108は再生機本体100全体の制御を司
るものであり、再生機本体100の読取部102に対し
、符号化時の量子化幅の情報と、各色成分の符号化の順
序を識別するための情報を読み出すべく制御して、その
結果、記録媒体71から読み出された符号化時の量子化
幅の情報を復号化回路104の逆量子化部114に設定
させ、続いて制御−回路108は読み出された各色成分
の符号化の順序で情報記録媒体71から圧縮符号化され
た映像信号データを読出すべく、読取部102を制御す
ると云った制御を行う。また、図示しないが再生機本体
100には、コマ送りスイッチ等があり、このスイッチ
により指定されたコマ位置の映像を再生したりすること
ができる。このような制御も制御回路10gが行う。
The control circuit 108 is in charge of overall control of the player main body 100, and identifies information on the quantization width at the time of encoding and the coding order of each color component to the reading unit 102 of the player main body 100. As a result, the dequantization unit 114 of the decoding circuit 104 sets the information of the quantization width at the time of encoding read from the recording medium 71, and then the control circuit Reference numeral 108 performs control such as controlling the reading unit 102 so as to read the compression-encoded video signal data from the information recording medium 71 in the order in which the read color components are encoded. Further, although not shown, the playback main body 100 includes a frame advance switch and the like, and the video at the frame position specified by this switch can be played back. Such control is also performed by the control circuit 10g.

次に上記構成の再生機の動作を説明する。圧縮符号化さ
れた映像信号データが記録された記録媒体(メモリカー
ド) 71が再生機本体100の読取部102に装着さ
れると、まず、制御回路10gは読取部102に対し、
符号化時の量子化幅の情報を読み出すべく制御する。そ
の結果、読取部102において記録媒体71から符号化
時の量子化幅の情報が読み出され、この情報は復号化回
路104の逆量子化部114に設定される。続いて制御
回路108は記録媒体71から映像信号を読出すべく、
読取部102を制御するので、読取部102は記録媒体
7!から映像信号を順次読み出し、復号化回路104に
入力する。
Next, the operation of the reproducing machine having the above configuration will be explained. When the recording medium (memory card) 71 on which compression-encoded video signal data is recorded is attached to the reading section 102 of the playback main body 100, the control circuit 10g first sends the following information to the reading section 102.
Control is performed to read out information on quantization width during encoding. As a result, information on the quantization width at the time of encoding is read out from the recording medium 71 in the reading unit 102, and this information is set in the dequantization unit 114 of the decoding circuit 104. Next, the control circuit 108 reads out the video signal from the recording medium 71.
Since the reading unit 102 is controlled, the reading unit 102 reads the recording medium 7! Video signals are sequentially read out from the decoding circuit 104 and input to the decoding circuit 104.

これを受けた復号化回路104ては、ハフマン復号部1
12においてハフマン符号を復号し、量子化係数を得る
。こうして得られた量子化係数は逆量子化回路114に
与えて逆量子化する。ここでの逆量子化は先に設定され
ている前記量子化幅の情報を用いて行われる。
The decoding circuit 104 that receives this inputs the Huffman decoding unit 1.
12, the Huffman code is decoded to obtain quantized coefficients. The quantized coefficients obtained in this way are supplied to an inverse quantization circuit 114 for inverse quantization. The inverse quantization here is performed using the information on the quantization width set previously.

逆量子化により得られた変換係数は、I DOT部11
Bにおいてブロック毎に逆DCT変換され、元の映像信
号に復元される。このようにして先に設定されている各
色成分の順で映像信号が復元されて復号化回路104か
ら出力され、処理回路10[i内のバッファメモリ12
0に書き込まれる。1画面の映像信号データの書き込み
が終了すると、バッファメモリ120から通常のテレビ
信号の走査順で映像信号データか読み出され、エンコー
ダ122においてNTSC方式の映像信号に変換される
。更にD/^変換器124によりアナログ信号に変換さ
れ、出力される。この映像信号をテレビモニタに入力す
ることにより、画像がテレビ映像として再生され、映像
として鑑賞でき、また、ビデオプリンタ等のプリント装
置に与えてプリントすることにより、ハードコピーが得
られるので、写真等と同様な形で鑑賞することがきるよ
うになる。
The transform coefficients obtained by inverse quantization are transferred to the IDOT unit 11.
In B, each block is subjected to inverse DCT transformation and restored to the original video signal. In this way, the video signal is restored in the order of each color component set previously and output from the decoding circuit 104, and the buffer memory 12 in the processing circuit 10 [i
Written to 0. When writing of the video signal data for one screen is completed, the video signal data is read out from the buffer memory 120 in the normal scanning order of the television signal, and is converted into an NTSC video signal by the encoder 122. Furthermore, it is converted into an analog signal by the D/^ converter 124 and output. By inputting this video signal to a TV monitor, the image can be played back as a TV video and viewed as a video.Also, by feeding it to a printing device such as a video printer and printing it, a hard copy can be obtained, so it can be used as a photo, etc. You will be able to appreciate it in a similar way.

以上説明したように、カメラは所望の撮影可能枚数を設
定でき、撮影可能枚数を設定することで、カメラではこ
れに対応する圧縮率を自動設定′すると共に、この設定
圧縮率に応じて定まる暫定的な量子化幅を用いて、1画
面分の撮影画像データを2子化し、可変長符号化し、そ
の結果得られるその1画面分の撮影画像データの符号量
より最適量子化幅を予mjL、この予測した最適量子化
幅により前記1画面分の撮影画像データを量子化し、可
変長符号化するようにし、符号化された映像信号の再生
時には撮影時に使用しt:前記最適量子化幅を用いて復
号することにより、所望の圧縮率での符号化を圧縮率側
にハードウェアを設ける二となく、共通の一つのハード
ウェアで実現でき、同様に所望の圧縮率で符号化されt
:画像データの復号化を圧縮率側にハードウェアを設け
ることなく、共通の一つのハードウェアで実現できる。
As explained above, the camera can set the desired number of shots that can be taken, and by setting the number of shots that can be taken, the camera automatically sets the compression rate corresponding to this, and the temporary Using a quantization width of The captured image data for one screen is quantized and variable-length encoded using the predicted optimal quantization width, and when the encoded video signal is played back, it is used at the time of shooting. By decoding at the desired compression rate, encoding at the desired compression rate can be realized with one common hardware, without having to install hardware on the compression rate side.
: Decoding of image data can be realized with one common hardware without installing hardware on the compression ratio side.

尚、実施例では符号化の過程か第1バス、第2バスの2
回の処理で終了する2パス方式としたが、これに限るも
のではなく、第1バスを更に何度か繰り返すと更に良好
な結果が得られる。また、記録媒体にメモリカードを用
いた例を示したが、その他、フロッピディスク、光ディ
スク、磁気テープ等を利用することもてきる。また、カ
メラと再生機が別体となっているものを示したが、カメ
ラが再生機の機能を合せ持つ一体型のものでもよい。さ
らにまた、実施例では量子化幅の値そのものを記録媒体
に記録するようにしたが、量子化幅値を変換あるいは符
号化して記録するようにしても良い。
In the embodiment, during the encoding process, two buses, the first bus and the second bus,
Although the two-pass method is used, the method is not limited to this, and even better results can be obtained by repeating the first bus several more times. Further, although an example is shown in which a memory card is used as the recording medium, other media such as a floppy disk, an optical disk, and a magnetic tape may also be used. Further, although the camera and the playback device are shown as separate bodies, the camera may be an integrated type that also has the functions of the playback device. Furthermore, in the embodiment, the quantization width value itself is recorded on the recording medium, but the quantization width value may be converted or encoded and then recorded.

以上の実施例では目的縁符号量がら;子化幅を設定して
いたが、複数の目的縁符号−をモードで切換えて使用す
るようなアプリケーションにおいては、それぞれのモー
トに対応する量子化幅を予め用意しておき、これをモー
ドで切り換えて使用するようにしても勿論差支えない。
In the above embodiment, the quantization width is set according to the target edge code amount, but in applications where multiple target edge codes are used by switching between modes, the quantization width corresponding to each mote can be set. Of course, it is also possible to prepare it in advance and use it by switching it depending on the mode.

尚、本発明は上記し、且つ、図面に示す実施例に限定す
ることなくその要旨を変更しない範囲内で適宜変形して
実施し得るものであり、本発明はスチル画像に限らず動
画像等、種々の画像に対しての圧縮符号化に適用できる
ものである。
It should be noted that the present invention is not limited to the embodiments described above and shown in the drawings, and can be implemented with appropriate modifications within the scope of the gist, and the present invention is applicable not only to still images but also to moving images, etc. , which can be applied to compression encoding of various images.

また、上記実施例では圧縮率対応情報より総符号二の情
報を与え、この総符号量に対応した量子化幅を与えるこ
とのできる量子化係数の予測を行い、この子DIされた
量子化係数に基づく量子化幅で量子化を行うようにして
いるが、予め圧縮率対応情報に対する量子化幅の関係を
計算で求めてテーブル化しておき、これをメモリ等に記
憶して、圧縮率対応情報から直接、量子化幅の情報(す
なわち、量子化係数或いは量子化幅の値)を出力させる
ようにすることもてきる。このようにすれば、所望の圧
縮率に対応する情報を入力すると、この入力された圧縮
率対応情報に対応じて一義的に定まる量子化幅の情報を
読出して出力でき、即座に最適−子化幅を設定できて直
ちに量子化回路にこの量子化幅で画像信号データを量子
化させることができるようになる。
In addition, in the above embodiment, information on a total code of 2 is given from the compression rate correspondence information, a quantization coefficient that can give a quantization width corresponding to this total code amount is predicted, and this child DI quantization coefficient is Quantization is performed using a quantization width based on the compression rate correspondence information, but the relationship between the quantization width and the compression rate correspondence information is calculated in advance and created in a table. This is stored in memory etc., and the compression rate correspondence information is It is also possible to directly output the quantization width information (that is, the quantization coefficient or the quantization width value). In this way, when information corresponding to the desired compression ratio is input, information on the quantization width that is uniquely determined according to the input compression ratio information can be read and output, and the optimal Immediately after setting the quantization width, the quantization circuit can quantize the image signal data using this quantization width.

この構成によれば、メモリ等に各種の圧縮率に対応した
最適量子化幅の情報を予め記憶させて、これを入力圧縮
率対応情報に対応じて読出すだけて最適量子化幅の情報
を与えることができるので、目的縁符号量に収まるよう
符号化するに当り、その処理を極めて短時間で行える他
、ハードウェアも簡単で済むようになる。
According to this configuration, information on the optimal quantization width corresponding to various compression ratios is stored in advance in a memory, etc., and the information on the optimal quantization width can be obtained by simply reading out the information in accordance with the input compression ratio correspondence information. Therefore, when encoding to fit within the target edge code amount, the processing can be done in an extremely short time and the hardware can be simple.

〔発明の効果〕〔Effect of the invention〕

以上詳述したように、本発明によれば、幅広い空間周波
数の画像に対し、画質を損なうことなく、符号量の制御
が行えると共に、一定の処理時間て一定の符号量内に収
まるように符号化処理ができる等、電子カメラシステム
等に最適な画像データの符号化装置および符号化方法を
提供できる。
As described in detail above, according to the present invention, it is possible to control the amount of code for images with a wide range of spatial frequencies without degrading the image quality, and to encode images within a certain amount of code within a certain processing time. Accordingly, it is possible to provide an image data encoding device and encoding method that are suitable for electronic camera systems and the like.

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

第1図は本発明の第1の実施例を示すブロック図、第2
図は本発明装置の要部構成例を示すブロック図、第3図
は第2図回路の動作の流れを説明するためのブロック図
、第4図および第5図は再生機の構成を示すブロック図
、第6図は本発明による電子カメラ本体の外観を示す斜
視図、第7図は8X8画素に分けられたブロックのジグ
サグ・スキャンを説明するための図、第8図は本発明の
原理的な作用を説明するための動作遷移図、第9図は従
来技術を説明するための動作遷移図、第10図は符号量
と量子化幅の関係を説明するための図である。 1・・・電子カメラ本体、6・・量子化回路、8・・・
可変長符号化回路、10・・・符号出力回路、12・・
・量子化幅予測回路、14・・・符号量算出回路、16
・・・符号化打切回路、18.18a・・・制御回路、
20・・・符号量割当回路、24・・・DCPM回路、
30・・スイッチ、40・・・撮像系、48・・・LC
D表示器、60・・・信号処理回路、80・符号化回路
、70・・・記録系、71・・記録媒体、9o・制御回
路、100・・・再生機本体、102・・・読取部、1
04・・・復号化回路、106・・処理回路、108・
・制御回路、110・・インタフェース回路、112・
・・ハフマン復号部、114・・逆量子化部、11B・
・・IDCT (逆DCT変換)部、118 ・制御部
。 出願人代理人 弁理士 坪井  淳 第6図 旦流成分   交ミ几尻分 笥7図 095F 量子化仏教 第10図
FIG. 1 is a block diagram showing a first embodiment of the present invention;
The figure is a block diagram showing an example of the main part configuration of the device of the present invention, FIG. 3 is a block diagram for explaining the flow of operation of the circuit shown in FIG. 2, and FIGS. 4 and 5 are block diagrams showing the configuration of the regenerator. 6 is a perspective view showing the external appearance of the electronic camera body according to the present invention, FIG. 7 is a diagram for explaining zig-sag scanning of a block divided into 8×8 pixels, and FIG. 8 is a diagram showing the principle of the present invention. FIG. 9 is an operation transition diagram for explaining the conventional technique, and FIG. 10 is a diagram for explaining the relationship between code amount and quantization width. 1... Electronic camera body, 6... Quantization circuit, 8...
Variable length encoding circuit, 10... Code output circuit, 12...
・Quantization width prediction circuit, 14... code amount calculation circuit, 16
... Encoding abort circuit, 18.18a... Control circuit,
20... Code amount allocation circuit, 24... DCPM circuit,
30...Switch, 40...Imaging system, 48...LC
D display, 60...signal processing circuit, 80...encoding circuit, 70...recording system, 71...recording medium, 9o...control circuit, 100...player main body, 102...reading section ,1
04...Decoding circuit, 106...Processing circuit, 108...
・Control circuit, 110 ・・Interface circuit, 112 ・
... Huffman decoding section, 114... Inverse quantization section, 11B.
...IDCT (inverse DCT transformation) unit, 118 - Control unit. Applicant's agent Patent attorney Jun Tsuboi Diagram 6 Danryu component Komi Sajiri Bunsha 7 Diagram 095F Quantized Buddhism Diagram 10

Claims (15)

【特許請求の範囲】[Claims] (1)色成分別に分離されたカラー画像データそれぞれ
をブロックに分割し、色成分別のこの分割されたブロッ
ク毎に直交変換を行ってからこの変換出力を量子化手段
により量子化し、その後、この量子化出力を可変長符号
化手段に与えて可変長符号化し、データの符号化を行う
際に、初めに暫定的に定めた量子化幅で量子化して可変
長符号化し、各ブロック毎の符号量を得る統計処理を行
い、次にこの統計処理により求めた各ブロック毎の符号
量から最適量子化幅と各ブロック毎の割当符号量とを決
定し、この決定した最適量子化幅に従って各ブロック毎
の前記変換出力の量子化を行うと共にこの量子化出力を
各ブロック毎の割当符号量に従って各ブロック毎に符号
量制御を行いながら順次可変長符号化する符号化処理を
実施する符号化装置において、 前記ブロックのうち、次に符号化処理する処理対象ブロ
ックの前に処理した処理済みブロックでの符号化により
発生した符号量と当該処理済みブロックでの割当符号量
との差を求めてこれと前記処理対象ブロックの前記割当
符号量とを加え、当該処理対象ブロックでの割当符号量
として割り当てる符号量割当手段と、 前記処理対象ブロックでの符号化処理時に前記符号量割
当手段により割り当てられた割当符号量を越えないよう
に、前記可変長符号化を打ち切る符号化打ち切り手段と
、 前記最適量子化幅にて量子化する際の各色成分別の符号
量予測値に応じ前記カラー画像データの符号化処理にお
ける色成分別の処理順位を決定する符号順決定手段と、 この符号順決定手段により決定された処理すべき色成分
順位に従い、順位の高い色成分の前記カラー画像データ
より符号化処理させるべく制御する制御手段と を備えたことを特徴とする画像データの符号化装置。
(1) Divide each of the color image data separated by color component into blocks, perform orthogonal transformation for each divided block by color component, and then quantize the transform output by quantization means. The quantized output is given to a variable-length encoding means to be variable-length encoded, and when data is encoded, it is first quantized with a provisionally determined quantization width and variable-length encoded, and the code for each block is Then, from the code amount for each block obtained by this statistical processing, the optimal quantization width and the allocated code amount for each block are determined, and each block is divided according to the determined optimal quantization width. In an encoding device that performs encoding processing of quantizing the transform output for each block and sequentially variable-length encoding the quantized output while controlling the code amount for each block according to the allocated code amount for each block. , Of the blocks, calculate the difference between the amount of code generated by encoding in the processed block processed before the block to be encoded next and the amount of code allocated to the processed block. a code amount allocation means that adds the allocated code amount of the processing target block and allocates the allocated code amount as the allocated code amount in the processing target block; coding aborting means for aborting the variable length encoding so as not to exceed the code amount; and encoding the color image data according to the code amount predicted value for each color component when quantizing with the optimum quantization width. a code order determining means for determining a processing order for each color component in processing; and a code order determining means for performing encoding processing on the color image data of color components having higher ranks according to the order of color components to be processed determined by the code order determining means. 1. An image data encoding device comprising: a control means for controlling the image data.
(2)前記符号順決定手段は符号量が少ない色成分につ
いて処理順位を高くすることを特徴とする請求項(1)
記載の画像データの符号化装置。
(2) Claim (1) characterized in that the code order determining means gives a higher processing order to a color component with a small amount of codes.
The image data encoding device described above.
(3)色成分別に分離されたカラー画像データそれぞれ
をブロックに分割し、色成分別のこの分割されたブロッ
ク毎に直交変換を行ってからこの変換出力を量子化手段
により量子化し、その後、この量子化出力を可変長符号
化手段に与えて可変長符号化し、データの符号化を行う
際に、初めに暫定的に定めた量子化幅で量子化して可変
長符号化し、各ブロック毎の符号量を得る統計処理を行
い、次にこの統計処理により求めた各ブロック毎の符号
量から最適量子化幅と各ブロック毎の割当符号量とを決
定し、この決定した最適量子化幅に従って各ブロック毎
の前記変換出力の量子化を行うと共にこの量子化出力を
各ブロック毎の割当符号量に従って各ブロック毎に符号
量制御を行いながら順次可変長符号化する符号化処理を
実施する符号化装置において、 前記ブロックのうち、次に符号化処理する処理対象ブロ
ックの前に処理した処理済みブロックでの符号化により
発生した符号量と当該処理済みブロックでの割当符号量
との差を求めてこれと前記処理対象ブロックの前記割当
符号量とを加え、当該処理対象ブロックでの割当符号量
として割り当てる符号量割当手段と、 前記処理対象ブロックでの符号化処理時に前記符号量割
当手段により割り当てられた割当符号量を越えないよう
に、前記可変長符号化を打ち切る符号化打ち切り手段と
、 前記可変長符号化手段により可変長符号化された変換係
数を符号として出力する符号化出力手段と、 前記最適量子化幅にて量子化する際の各色成分別の符号
量予測値に応じ前記カラー画像データの符号化処理にお
ける色成分別の処理順位を決定する符号順決定手段と、 この符号順決定手段により決定された処理すべき色成分
順位に従い、順位の高い色成分の前記カラー画像データ
より符号化処理させるべく制御する制御手段と を備えたことを特徴とする画像データの符号化装置。
(3) Divide each of the color image data separated by color component into blocks, perform orthogonal transformation for each divided block by color component, and then quantize the transform output by quantization means. The quantized output is given to a variable-length encoding means to be variable-length encoded, and when data is encoded, it is first quantized with a provisionally determined quantization width and variable-length encoded, and the code for each block is Then, from the code amount for each block obtained by this statistical processing, the optimal quantization width and the allocated code amount for each block are determined, and each block is divided according to the determined optimal quantization width. In an encoding device that performs encoding processing of quantizing the transform output for each block and sequentially variable-length encoding the quantized output while controlling the code amount for each block according to the allocated code amount for each block. , Of the blocks, calculate the difference between the amount of code generated by encoding in the processed block processed before the block to be encoded next and the amount of code allocated to the processed block. a code amount allocation means that adds the allocated code amount of the processing target block and allocates the allocated code amount as the allocated code amount in the processing target block; encoding terminating means for terminating the variable length encoding so as not to exceed the code amount; encoding output means for outputting the transform coefficients variable length encoded by the variable length encoding means as codes; and the optimal quantum code order determining means for determining a processing order for each color component in encoding processing of the color image data according to a code amount prediction value for each color component when quantizing with a quantization width; and a code order determining means determined by the code order determining means. 1. A control means for controlling the color image data of color components having a higher rank to be encoded in accordance with the rank of color components to be processed.
(4)色成分別に分離されたカラー画像データそれぞれ
をブロックに分割し、色成分別のこの分割されたブロッ
ク毎に直交変換を行ってからこの変換出力を量子化手段
により量子化し、その後、この量子化出力を可変長符号
化手段に与えて可変長符号化し、データの符号化を行う
際に、初めに暫定的に定めた量子化幅で量子化して可変
長符号化し、各ブロック毎の符号量を得る統計処理を行
い、次にこの統計処理により求めた各ブロック毎の符号
量から最適量子化幅と各ブロック毎の割当符号量とを決
定し、この決定した最適量子化幅に従って各ブロック毎
の前記変換出力の量子化を行うと共にこの量子化出力を
各ブロック毎の割当符号量に従って各ブロック毎に符号
量制御を行いながら順次可変長符号化する符号化処理を
実施する符号化装置において、 前記ブロックのうち、次に符号化処理する処理対象ブロ
ックの前に処理した処理済みブロックでの符号化により
発生した符号量と当該処理済みブロックでの割当符号量
との差を求めてこれと前記処理対象ブロックの前記割当
符号量とを加え、当該処理対象ブロックでの割当符号量
として割り当てる符号量割当手段と、 前記処理対象ブロックでの符号化処理時に前記符号量割
当手段により割り当てられた割当符号量を越えないよう
に、前記可変長符号化を打ち切る符号化打ち切り手段と
、 前記暫定的に定めた量子化幅と最適量子化幅より前記カ
ラー画像データの符号化処理における色成分別の処理順
位を決定する符号順決定手段と、この符号順決定手段に
より決定された処理すべき色成分順位に従い、順位の高
い色成分の前記カラー画像データより符号化処理させる
べく制御する制御手段と を備えたことを特徴とする画像データの符号化装置。
(4) Divide each of the color image data separated by color component into blocks, perform orthogonal transformation for each divided block by color component, and then quantize the transform output by a quantization means. The quantized output is given to a variable-length encoding means to be variable-length encoded, and when data is encoded, it is first quantized with a provisionally determined quantization width and variable-length encoded, and the code for each block is Then, from the code amount for each block obtained by this statistical processing, the optimal quantization width and the allocated code amount for each block are determined, and each block is divided according to the determined optimal quantization width. In an encoding device that performs encoding processing of quantizing the transform output for each block and sequentially variable-length encoding the quantized output while controlling the code amount for each block according to the allocated code amount for each block. , Of the blocks, calculate the difference between the amount of code generated by encoding in the processed block processed before the block to be encoded next and the amount of code allocated to the processed block. a code amount allocation means that adds the allocated code amount of the processing target block and allocates the allocated code amount as the allocated code amount in the processing target block; encoding aborting means for aborting the variable length encoding so as not to exceed the code amount; and processing for each color component in the encoding process of the color image data based on the tentatively determined quantization width and the optimal quantization width. A code order determining means for determining the order, and a control means for controlling the color image data of the color component having a higher order to be subjected to encoding processing according to the order of the color components to be processed determined by the code order determining means. An image data encoding device characterized in that:
(5)色成分別に分離されたカラー画像データそれぞれ
をブロックに分割し、色成分別のこの分割されたブロッ
ク毎に直交変換を行ってからこの変換出力を量子化手段
により量子化し、その後、この量子化出力を可変長符号
化手段に与えて可変長符号化し、データの符号化を行う
際に、初めに暫定的に定めた量子化幅で量子化して可変
長符号化し、各ブロック毎の符号量を得る統計処理を行
い、次にこの統計処理により求めた各ブロック毎の符号
量から最適量子化幅と各ブロック毎の割当符号量とを決
定し、この決定した最適量子化幅に従って各ブロック毎
の前記変換出力の量子化を行うと共にこの量子化出力を
各ブロック毎の割当符号量に従って各ブロック毎に符号
量制御を行いながら順次可変長符号化する符号化処理を
実施する符号化装置において、 前記統計処理における可変長符号化された変換係数の画
像全体の符号量および各ブロック毎の符号量を算出する
符号量算出手段と、 この符号量算出手段により算出された画像全体の符号量
と収めるべき目的の符号量と前記暫定的な量子化幅とか
ら前記符号化処理に使用する最適量子化幅を予測すると
共に、前記量子化手段にこの予測した最適量子化幅を与
える量子化幅予測手段と、 符号化処理時において、前記ブロックのうち、次に符号
化処理する処理対象ブロックの前に処理した処理済みブ
ロックでの符号化により発生した符号量と当該処理済み
ブロックでの割当符号量との差を求めてこれと前記処理
対象ブロックの前記割当符号量とを加え、当該処理対象
ブロックでの割当符号量として割り当てる符号量割当手
段と、符号化処理時において、前記処理対象ブロックで
の符号化の際に前記符号量割当手段により割り当てられ
た割当符号量を越えないように、前記可変長符号化を打
ち切る符号化打ち切り手段と、前記最適量子化幅にて量
子化する際の各色成分別の符号量予測値に応じ前記カラ
ー画像データの符号化処理における色成分別の処理順位
を決定する符号順決定手段と、 この符号順決定手段により決定された処理すべき色成分
順位に従い、順位の高い色成分の前記カラー画像データ
より符号化処理させるべく制御する制御手段と を備えたことを特徴とする画像データの符号化装置。
(5) Divide each of the color image data separated by color component into blocks, perform orthogonal transformation for each divided block by color component, and then quantize the transform output by quantization means. The quantized output is given to a variable-length encoding means to be variable-length encoded, and when data is encoded, it is first quantized with a provisionally determined quantization width and variable-length encoded, and the code for each block is Then, from the code amount for each block obtained by this statistical processing, the optimal quantization width and the allocated code amount for each block are determined, and each block is divided according to the determined optimal quantization width. In an encoding device that performs encoding processing of quantizing the transform output for each block and sequentially variable-length encoding the quantized output while controlling the code amount for each block according to the allocated code amount for each block. , a code amount calculation means for calculating the code amount of the entire image and the code amount for each block of the variable-length encoded transform coefficients in the statistical processing; and the code amount of the entire image calculated by the code amount calculation means. Quantization width prediction that predicts an optimal quantization width to be used in the encoding process from the target code amount to be stored and the provisional quantization width, and provides the predicted optimal quantization width to the quantization means. means; during encoding processing, the amount of code generated by encoding in a processed block that is processed before the block to be processed next to be coded among the blocks and the amount of code allocated to the processed block; and a code amount allocation means which calculates the difference between the two and adds this to the allocated code amount of the processing target block and allocates it as the allocated code amount of the processing target block, and at the time of encoding processing, coding aborting means for aborting the variable length encoding so as not to exceed the allocated code amount allocated by the code amount allocating means during encoding; and each color component when quantizing at the optimum quantization width. code order determining means for determining the processing order for each color component in the encoding process of the color image data according to another code amount prediction value; and a control means for controlling the color image data having a high color component to be subjected to encoding processing.
(6)色成分別に分離されたカラー画像データそれぞれ
をブロックに分割し、色成分別のこの分割されたブロッ
ク毎に直交変換を行ってからこの変換出力を量子化手段
により量子化し、その後、この量子化出力を可変長符号
化手段に与えて可変長符号化し、データの符号化を行う
際に、初めに暫定的に定めた量子化幅で量子化して可変
長符号化し、各ブロック毎の符号量を得る統計処理を行
い、次にこの統計処理により求めた各ブロック毎の符号
量から最適量子化幅と各ブロック毎の割当符号量とを決
定し、この決定した最適量子化幅に従って各ブロック毎
の前記変換出力の量子化を行うと共にこの量子化出力を
各ブロック毎の割当符号量に従って各ブロック毎に符号
量制御を行いなから順次可変長符号化する符号化処理を
実施する符号化装置において、 前記統計処理における可変長符号化された変換係数の画
像全体の符号量および各ブロック毎の符号量を算出する
符号量算出手段と、 この符号量算出手段により算出された画像全体の符号量
と収めるべき目的の符号量と前記暫定的な量子化幅とか
ら前記符号化処理に使用する最適量子化幅を予測すると
共に、前記量子化手段にこの予測した最適量子化幅を与
える量子化幅予測手段と、 符号化処理時において、前記ブロックのうち、次に符号
化処理する処理対象ブロックの前に処理した処理済みブ
ロックでの符号化により発生した符号量と当該処理済み
ブロックでの割当符号量との差を求めてこれと前記処理
対象ブロックの前記割当符号量とを加え、当該処理対象
ブロックでの割当符号量として割り当てる符号量割当手
段と、符号化処理時において、前記処理対象ブロックで
の符号化の際に前記符号量割当手段により割り当てられ
た割当符号量を越えないように、前記可変長符号化を打
ち切る符号化打ち切り手段と、前記暫定的に定めた量子
化幅と最適量子化幅より前記カラー画像データの符号化
処理における色成分別の処理順位を決定する符号順決定
手段と、この符号順決定手段により決定された処理すべ
き色成分順位に従い、順位の高い色成分の前記カラー画
像データより符号化処理させるべく制御する制御手段と を備えたことを特徴とする画像データの符号化装置。
(6) Divide each of the color image data separated by color component into blocks, perform orthogonal transformation for each divided block by color component, and then quantize the transform output by a quantization means. The quantized output is given to a variable-length encoding means to be variable-length encoded, and when data is encoded, it is first quantized with a provisionally determined quantization width and variable-length encoded, and the code for each block is Then, from the code amount for each block obtained by this statistical processing, the optimal quantization width and the allocated code amount for each block are determined, and each block is divided according to the determined optimal quantization width. an encoding device that quantizes the transform output for each block, controls the code amount for each block according to the allocated code amount for each block, and then sequentially encodes the quantized output with variable length coding; A code amount calculation means for calculating the code amount of the entire image and the code amount for each block of the variable-length encoded transform coefficients in the statistical processing, and a code amount of the entire image calculated by the code amount calculation means. A quantization width that predicts an optimal quantization width to be used in the encoding process from the target code amount to be accommodated and the provisional quantization width, and gives the predicted optimal quantization width to the quantization means. a prediction means; during encoding processing, the amount of code generated by encoding in a processed block processed before a block to be processed next to be coded among the blocks and the assigned code in the processed block; a code amount allocating means that calculates the difference between the amount of code and the allocated code amount of the block to be processed, adds this to the allocated code amount of the block to be processed, and allocates the difference as the allocated code amount of the block to be processed; coding aborting means for aborting the variable length encoding so as not to exceed the allocated code amount allocated by the code amount allocating means when encoding; and the provisionally determined quantization width and optimal quantization. code order determining means for determining the processing order of each color component in the encoding process of the color image data based on the width; and according to the order of color components to be processed determined by the code order determining means, 1. An image data encoding device comprising: a control means for controlling color image data to be encoded.
(7)色成分別に分離されたカラー画像データそれぞれ
をブロックに分割し、色成分別のこの分割されたブロッ
ク毎に直交変換を行ってからこの変換出力を量子化手段
により量子化し、その後、この量子化出力を可変長符号
化手段に与えて可変長符号化し、データの符号化を行う
際に、初めに暫定的に定めた量子化幅で量子化して可変
長符号化し、各ブロック毎の符号量を得る統計処理を行
い、次にこの統計処理により求めた各ブロック毎の符号
量から最適量子化幅と各ブロック毎の割当符号量とを決
定し、この決定した最適量子化幅に従って各ブロック毎
の前記変換出力の量子化を行うと共にこの量子化出力を
各ブロック毎の割当符号量に従って各ブロック毎に符号
量制御を行いながら順次可変長符号化する符号化処理を
実施する符号化装置において、 前記統計処理における可変長符号化された変換係数の画
像全体の符号量および各ブロック毎の符号量を算出する
符号量算出手段と、 この符号量算出手段により算出された画像全体の符号量
と前記収めるべき目的の符号量と前記暫定的量子化幅と
から前記符号化処理に使用する最適量子化幅を予測する
と共に、前記量子化手段にこの予測した最適量子化幅を
与える量子化幅予測手段と、 符号化処理時において、前記ブロックのうち、次に符号
化処理する処理対象ブロックの前に処理した処理済みブ
ロックでの符号化により発生した符号量と当該処理済み
ブロックでの割当符号量との差を求めてこれと前記処理
対象ブロックの前記割当符号量とを加え、当該処理対象
ブロックでの割当符号量として割り当てる符号量割当手
段と、符号化処理時において、前記処理対象ブロックで
の符号化の際に前記符号量割当手段により割り当てられ
た割当符号量を越えないように、前記可変長符号化を打
ち切る符号化打ち切り手段と、前記最適量子化幅にて量
子化する際の各色成分別の符号量予測値に応じ前記カラ
ー画像データの符号化処理における色成分別の処理順位
を決定する符号順決定手段と、 この符号順決定手段により決定された処理すべき色成分
順位に従い、順位の高い色成分の前記カラー画像データ
より符号化処理させるべく制御する制御手段と を備えたことを特徴とする画像データの符号化装置。
(7) Divide each of the color image data separated by color component into blocks, perform orthogonal transformation for each divided block by color component, and then quantize the transform output by quantization means. The quantized output is given to a variable-length encoding means to be variable-length encoded, and when data is encoded, it is first quantized with a provisionally determined quantization width and variable-length encoded, and the code for each block is Then, from the code amount for each block obtained by this statistical processing, the optimal quantization width and the allocated code amount for each block are determined, and each block is divided according to the determined optimal quantization width. In an encoding device that performs encoding processing of quantizing the transform output for each block and sequentially variable-length encoding the quantized output while controlling the code amount for each block according to the allocated code amount for each block. , a code amount calculation means for calculating the code amount of the entire image and the code amount for each block of the variable-length encoded transform coefficients in the statistical processing; and the code amount of the entire image calculated by the code amount calculation means. Quantization width prediction for predicting an optimal quantization width to be used in the encoding process from the target code amount to be stored and the provisional quantization width, and providing the predicted optimal quantization width to the quantization means. means; during encoding processing, the amount of code generated by encoding in a processed block that is processed before the block to be processed next to be coded among the blocks and the amount of code allocated to the processed block; and a code amount allocation means which calculates the difference between the two and adds this to the allocated code amount of the processing target block and allocates it as the allocated code amount of the processing target block, and at the time of encoding processing, coding aborting means for aborting the variable length encoding so as not to exceed the allocated code amount allocated by the code amount allocating means during encoding; and each color component when quantizing at the optimum quantization width. code order determining means for determining the processing order for each color component in the encoding process of the color image data according to another code amount prediction value; and a control means for controlling the color image data having a high color component to be subjected to encoding processing.
(8)色成分別に分離されたカラー画像データそれぞれ
をブロックに分割し、色成分別のこの分割されたブロッ
ク毎に直交変換を行ってからこの変換出力を量子化手段
により量子化し、その後、この量子化出力を可変長符号
化手段に与えて可変長符号化し、データの符号化を行う
際に、初めに暫定的に定めた量子化幅で量子化して可変
長符号化し、各ブロック毎の符号量を得る統計処理を行
い、次にこの統計処理により求めた各ブロック毎の符号
量から最適量子化幅と各ブロック毎の割当符号量とを決
定し、この決定した最適量子化幅に従って各ブロック毎
の前記変換出力の量子化を行うと共にこの量子化出力を
各ブロック毎の割当符号量に従って各ブロック毎に符号
量制御を行いながら順次可変長符号化する符号化処理を
実施する符号化装置において、 前記統計処理における可変長符号化された変換係数の画
像全体の符号量および各ブロック毎の符号量を算出する
符号量算出手段と、 この符号量算出手段により算出された画像全体の符号量
と収めるべき目的の符号量と前記暫定的な量子化幅とか
ら前記符号化処理に使用する最適量子化幅を予測すると
共に、前記量子化手段にこの予測した最適量子化幅を与
える量子化幅予測手段と、 符号化処理時において、前記ブロックのうち、次に符号
化処理する処理対象ブロックの前に処理した処理済みブ
ロックでの符号化により発生した符号量と当該処理済み
ブロックでの割当符号量との差を求めてこれと前記処理
対象ブロックの前記割当符号量とを加え、当該処理対象
ブロックでの割当符号量として割り当てる符号量割当手
段と、符号化処理時において、前記処理対象ブロックで
の符号化の際に前記符号量割当手段により割り当てられ
た割当符号量を越えないように、前記可変長符号化を打
ち切る符号化打ち切り手段と、前記暫定的に定めた量子
化幅と最適量子化幅より前記カラー画像データの符号化
処理における色成分別の処理順位を決定する符号順決定
手段と、この符号順決定手段により決定された処理すべ
き色成分順位に従い、順位の高い色成分の前記カラー画
像データより符号化処理させるべく制御する制御手段と を備えたことを特徴とする画像データの符号化装置。
(8) Divide each of the color image data separated by color component into blocks, perform orthogonal transformation for each divided block by color component, and then quantize the transform output by quantization means. The quantized output is given to a variable-length encoding means to be variable-length encoded, and when data is encoded, it is first quantized with a provisionally determined quantization width and variable-length encoded, and the code for each block is Then, from the code amount for each block obtained by this statistical processing, the optimal quantization width and the allocated code amount for each block are determined, and each block is divided according to the determined optimal quantization width. In an encoding device that performs encoding processing of quantizing the transform output for each block and sequentially variable-length encoding the quantized output while controlling the code amount for each block according to the allocated code amount for each block. , a code amount calculation means for calculating the code amount of the entire image and the code amount for each block of the variable-length encoded transform coefficients in the statistical processing; and the code amount of the entire image calculated by the code amount calculation means. Quantization width prediction that predicts an optimal quantization width to be used in the encoding process from the target code amount to be stored and the provisional quantization width, and provides the predicted optimal quantization width to the quantization means. means; during encoding processing, the amount of code generated by encoding in a processed block that is processed before the block to be processed next to be coded among the blocks and the amount of code allocated to the processed block; and a code amount allocation means which calculates the difference between the two and adds this to the allocated code amount of the processing target block and allocates it as the allocated code amount of the processing target block, and at the time of encoding processing, coding aborting means for aborting the variable length coding so as not to exceed the allocated code amount allocated by the code amount allocating means during encoding; and the provisionally determined quantization width and optimal quantization width. code order determining means for determining the processing order for each color component in the encoding process of the color image data; 1. An image data encoding apparatus comprising: a control means for controlling image data to perform encoding processing.
(9)色成分別に分離されたカラー画像データそれぞれ
をブロックに分割し、色成分別のこの分割されたブロッ
ク毎に直交変換を行ってからこの変換出力を量子化手段
により量子化し、その後、この量子化出力を可変長符号
化手段に与えて可変長符号化し、データの符号化を行う
際に、初めに暫定的に定めた量子化幅で量子化して可変
長符号化し、各ブロック毎の符号量を得る統計処理を行
い、次にこの統計処理により求めた各ブロック毎の符号
量から最適量子化幅と各ブロック毎の割当符号量とを決
定し、この決定した最適量子化幅に従って各ブロック毎
の前記変換出力の量子化を行うと共にこの量子化出力を
各ブロック毎の割当符号量に従って各ブロック毎に符号
量制御を行いながら順次可変長符号化する符号化処理を
実施する符号化装置において、 前記統計処理における可変長符号化された変換係数の画
像全体の符号量および各ブロック毎の符号量を算出する
符号量算出手段と、 この符号量算出手段により算出された画像全体の符号量
と収めるべき目的の符号量と前記暫定的な量子化幅とか
ら前記符号化処理に使用する最適量子化幅を予測すると
共に、前記量子化手段にこの予測した最適量子化幅を与
える量子化幅予測手段と、 符号化処理時において、前記ブロックのうち、次に符号
化処理する処理対象ブロックの前に処理した処理済みブ
ロックでの符号化により発生した符号量と当該処理済み
ブロックでの割当符号量との差を求めてこれと前記処理
対象ブロックの前記割当符号量とを加え、当該処理対象
ブロックでの割当符号量として割り当てる符号量割当手
段と、符号化処理時において、前記処理対象ブロックで
の符号化の際に前記符号量割当手段により割り当てられ
た割当符号量を越えないように、前記可変長符号化を打
ち切る符号化打ち切り手段と、前記最適量子化幅にて量
子化する際の各色成分別の符号量予測値に応じ前記カラ
ー画像データの符号化処理における色成分別の処理順位
を決定する符号順決定手段と、 この符号順決定手段により決定された処理すべき色成分
順位に従い、順位の高い色成分の前記カラー画像データ
より符号化処理させるべく制御する制御手段とを備え、 前記可変長符号化手段は前記直交変換により得られる前
記各ブロック単位の画像データのうち、直流成分につい
ては前の処理ブロックでの直流成分との差分を得ると共
にこの差分を可変長符号化する直流成分用の符号化処理
部と、この直流成分について符号化処理部の処理が終わ
った後、前記交流成分について可変長符号化する交流成
分用の符号化処理部とを設け、前記符号化打ち切り手段
は交流成分用の符号化処理部にのみ設けて構成すること
を特徴とする画像データの符号化装置。
(9) Divide each of the color image data separated by color component into blocks, perform orthogonal transformation for each divided block by color component, and then quantize the transform output by a quantization means. The quantized output is given to a variable-length encoding means to be variable-length encoded, and when data is encoded, it is first quantized with a provisionally determined quantization width and variable-length encoded, and the code for each block is Then, from the code amount for each block obtained by this statistical processing, the optimal quantization width and the allocated code amount for each block are determined, and each block is divided according to the determined optimal quantization width. In an encoding device that performs encoding processing of quantizing the transform output for each block and sequentially variable-length encoding the quantized output while controlling the code amount for each block according to the allocated code amount for each block. , a code amount calculation means for calculating the code amount of the entire image and the code amount for each block of the variable-length encoded transform coefficients in the statistical processing; and the code amount of the entire image calculated by the code amount calculation means. Quantization width prediction that predicts an optimal quantization width to be used in the encoding process from the target code amount to be stored and the provisional quantization width, and provides the predicted optimal quantization width to the quantization means. means; during encoding processing, the amount of code generated by encoding in a processed block that is processed before the block to be processed next to be coded among the blocks and the amount of code allocated to the processed block; and a code amount allocation means which calculates the difference between the two and adds this to the allocated code amount of the processing target block and allocates it as the allocated code amount of the processing target block, and at the time of encoding processing, coding aborting means for aborting the variable length encoding so as not to exceed the allocated code amount allocated by the code amount allocating means during encoding; and each color component when quantizing at the optimum quantization width. code order determining means for determining the processing order for each color component in the encoding process of the color image data according to another code amount prediction value; control means for controlling the encoding process to be performed from the color image data having a high color component; a DC component encoding processing unit that obtains a difference from the DC component in the previous processing block and variable-length encoding this difference; and after the encoding processing unit finishes processing the DC component, the AC component An encoding device for image data, comprising: an encoding processing section for alternating current components that performs variable-length encoding for the alternating current components, and wherein the encoding aborting means is provided only in the encoding processing section for alternating current components.
(10)色成分別に分離されたカラー画像データそれぞ
れをブロックに分割し、色成分別のこの分割されたブロ
ック毎に直交変換を行ってからこの変換出力を量子化手
段により量子化し、その後、この量子化出力を可変長符
号化手段に与えて可変長符号化し、データの符号化を行
う際に、初めに暫定的に定めた量子化幅で量子化して可
変長符号化し、各ブロック毎の符号量を得る統計処理を
行い、次にこの統計処理により求めた各ブロック毎の符
号量から最適量子化幅と各ブロック毎の割当符号量とを
決定し、この決定した最適量子化幅に従って各ブロック
毎の前記変換出力の量子化を行うと共にこの量子化出力
を各ブロック毎の割当符号量に従って各ブロック毎に符
号量制御を行いながら順次可変長符号化する符号化処理
を実施する符号化装置において、 前記統計処理における可変長符号化された変換係数の画
像全体の符号量および各ブロック毎の符号量を算出する
符号量算出手段と、 この符号量算出手段により算出された画像全体の符号量
と収めるべき目的の符号量と前記暫定的な量子化幅とか
ら前記符号化処理に使用する最適量子化幅を予測すると
共に、前記量子化手段にこの予測した最適量子化幅を与
える量子化幅予測手段と、 符号化処理時において、前記ブロックのうち、次に符号
化処理する処理対象ブロックの前に処理した処理済みブ
ロックでの符号化により発生した符号量と当該処理済み
ブロックでの割当符号量との差を求めてこれと前記処理
対象ブロックの前記割当符号量とを加え、当該処理対象
ブロックでの割当符号量として割り当てる符号量割当手
段と、符号化処理時において、前記処理対象ブロックで
の符号化の際に前記符号量割当手段により割り当てられ
た割当符号量を越えないように、前記可変長符号化を打
ち切る符号化打ち切り手段と、前記暫定的に定めた量子
化幅と最適量子化幅より前記カラー画像データの符号化
処理における色成分別の処理順位を決定する符号順決定
手段と、この符号順決定手段により決定された処理すべ
き色成分順位に従い、順位の高い色成分の前記カラー画
像データより符号化処理させるべく制御する制御手段と
を備え、 前記可変長符号化手段は前記直交変換により得られる前
記各ブロック単位の画像データのうち、直流成分につい
ては前の処理ブロックでの直流成分との差分を得ると共
にこの差分を可変長符号化する直流成分用の符号化処理
部と、この直流成分について符号化処理部の処理が終わ
った後、前記交流成分について可変長符号化する交流成
分用の符号化処理部とを設け、前記符号化打ち切り手段
は交流成分用の符号化処理部にのみ設けて構成すること
を特徴とする画像データの符号化装置。
(10) Divide each of the color image data separated by color component into blocks, perform orthogonal transformation for each divided block by color component, and then quantize the transform output by a quantization means. The quantized output is given to a variable-length encoding means to be variable-length encoded, and when data is encoded, it is first quantized with a provisionally determined quantization width and variable-length encoded, and the code for each block is Then, from the code amount for each block obtained by this statistical processing, the optimal quantization width and the allocated code amount for each block are determined, and each block is divided according to the determined optimal quantization width. In an encoding device that performs encoding processing of quantizing the transform output for each block and sequentially variable-length encoding the quantized output while controlling the code amount for each block according to the allocated code amount for each block. , a code amount calculation means for calculating the code amount of the entire image and the code amount for each block of the variable-length encoded transform coefficients in the statistical processing; and the code amount of the entire image calculated by the code amount calculation means. Quantization width prediction that predicts an optimal quantization width to be used in the encoding process from the target code amount to be stored and the provisional quantization width, and provides the predicted optimal quantization width to the quantization means. means; during encoding processing, the amount of code generated by encoding in a processed block that is processed before the block to be processed next to be coded among the blocks and the amount of code allocated to the processed block; and a code amount allocation means which calculates the difference between the two and adds this to the allocated code amount of the processing target block and allocates it as the allocated code amount of the processing target block, and at the time of encoding processing, coding aborting means for aborting the variable length coding so as not to exceed the allocated code amount allocated by the code amount allocating means during encoding; and the provisionally determined quantization width and optimal quantization width. code order determining means for determining the processing order for each color component in the encoding process of the color image data; and a control means for controlling the image data to be encoded, and the variable length encoding means controls the DC component of the image data in units of blocks obtained by the orthogonal transformation from the DC component in the previous processing block. an encoding processing unit for a DC component that obtains a difference between the DC component and variable-length encoding the difference; and an AC component that performs variable-length encoding of the AC component after the encoding processing unit finishes processing the DC component. 1. An image data encoding device comprising: a component encoding processing section; and the encoding aborting means is provided only in the alternating current component encoding processing section.
(11)色成分別に分離されたカラー画像データそれぞ
れをブロックに分割し、色成分別のこの分割されたブロ
ック毎に直交変換を行ってからこの変換出力を量子化手
段により量子化し、その後、この量子化出力を可変長符
号化手段に与えて可変長符号化し、データの符号化を行
う際に、初めに暫定的に定めた量子化幅で量子化して可
変長符号化し、各ブロック毎の符号量を得る統計処理を
行い、次にこの統計処理により求めた各ブロック毎の符
号量から最適量子化幅と各ブロック毎の割当符号量とを
決定し、この決定した最適量子化幅に従って各ブロック
毎の前記変換出力の量子化を行うと共にこの量子化出力
を各ブロック毎の割当符号量に従って各ブロック毎に符
号量制御を行いながら順次可変長符号化する符号化処理
を実施する符号化装置において、 目的とする圧縮率を選択すると共に、選択された圧縮率
に応じて収めるべき目的の符号量および前記暫定的量子
化幅を決定する圧縮率選択手段と、前記統計処理におけ
る可変長符号化された変換係数の画像全体の符号量およ
び各ブロック毎の符号量を算出する符号量算出手段と、 この符号量算出手段により算出された画像全体の符号量
と前記収めるべき目的の符号量と前記暫定的量子化幅と
から前記符号化処理に使用する最適量子化幅を予測する
と共に、前記量子化手段にこの予測した最適量子化幅を
与える量子化幅予測手段と、 符号化処理時において、前記ブロックのうち、次に符号
化処理する処理対象ブロックの前に処理した処理済みブ
ロックでの符号化により発生した符号量と当該処理済み
ブロックでの割当符号量との差を求めてこれと前記処理
対象ブロックの前記割当符号量とを加え、当該処理対象
ブロックでの割当符号量として割り当てる符号量割当手
段と、符号化処理時において、前記処理対象ブロックで
の符号化の際に前記符号量割当手段により割り当てられ
た割当符号量を越えないように、前記可変長符号化を打
ち切る符号化打ち切り手段と、前記最適量子化幅にて量
子化する際の各色成分別の符号量予測値に応じ前記カラ
ー画像データの符号化処理における色成分別の処理順位
を決定する符号順決定手段と、 この符号順決定手段により決定された処理すべき色成分
順位に従い、順位の高い色成分の前記カラー画像データ
より符号化処理させるべく制御する制御手段と を備えたことを特徴とする画像データの符号化装置。
(11) Divide each of the color image data separated by color component into blocks, perform orthogonal transformation for each divided block by color component, and then quantize the transform output by a quantization means. The quantized output is given to a variable-length encoding means to be variable-length encoded, and when data is encoded, it is first quantized with a provisionally determined quantization width and variable-length encoded, and the code for each block is Then, from the code amount for each block obtained by this statistical processing, the optimal quantization width and the allocated code amount for each block are determined, and each block is divided according to the determined optimal quantization width. In an encoding device that performs encoding processing of quantizing the transform output for each block and sequentially variable-length encoding the quantized output while controlling the code amount for each block according to the allocated code amount for each block. , compression rate selection means for selecting a target compression rate and determining the target code amount to be accommodated according to the selected compression rate and the provisional quantization width; code amount calculation means for calculating the code amount of the entire image and the code amount for each block of the converted coefficients; quantization width prediction means for predicting an optimal quantization width to be used in the encoding process from the quantization width of the target quantization width, and providing the predicted optimal quantization width to the quantization unit; Among the blocks, the difference between the amount of code generated by encoding in the processed block processed before the block to be encoded next and the amount of allocated code in the processed block is calculated and compared with the above processing. a code amount allocation means which adds the allocated code amount of the target block and allocates the allocated code amount as the allocated code amount in the processing target block; and a code amount allocation means when encoding the processing target block during encoding processing; a coding aborting means for aborting the variable length coding so as not to exceed the allocated code amount allocated by the color coder; code order determining means for determining the processing order for each color component in the encoding process of image data; 1. An image data encoding device comprising: a control means for controlling encoding processing.
(12)色成分別に分離されたカラー画像データそれぞ
れをブロックに分割し、色成分別のこの分割されたブロ
ック毎に直交変換を行ってからこの変換出力を量子化手
段により量子化し、その後、この量子化出力を可変長符
号化手段に与えて可変長符号化し、データの符号化を行
う際に、初めに暫定的に定めた量子化幅で量子化して可
変長符号化し、各ブロック毎の符号量を得る統計処理を
行い、次にこの統計処理により求めた各ブロック毎の符
号量から最適量子化幅と各ブロック毎の割当符号量とを
決定し、この決定した最適量子化幅に従って各ブロック
毎の前記変換出力の量子化を行うと共にこの量子化出力
を各ブロック毎の割当符号量に従って各ブロック毎に符
号量制御を行いながら順次可変長符号化する符号化処理
を実施する符号化装置において、 目的とする圧縮率を選択すると共に、選択された圧縮率
に応じて収めるべき目的の符号量および前記暫定的量子
化幅を決定する圧縮率選択手段と、前記統計処理におけ
る可変長符号化された変換係数の画像全体の符号量およ
び各ブロック毎の符号量を算出する符号量算出手段と、 この符号量算出手段により算出された画像全体の符号量
と収めるべき目的の符号量と前記暫定的な量子化幅とか
ら前記符号化処理に使用する最適量子化幅を予測すると
共に、前記量子化手段にこの予測した最適量子化幅を与
える量子化幅予測手段と、 符号化処理時において、前記ブロックのうち、次に符号
化処理する処理対象ブロックの前に処理した処理済みブ
ロックでの符号化により発生した符号量と当該処理済み
ブロックでの割当符号量との差を求めてこれと前記処理
対象ブロックの前記割当符号量とを加え、当該処理対象
ブロックでの割当符号量として割り当てる符号量割当手
段と、符号化処理時において、前記処理対象ブロックで
の符号化の際に前記符号量割当手段により割り当てられ
た割当符号量を越えないように、前記可変長符号化を打
ち切る符号化打ち切り手段と、前記暫定的に定めた量子
化幅と最適量子化幅より前記カラー画像データの符号化
処理における色成分別の処理順位を決定する符号順決定
手段と、この符号順決定手段により決定された処理すべ
き色成分順位に従い、順位の高い色成分の前記カラー画
像データより符号化処理させるべく制御する制御手段と を備えたことを特徴とする画像データの符号化装置。
(12) Divide each of the color image data separated by color component into blocks, perform orthogonal transformation for each divided block by color component, and then quantize the transform output by a quantization means. The quantized output is given to a variable-length encoding means to be variable-length encoded, and when data is encoded, it is first quantized with a provisionally determined quantization width and variable-length encoded, and the code for each block is Then, from the code amount for each block obtained by this statistical processing, the optimal quantization width and the allocated code amount for each block are determined, and each block is divided according to the determined optimal quantization width. In an encoding device that performs encoding processing of quantizing the transform output for each block and sequentially variable-length encoding the quantized output while controlling the code amount for each block according to the allocated code amount for each block. , compression rate selection means for selecting a target compression rate and determining the target code amount to be accommodated according to the selected compression rate and the provisional quantization width; code amount calculation means for calculating the code amount of the entire image and the code amount for each block of the converted coefficients; quantization width prediction means for predicting an optimum quantization width to be used in the encoding process from the quantization width, and providing the predicted optimum quantization width to the quantization means; Among the blocks, the difference between the amount of code generated by encoding in the processed block processed before the block to be encoded next and the amount of allocated code in the processed block is calculated and compared with the above processing. a code amount allocation means which adds the allocated code amount of the target block and allocates the allocated code amount as the allocated code amount in the processing target block; and a code amount allocation means when encoding the processing target block during encoding processing; coding aborting means for aborting the variable length coding so as not to exceed the allocated code amount allocated by the method; A code order determining means for determining a processing order for each color component, and control so that the color image data of a color component having a higher rank is subjected to encoding processing according to the order of color components to be processed determined by the code order determining means. 1. An image data encoding device comprising: a control means.
(13)色成分別に分離されたカラー画像データそれぞ
れをブロックに分割し、色成分別のこの分割されたブロ
ック毎に直交変換を行ってからこの変換出力を量子化手
段により量子化し、その後、この量子化出力を可変長符
号化手段に与えて可変長符号化し、データの符号化を行
う際に、初めに暫定的に定めた量子化幅で量子化して可
変長符号化し、各ブロック毎の符号量を得る統計処理を
行い、次にこの統計処理により求めた各ブロック毎の符
号量から最適量子化幅と各ブロック毎の割当符号量とを
決定し、この決定した最適量子化幅に従って各ブロック
毎の前記変換出力の量子化を行うと共にこの量子化出力
を各ブロック毎の割当符号量に従って各ブロック毎に符
号量制御を行いながら順次可変長符号化する符号化処理
を実施する符号化装置において、 目的とする圧縮率を選択すると共に、選択された圧縮率
に応じて収めるべき目的の符号量および前記暫定的量子
化幅を決定する圧縮率選択手段と、前記統計処理におけ
る可変長符号化された変換係数の画像全体の符号量およ
び各ブロック毎の符号量を算出する符号量算出手段と、 この符号量算出手段により算出された画像全体の符号量
と収めるべき目的の符号量と前記暫定的な量子化幅とか
ら前記符号化処理に使用する最適量子化幅を予測すると
共に、前記量子化手段にこの予測した最適量子化幅を与
える量子化幅予測手段と、 符号化処理時において、前記ブロックのうち、次に符号
化処理する処理対象ブロックの前に処理した処理済みブ
ロックでの符号化により発生した符号量と当該処理済み
ブロックでの割当符号量との差を求めてこれと前記処理
対象ブロックの前記割当符号量とを加え、当該処理対象
ブロックでの割当符号量として割り当てる符号量割当手
段と、符号化処理時において、前記処理対象ブロックで
の符号化の際に前記符号量割当手段により割り当てられ
た割当符号量を越えないように、前記可変長符号化を打
ち切る符号化打ち切り手段と、前記最適量子化幅にて量
子化する際の各色成分別の符号量予測値に応じ前記カラ
ー画像データの符号化処理における色成分別の処理順位
を決定する符号順決定手段と、 この符号順決定手段により決定された処理すべき色成分
順位に従い、順位の高い色成分の前記カラー画像データ
より符号化処理させるべく制御する制御手段とを備え、 前記可変長符号化手段は前記直交変換により得られる前
記各ブロック単位の画像データのうち、直流成分につい
ては前の処理ブロックでの直流成分との差分を得ると共
にこの差分を可変長符号化する直流成分用の符号化処理
部と、この直流成分について符号化処理部の処理が終わ
った後、前記交流成分について可変長符号化する交流成
分用の符号化処理部とを設け、前記符号化打ち切り手段
は交流成分用の符号化処理部にのみ設けて構成すること
を特徴とする画像データの符号化装置。
(13) Divide each of the color image data separated by color component into blocks, perform orthogonal transformation for each divided block by color component, and then quantize the transform output by a quantization means. The quantized output is given to a variable-length encoding means to be variable-length encoded, and when data is encoded, it is first quantized with a provisionally determined quantization width and variable-length encoded, and the code for each block is Then, from the code amount for each block obtained by this statistical processing, the optimal quantization width and the allocated code amount for each block are determined, and each block is divided according to the determined optimal quantization width. In an encoding device that performs encoding processing of quantizing the transform output for each block and sequentially variable-length encoding the quantized output while controlling the code amount for each block according to the allocated code amount for each block. , compression rate selection means for selecting a target compression rate and determining the target code amount to be accommodated according to the selected compression rate and the provisional quantization width; code amount calculation means for calculating the code amount of the entire image and the code amount for each block of the converted coefficients; quantization width prediction means for predicting an optimum quantization width to be used in the encoding process from the quantization width, and providing the predicted optimum quantization width to the quantization means; Among the blocks, the difference between the amount of code generated by encoding in the processed block processed before the block to be encoded next and the amount of allocated code in the processed block is calculated and compared with the above processing. a code amount allocation means which adds the allocated code amount of the target block and allocates the allocated code amount as the allocated code amount in the processing target block; and a code amount allocation means when encoding the processing target block during encoding processing; a coding aborting means for aborting the variable length coding so as not to exceed the allocated code amount allocated by the color coder; code order determining means for determining the processing order for each color component in the encoding process of image data; and a control means for controlling the encoding process, and the variable length encoding means is configured to differentiate the DC component from the DC component in the previous processing block among the image data for each block obtained by the orthogonal transformation. a DC component encoding processing section that obtains a difference and variable-length encoding the difference; and an AC component encoding processing section that performs variable-length encoding on the AC component after the encoding processing section finishes processing the DC component. 1. An image data encoding device comprising: an encoding processing section, and the encoding aborting means is provided only in the alternating current component encoding processing section.
(14)色成分別に分離されたカラー画像データそれぞ
れをブロックに分割し、色成分別のこの分割されたブロ
ック毎に直交変換を行ってからこの変換出力を量子化手
段により量子化し、その後、この量子化出力を可変長符
号化手段に与えて可変長符号化し、データの符号化を行
う際に、初めに暫定的に定めた量子化幅で量子化して可
変長符号化し、各ブロック毎の符号量を得る統計処理を
行い、次にこの統計処理により求めた各ブロック毎の符
号量から最適量子化幅と各ブロック毎の割当符号量とを
決定し、この決定した最適量子化幅に従って各ブロック
毎の前記変換出力の量子化を行うと共にこの量子化出力
を各ブロック毎の割当符号量に従って各ブロック毎に符
号量制御を行いながら順次可変長符号化する符号化処理
を実施する符号化装置において、 目的とする圧縮率を選択すると共に、選択された圧縮率
に応じて収めるべき目的の符号量および前記暫定的量子
化幅を決定する圧縮率選択手段と、前記統計処理におけ
る可変長符号化された変換係数の画像全体の符号量およ
び各ブロック毎の符号量を算出する符号量算出手段と、 この符号量算出手段により算出された画像全体の符号量
と収めるべき目的の符号量と前記暫定的な量子化幅とか
ら前記符号化処理に使用する最適量子化幅を予測すると
共に、前記量子化手段にこの予測した最適量子化幅を与
える量子化幅予測手段と、 符号化処理時において、前記ブロックのうち、次に符号
化処理する処理対象ブロックの前に処理した処理済みブ
ロックでの符号化により発生した符号量と当該処理済み
ブロックでの割当符号量との差を求めてこれと前記処理
対象ブロックの前記割当符号量とを加え、当該処理対象
ブロックでの割当符号量として割り当てる符号量割当手
段と、符号化処理時において、前記処理対象ブロックで
の符号化の際に前記符号量割当手段により割り当てられ
た割当符号量を越えないように、前記可変長符号化を打
ち切る符号化打ち切り手段と、前記暫定的に定めた量子
化幅と最適量子化幅より前記カラー画像データの符号化
処理における色成分別の処理順位を決定する符号順決定
手段と、この符号順決定手段により決定された処理すべ
き色成分順位に従い、順位の高い色成分の前記カラー画
像データより符号化処理させるべく制御する制御手段と
を備え、 前記可変長符号化手段は前記直交変換により得られる前
記各ブロック単位の画像データのうち、直流成分につい
ては前の処理ブロックでの直流成分との差分を得ると共
にこの差分を可変長符号化する直流成分用の符号化処理
部と、この直流成分について符号化処理部の処理が終わ
った後、前記交流成分について可変長符号化する交流成
分用の符号化処理部とを設け、前記符号化打ち切り手段
は交流成分用の符号化処理部にのみ設けて構成すること
を特徴とする画像データの符号化装置。
(14) Divide each of the color image data separated by color component into blocks, perform orthogonal transformation for each divided block by color component, and then quantize the transform output by a quantization means. The quantized output is given to a variable-length encoding means to be variable-length encoded, and when data is encoded, it is first quantized with a provisionally determined quantization width and variable-length encoded, and the code for each block is Then, from the code amount for each block obtained by this statistical processing, the optimal quantization width and the allocated code amount for each block are determined, and each block is divided according to the determined optimal quantization width. In an encoding device that performs encoding processing of quantizing the transform output for each block and sequentially variable-length encoding the quantized output while controlling the code amount for each block according to the allocated code amount for each block. , compression rate selection means for selecting a target compression rate and determining the target code amount to be accommodated according to the selected compression rate and the provisional quantization width; code amount calculation means for calculating the code amount of the entire image and the code amount for each block of the converted coefficients; quantization width prediction means for predicting an optimum quantization width to be used in the encoding process from the quantization width, and providing the predicted optimum quantization width to the quantization means; Among the blocks, the difference between the amount of code generated by encoding in the processed block processed before the block to be encoded next and the amount of allocated code in the processed block is calculated and compared with the above processing. a code amount allocation means which adds the allocated code amount of the target block and allocates the allocated code amount as the allocated code amount in the processing target block; and a code amount allocation means when encoding the processing target block during encoding processing; coding aborting means for aborting the variable length coding so as not to exceed the allocated code amount allocated by the method; A code order determining means for determining a processing order for each color component, and control so that the color image data of a color component having a higher rank is subjected to encoding processing according to the order of color components to be processed determined by the code order determining means. control means, the variable length encoding means obtains a difference between the DC component in the previous processing block and the DC component of the image data for each block obtained by the orthogonal transformation, and calculates this difference. An encoding processing unit for a DC component that performs variable length encoding, and an encoding processing unit for AC component that performs variable length encoding for the AC component after the encoding processing unit finishes processing the DC component. . An image data encoding device, wherein the encoding aborting means is provided only in an encoding processing section for alternating current components.
(15)色成分別に分離されたカラー画像データをブロ
ックに分割し、この分割されたブロック毎に直交変換を
行ってからこの変換出力を量子化手段により量子化し、
その後、この量子化出力を可変長符号化手段に与えて可
変長符号化し、データの符号化を行う際に、予め求めた
各ブロック毎の統計量から決定した各ブロック毎の割当
符号量に従って各ブロック毎に符号量制御を行いながら
可変長符号化を行うにあたり、 前記量子化を暫定的な量子化幅を使用して行い、これに
より得た量子化出力について符号化処理を行い、最適化
するに必要な画像全体の符号量および各ブロック毎の符
号量を調べる第1のステップと、 この第1のステップで得た画像全体の符号量から最適化
に必要な量子化幅の予測を行うと共に、この予測した量
子化幅から各色成分の符号化順位を決定する第2のステ
ップと、 前記各ブロックの符号量から各ブロック毎の基準割当符
号量を求める第3のステップと、前記予測した量子化幅
を用いて前記各ブロック毎の前記量子化を行う第4のス
テップと、この第4のステップでの前記各ブロック毎の
量子化出力をそのブロックに対する割当符号量に収まる
範囲で可変長符号化する第5のステップと、前記第5の
ステップにおける現在可変長符号化処理しようとするブ
ロックの、直前に処理したブロックでの可変長符号化に
よる符号量とそのブロックでの割当符号量との差を求め
、これを繰り越し量として前記現在処理しようとするブ
ロックでの前記基準割当符号量に加算し、前記現在処理
しようとするブロックでの割当符号量とする第6のステ
ップとを含み、 前記第4のステップは前記第2のステップで得た各色成
分の符号化順位に従って符号化を実施することを特徴と
する画像データの符号化方法。
(15) Divide the color image data separated by color component into blocks, perform orthogonal transformation for each divided block, and then quantize the transformation output by a quantization means,
After that, this quantized output is given to variable length encoding means to perform variable length encoding, and when encoding data, each block is assigned a code amount according to the allocated code amount for each block determined from the statistics for each block determined in advance. When performing variable length encoding while controlling the amount of code for each block, the quantization is performed using a provisional quantization width, and the resulting quantized output is encoded and optimized. The first step is to investigate the amount of code required for the entire image and the amount of code for each block, and the quantization width required for optimization is predicted from the amount of code for the entire image obtained in this first step. , a second step of determining the coding order of each color component from the predicted quantization width; a third step of determining a standard allocated code amount for each block from the code amount of each block; A fourth step of performing the quantization for each block using the quantization width, and converting the quantization output for each block in this fourth step into a variable length code within the allocated code amount for the block. a fifth step of converting the block to be variable-length encoded in the fifth step to the code amount due to variable-length encoding in the block processed immediately before and the allocated code amount in that block; a sixth step of determining the difference and adding it as a carryover amount to the reference allocated code amount in the block to be currently processed, and setting it as the allocated code amount in the block to be currently processed; A method for encoding image data, characterized in that a fourth step performs encoding according to the encoding order of each color component obtained in the second step.
JP2306071A 1990-11-14 1990-11-14 Device and method for encoding picture data Pending JPH04179371A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2306071A JPH04179371A (en) 1990-11-14 1990-11-14 Device and method for encoding picture data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2306071A JPH04179371A (en) 1990-11-14 1990-11-14 Device and method for encoding picture data

Publications (1)

Publication Number Publication Date
JPH04179371A true JPH04179371A (en) 1992-06-26

Family

ID=17952696

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2306071A Pending JPH04179371A (en) 1990-11-14 1990-11-14 Device and method for encoding picture data

Country Status (1)

Country Link
JP (1) JPH04179371A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6449395B1 (en) 1997-10-22 2002-09-10 Matsushita Electric Industrial Co., Ltd. Image encoding apparatus, image encoding method, and recording medium in which image encoding program is recorded

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6449395B1 (en) 1997-10-22 2002-09-10 Matsushita Electric Industrial Co., Ltd. Image encoding apparatus, image encoding method, and recording medium in which image encoding program is recorded
US6584232B2 (en) 1997-10-22 2003-06-24 Matsushita Electric Industrial Co., Ltd Image encoding apparatus, image encoding method, and recording medium in which image encoding program is recorded

Similar Documents

Publication Publication Date Title
JP3012698B2 (en) Image data encoding apparatus and encoding method
US5291282A (en) Image data coding apparatus and method capable of controlling amount of codes
JP3085465B2 (en) Image data encoding apparatus and encoding method
KR100616262B1 (en) Digital camera apparatus and recording method thereof
US5764806A (en) Image encoding method and apparatus
US8120671B2 (en) Digital camera for recording a still image while shooting a moving image
KR0183688B1 (en) Image encoding method and device
US6144763A (en) Method and apparatus for compression coding of image data representative of a color image and digital camera including the same
US20050146623A1 (en) Electronic camera
US5216712A (en) Recording apparatus
JPH07154798A (en) Method and device for picture encoding
US5293252A (en) Method of compressing digital image data and device thereof
WO2002080574A1 (en) Image processing device, image processing method, image processing program, and recording medium
JP2959831B2 (en) Image data encoding device
US20010014123A1 (en) Method for processing video
JP2952000B2 (en) Image data encoding apparatus and encoding method
JPH04179371A (en) Device and method for encoding picture data
JP3037961B2 (en) Electronic camera device and image data encoding device
JPH07312751A (en) Method and device for compressing and coding image data
US6445870B1 (en) Image compression and expansion device
JP3192133B2 (en) Electronic camera device
JP3038022B2 (en) Electronic camera device
US6208754B1 (en) Image compression and expansion device using pixel offset
JPH04207352A (en) Encoding device and encoding method for image data
JPH04207266A (en) Encoder and encoding method for image data