JPH04167868A - Coding device and coding method for picture - Google Patents

Coding device and coding method for picture

Info

Publication number
JPH04167868A
JPH04167868A JP2293924A JP29392490A JPH04167868A JP H04167868 A JPH04167868 A JP H04167868A JP 2293924 A JP2293924 A JP 2293924A JP 29392490 A JP29392490 A JP 29392490A JP H04167868 A JPH04167868 A JP H04167868A
Authority
JP
Japan
Prior art keywords
code amount
block
encoding
amount
quantization
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2293924A
Other languages
Japanese (ja)
Other versions
JP2959831B2 (en
Inventor
Chihiro Nakagawa
千尋 中川
Hiroshi Sasaki
寛 佐々木
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 JP29392490A priority Critical patent/JP2959831B2/en
Publication of JPH04167868A publication Critical patent/JPH04167868A/en
Application granted granted Critical
Publication of JP2959831B2 publication Critical patent/JP2959831B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Abstract

PURPOSE:To obtain a coding output as a final output by deciding a code quantity per one block from an object code quantity and controlling the variable length coding in the unit of blocks so that the quantity is set within a desired code quantity. CONSTITUTION:A coding circuit 80 gives an input data received from a signal processing circuit 60 to an orthogonal transformation circuit 4, which applies orthogonal transformation by discrete cosine transformation to a block picture data for each block. The data (transformation coefficient) is stored in a relevant frequency component position and the result is inputted to a quantization circuit 6. The circuit 6 applies quantization of a 1st path to the data. In this quantization, the transformation coefficient is quantized with a quantization width resulting from multiplying a standard quantization coefficient alpha given from a control circuit 18 corresponding to a picture quality setting value set by the user at the image pickup with a quantization matrix position for each preset frequency component. The data is subjected to variable length coding at a variable length coding circuit 8, subjected to zigzag scanning from a lower frequency component to a higher frequency component.

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.

〔従来の技術〕[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 recording media such as memory cards, magnetic disks, or magnetic tapes instead of silver halide films.
The number of images that can be recorded on a roll of magnetic tape is specified, and the recording of this specified number of images must be guaranteed.
Moreover, the time required for data recording and reproducing processing needs to be short and constant. .

同様に、ディジタル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 a predetermined amount 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 reproducing processing needs to be short and constant.

従って、そのためには画像データを圧縮して1コマあた
りのデータ量を規定容量内に納まるようにする必要があ
る。
Therefore, for this purpose, it is necessary to compress the image data so that the amount of data per frame falls within the specified capacity.

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

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

この方式について次に概要を説明する。An outline of this method will be explained below.

まず、画像データを所定の大きさのプロ・ツクに分割し
、分割されたブロック毎に直交変換として2次元のDC
T (離散コサイン変換)を行う。
First, image data is divided into blocks of a predetermined size, and each divided block is subjected to orthogonal transformation.
Perform T (discrete cosine transformation).

次に各周波数成分に応じた線形量子化を行い、この量子
化された値に対し、可変長符号化としてノ\フマン符号
化を行う。このとき、直流成分に関しては近傍のブロッ
クの直流成分との差分値をノ\フマン符号化する。交流
成分はジグザグスキャンと呼ばれる低い周波数成分から
高い周波数成分へのスキャンを行い、無効(値が雰)の
成分の連続する個数と、それに続く有効な成分の値とか
ら2次元ハフマン符号化を行う。以上がこの方式の基本
−16= 部分である。
Next, linear quantization is performed according to each frequency component, and the quantized values are subjected to Noffman encoding as variable length encoding. At this time, regarding the DC component, the difference value between it and the DC component of the neighboring block is subjected to Nofman encoding. The AC component is scanned from a low frequency component to a high frequency component, which is called a zigzag scan, and two-dimensional Huffman encoding is performed from the consecutive number of invalid (value is ambience) components and the value of the subsequent valid component. . The above is the basic -16= part of this method.

この基本部分たけでは、可変長符号化であるハフマン符
号化を用いているために、符号量が画像毎に一定ではな
くなってしまう。そこで、符号量の制御の方法として次
の方式が提案されている。
Since Huffman encoding, which is variable length encoding, is used in this basic portion, 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.

まず、前記基本部分の処理を行うと同時に、全画面の発
生した総符号量を求める。この総符号量と目的とする符
号量とからDCT係数に対する目的とする符号量に近づ
けるのに最適な量子化幅を予測する。次にこの量子化幅
を用いて前記基本部分の量子化以降の処理を繰り返す。
First, while processing the basic part, the total amount of codes generated for the entire screen is determined. 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. Then, this predicted quantization width and the previous quantization width are sufficiently close, and
If the total amount of code generated this time is smaller than the target amount of code, the process is terminated and the code is output. If not, the process is repeated using a new quantization width.

量子化幅は、各周波数成分に対する相対的な= 17 
− 量子化特性を表わす基本形である量子化マトリックスを
用意し、この基本形の量子化マトリックスに対して、量
子化係数αを乗じて必要な量子化幅を得る。
The quantization width is relative to each frequency component = 17
- Prepare a quantization matrix that is a basic form representing quantization characteristics, and obtain the necessary quantization width by multiplying this basic quantization matrix by a quantization coefficient α.

具体的には、最初に標準的な量子化係数αを用いて得た
量子化幅により上述の基本部分での量子化を行い、これ
を可変長符号化し、これにより得られた総符号量の情報
と、収めるべき限度となる予め設定した目標の総符号量
値との比較を行い、目標縁符号量以内に達したときはそ
の量子化幅を使用して最終的な符号化処理を行い、目標
縁符号量以内に達したときは、その量子化幅を使用して
最終的な符号化処理を行い、目標縁符号量以内に収まら
なかったときは、発生総符号量と目標縁符号量とから、
例えば、ニュートンーラプソン法(Newton−Ra
phson 1teration)などを用いた線形予
測により、目的の総符号量に近付くに最適な量子化係数
αを求め、この求めた量子化係数と量子化マトリックス
とから、より最適化した量子化幅を計算し、これを用い
て最終的な符号化処理を行う。
Specifically, first, the basic part described above is quantized using the quantization width obtained using the standard quantization coefficient α, and then this is variable-length encoded, and the total code amount obtained by this is The information is compared with a preset target total code amount value that is the limit that should be stored, and when it reaches the target edge code amount, the final encoding process is performed using that quantization width, When the target edge code amount is reached, the final encoding process is performed using the quantization width, and when it is not within the target edge code amount, the total generated code amount and the target edge code amount are from,
For example, the Newton-Raphson method (Newton-Ra
phson 1teration), etc., to find the optimal quantization coefficient α that approaches the target total code amount, and then calculate a more optimized quantization width from the found quantization coefficient and quantization matrix. This is then used to perform the final encoding process.

このような方法で、量子化幅の変更を行う。The quantization width is changed using this method.

以上の動作を第9図を参照して具体的に説明すると、ま
ず、(a)に示すように、1フレームの画像データ(国
際標準他案で提示されている1フレームの画像は720
 X57B画素)を所定の大きさのブロック(例えば、
8×8の画素よりなるブロックA、  B、  C・・
)に分割し、(b)に示すように、この分割されたブロ
ック毎に直交変換として2次元のDCT (離散コサイ
ン変換)を行い、−8×8のマトリックス上に順次格納
する。画像データは二次元平面で眺めてみると、濃淡情
報の分布に基づく周波数情報である空間周波数を有して
いる。
To explain the above operation in detail with reference to FIG. 9, first, as shown in (a), one frame of image data (one frame image proposed in other international standards is 720
x57B pixels) to a block of a predetermined size (for example,
Blocks A, B, C, consisting of 8×8 pixels...
), and as shown in (b), a two-dimensional DCT (discrete cosine transform) is performed as an orthogonal transform for each divided block, and the results are sequentially stored on a -8×8 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 on the 8×8 matrix, data indicating the value of the direct current component DC is placed at the origin position (0,0 position), and , 0.7 position is data indicating the maximum frequency value of the alternating current component AC in the horizontal axis direction, and 7
, 0 positions store data indicating the frequency value of the maximum alternating current component AC in the vertical axis direction, and data indicating the maximum frequency value of the alternating current component AC in the diagonal direction are stored in the 7 and 7 positions. Frequency data in directions related to each coordinate position are stored in a form in which higher frequencies appear sequentially from the origin side.

次にこの7トリツクスにおける各座標位置の格納データ
を、各周波数成分毎の量子化幅で割ることにより、各周
波数成分に応した線形量子化を行い(C)、この量子化
された値に対し、可変長符号化としてハフマン符号化を
行う。この時、直流成分DCに関しては近隣ブロックの
直流成分との差分値をグループ番号(付加ビット数)と
付加ビットで表現し、そのグループ番号をハフマン符号
化し、得られた符号語と付加ビットを合わせて符号化デ
ータとする(di 、 d2. el、 e2)。
Next, linear quantization corresponding to each frequency component is performed by dividing the stored data of each coordinate position in these 7 trixes by the quantization width for each frequency component (C), and this quantized value is , Huffman encoding is performed as variable length encoding. At this time, regarding the DC component DC, the difference value with the DC component of neighboring blocks 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 combined. and make it encoded data (di, d2. el, e2).

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

そのため、交流成分ACはジグサグスキャンと呼ばれる
低い周波数成分から高い周波数成分へのスキャンを行い
、無効(値が“0”)の成分の連続する個数(零のラン
数)と、それに続く有効な成分の値のグループ番号とか
ら2次元のハフマン符号化を行い、得られた符号語と付
加ビットを合わせて符号化データとする。
Therefore, the AC component AC performs a scan called a zig-sag 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 using the group number of the component value, and the resulting 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 the 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.

この基本部分たけでは、エントロピー符号化であるハフ
マン符号化を用いているために符号量が画像毎に一定で
はなくなってしまうから、符号量の制御の方法として例
えば、次のように処理する。
In this basic portion, since Huffman coding, which is entropy coding, is used, the code amount is not constant for each image, so the code amount is controlled, for example, as follows.

ます、暫定的な量子化係数αを用い、定められた量子化
マトリックスにこの量子化係数αを掛は合わせて得られ
る各周波数成分毎の量子化幅で前記基本部分の処理を行
うと同時に、全画面の発生した総符号M(総ビット数)
を求める(g)。この総符号量と、目的とする符号量と
、用いた暫定的な量子化係数αなどから、DCT係数に
対する目的とする符号量に近づけるのに最適な量子化係
数αをニュートンーラプソンーイタレーション(New
ton Raphson Iteration)により
予測する(11)。次にこの量子化係数αを用い(i)
、前述の基本部分の量子化以降の処理を繰り返す。そし
て、今回発生した総符号量と、前回発生した総符号量と
、目的とする符号量と、今回用いた量子化係数αと、前
回用いた量子化係数αとから、再び目的の符号量に近づ
けるのに最適な量子化係数αをニュートンーラプソンー
イタレーションにより予測する。
First, using a provisional quantization coefficient α, the basic part is processed with the quantization width for each frequency component obtained by multiplying the determined quantization matrix by this quantization coefficient α, and at the same time, Total code M (total number of bits) generated for the entire screen
Find (g). From this total code amount, the target code amount, and the tentative quantization coefficient α used, we calculate the optimal quantization coefficient α to approach the target code amount for the DCT coefficients using Newton-Raphson-iteration. (New
ton Raphson Iteration) (11). Next, using this quantization coefficient α (i)
, repeat the process after quantization of the basic part described above. 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, the target code amount is again calculated. The optimal quantization coefficient α to be approximated is predicted by Newton-Raphson iteration.

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

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

上述したように、例えば、ディジタル電子スチルカメラ
などにおいては、1枚のメモリカードあるいは磁気ディ
スク装置に記録できる画像の枚数が保証されていなけれ
ばならず、そのため、画像データを圧縮して記録するが
、操作性の上からその処理時間はできるだけ短く、且つ
、一定である必要がある。また、高能率で画像データの
圧縮が行える事が望まれる。これらはディジタル電子ス
チルカメラに限らず、他のアプリケーションにおいても
少なからず要求される項目である。
As mentioned above, for example, in digital electronic still cameras, the number of images that can be recorded on one memory card or magnetic disk device must be guaranteed, and for this reason, image data is compressed and recorded. From the viewpoint of operability, the processing time needs to 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枚のメモリカードあるいは磁気デ
ィスク装置等の記録媒体に記憶できる画像の枚数が不定
になるという欠点があった。
As a compression method that satisfies these requirements, there is the above-mentioned international standard draft method. In this method, the method that combines block-by-block orthogonal transformation and variable-length coding as illustrated in the basic part above cannot process image data. However, because it uses variable length encoding, 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 or magnetic disk device is undefined. There were drawbacks.

また、これを解決するための従来例で例示したような符
号量の制御の方法では、符号化の基本部分のバスを何度
繰り返すかが画像によって異なるために処理時間が不定
となるばかりでなく、−船釣に処理時間を長く必要とす
る欠点かあった。
In addition, in the method of controlling the amount of code as exemplified in the conventional example to solve this problem, the number of times the bus, which is the basic part of encoding, is repeated varies depending on the image, which not only makes the processing time unstable. , - Boat fishing had the disadvantage of requiring a long processing time.

この問題を解決する手法として、本発明者等は次のよう
な方式を提案した(特願平1−283761号、特願平
2−1−37222号参照)。
As a method for solving this problem, the present inventors proposed the following method (see Japanese Patent Application No. 1-283761 and Japanese Patent Application No. 2-1-37222).

この提案した方式は直交変換と可変長符号化を組み合わ
せた圧縮方式において、発生符号量の制御を行うために
、画像メモリに記憶した標本化した画像信号を、画面を
構成する画素の隣接する複数個ずつを単位にブロック分
けし、この分割されたブロック毎に直交変換を行ってか
ら、この変換出力を暫定的な量子化幅で量子化した後、
この量子化出力を可変長符号化すると共に、各ブロック
毎の発生符号量と画像全体の総符号量を算出し、次に前
記暫定的な量子化幅、前記総発生符号量および、1画像
当りの目的とする総符号量とから新しい量子化幅を予測
する。また、これと合わせて、前記各ブロック毎の発生
符号量と、前記総発生符号量と、1画像当りの目的とす
る総符号量とから、各ブロック毎の割当符号量を算出す
る(統計処理:第1バスの処理)。
This proposed method is a compression method that combines orthogonal transformation and variable length coding. In order to control the amount of generated code, the sampled image signal stored in the image memory is Divide each piece into blocks, perform orthogonal transformation for each divided block, and then quantize the transform output with a provisional quantization width.
This quantization output is variable-length coded, and the generated code amount for each block and the total code amount for the entire image are calculated, and then the provisional quantization width, the total generated code amount, and the amount of code generated per image are calculated. A new quantization width is predicted from the target total code amount. In addition, 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 per image (statistical processing : Processing of the first bus).

そして、前記新しい量子′化幅を用いて再び画像メモリ
の画像信号を前記ブロック分け、直交変換、量子化、可
変長符号化を行うと共に、各ブロックについてその発生
符号量がそのブロックの前記割当符号量を越える場合に
は、途中で可変長符号化を中止して次のブロックの処理
に移ると云った処理を行って行く (符号化処理:第2
パスの処理)。
Then, using the new quantization width, the image signal in the image memory is again divided into blocks, orthogonally transformed, quantized, and variable length encoded, and the amount of generated code for each block is determined by the assigned code of that block. If the amount is exceeded, processing is performed such as stopping variable-length encoding midway through and moving on to processing the next block (encoding processing: second block).
path processing).

これにより、画像全体の総発生符号量が目的の総符号量
を越えないように符号量の制御を行おうと云うものであ
る。
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.

−25= しかしながら、上記方式は大変に良好な結果が得られる
ものの、少なくとも各ブロックの発生符号量をそれぞれ
記憶するためのメモリが必要であるため、回路規模が大
きくなり、それに伴って消費電力の増大を招くことにな
る。消費電力の増大は、小型化が非常に重要視されてい
る携帯型の製品にとって、電池部分の占める割合が大き
くなり、重量が増えたり、また、回路規模の増大によっ
て全体の大きさも大きくなる等、極めて不都合であり、
また、低価格の製品に対してはコストアップの要因とな
るなど、上記方式を利用することには問題かある。
-25= However, although the above method provides very good results, it requires at least a memory to store the amount of code generated for each block, which increases the circuit scale and reduces power consumption. This will lead to an increase. For portable products, where miniaturization is very important, increased power consumption means that the battery portion occupies a larger proportion, which increases weight, and increases in overall size due to increased circuit scale. , which is extremely inconvenient;
Furthermore, there are problems in using the above method, such as increasing costs for low-priced products.

近年では、製品が高価でも、画像の質を重視するケース
や、画像の質を多少犠牲にしても安価な製品を望むと云
った様々なユーザのニーズかあり、これに応えるために
は上記方式のように、やや複雑な回路になるか高画質の
得られる方式たけてなく、若干画質を犠牲にしても、簡
単な回路で実現できる方式も必要である。また、この2
つの方式は圧縮データに監視、相互に再生時の互換性が
なくてはならない。
In recent years, there have been various user needs, such as those who place emphasis on image quality even if the product is expensive, and those who want an inexpensive product even if they sacrifice some image quality. However, there is a need for a method that can be realized using a simple circuit even if it requires a somewhat complicated circuit or provides high image quality. Also, these 2
The two methods must monitor the compressed data and be compatible with each other during playback.

そこで、この発明の目的とするところは、画質をできる
たけ損なわずに、簡単な回路構成により、一定の処理時
間内で、一定の符号量以内に収まるように符号化できる
ようにした画像データの符号化装置および符号化方法を
提供することにある。
Therefore, it is an object of the present invention to encode image data within a certain amount of code within a certain processing time using a simple circuit configuration without degrading the image quality as much as possible. An object of the present invention is to provide an encoding device and an encoding method.

〔課題を解決するための手段〕[Means to solve the problem]

上記目的を達成するため、本発明は次のように構成する
。すなわち、本発明は、画像データをブロックに分割し
、この分割された各ブロックは順にそれぞれ直交変換を
行ってこの変換出力を量子化手段により量子化し、この
量子化出力を可変長符号化手段に与えて可変長符号化し
、各ブロック毎にデータの符号化をする符号化装置にお
いて、第1には前記ブロックの符号化にあたり、当該符
号化処理するブロックでの符号化処理により発生した符
号量と当該ブロックでの割当符号量とに基づいてこの発
生符号量の前記割当符号量に対する過不足量を算出する
と共に、画像当りの許される符号量である目的の総符号
量に応じて予め決定した1ブロック当たりの基準符号量
に前記算出した過不足量を加えた符号量を次に処理する
ブロックの前記割当符号量として求める符号量割当手段
と、各ブロック毎に前記符号量割当手段により割り当て
られた割当符号量を越えないように、前記可変長符号化
を打ち切るべく前記可変長符号化手段を制御する打切手
段とを備えて構成する。
In order to achieve the above object, the present invention is configured as follows. That is, the present invention divides image data into blocks, performs orthogonal transformation on each of the divided blocks in turn, quantizes the transform output by a quantization means, and sends this quantized output to a variable length encoding means. In an encoding device that performs variable-length encoding on data and encodes data for each block, firstly, when encoding the block, the amount of code generated by the encoding process in the block to be encoded and the amount of code generated by the encoding process in the block to be encoded are The amount of excess or deficiency of the generated code amount with respect to the allocated code amount is calculated based on the allocated code amount in the block, and 1 is predetermined according to the target total code amount, which is the allowable code amount per image. code amount allocation means that calculates the code amount obtained by adding the calculated surplus/deficiency amount to the reference code amount per block as the allocated code amount of the next block to be processed; and terminating means for controlling the variable length encoding means to abort the variable length encoding so as not to exceed the allocated code amount.

また、第2には圧縮率を指定する圧縮率指定手段と、こ
の圧縮率指定手段にて指定された圧縮率に応じて画面あ
たりの許される目的総符号量および量子化幅および1ブ
ロック当たりの基準割当符号量とを決定する圧縮率選択
手段と、前記ブロックの符号化にあたり、当該符号化処
理するブロックでの符号化処理により発生した符号量と
当該ブロックでの割当符号量とに基づいてこの発生符号
量の前記割当符号量に対する過不足量を算出すると共に
、前記圧縮率選択手段により決定された1ブロック当た
りの基準符号量に前記算出した過不足量を加えた符号量
を次に処理するブロックの前記割当符号量として求める
符号量割当手段と、各ブロック毎に前記符号量割当手段
により割り当てられた割当符号量を越えないように前記
可変長符号化を打ち切るべく前記可変長符号化手段を制
御する打切手段と、前記可変長符号化手段により可変長
符号化された変換係数を符号として出力する符号化出力
手段と、前記量子化手段に対し、前記圧縮率選択手段に
より決定された前記量子化幅を用いて量子化を行わせる
べく制御する制御手段とを備えて構成する。
Second, there is a compression rate specifying means for specifying the compression rate, and the total allowable target code amount and quantization width per screen and the quantization width per block according to the compression rate specified by the compression rate specifying means. a compression rate selection means for determining a standard allocated code amount; and a compression rate selection means for determining a standard allocated code amount; Calculate the excess or deficiency of the generated code amount with respect to the allocated code amount, and then process the code amount obtained by adding the calculated excess or deficiency amount to the reference code amount per block determined by the compression rate selection means. a code amount allocating means for determining the allocated code amount of a block; and a variable length encoding means for terminating the variable length encoding so as not to exceed the allocated code amount allocated by the code amount allocating means for each block. a truncation means for controlling, an encoding output means for outputting the transform coefficient variable-length encoded by the variable-length encoding means as a code, and an abort means for outputting the quantization coefficient determined by the compression rate selection means for the quantization means; and a control means for controlling quantization using the quantization width.

更に、本発明は画像データをブロックに分割し、この分
割された各ブロックは順にそれぞれ直交変換を行って低
い周波数成分から順に高い周波数成分へと前記ブロック
毎の画像データを成分分解し、この変換出力を量子化手
段により量子化し、この量子化出力を可変長符号化手段
に与えて可変長符号化し、各ブロック毎にデータの符号
化をする符号化装置において、 第3には前記ブロックの符号化にあたり、当該符号化処
理するブロックでの符号化処理により発生した符号量と
当該ブロックでの割当符号量とに基づいてこの発生符号
量の前記割当符号量に対する過不足量を算出すると共に
、画像当りの許される符号量である目的の総符号量に応
じて予め決定した1ブロック当たりの基準符号量に前記
算出した過不足量を加えた符号量を次に処理するブロッ
クの前記割当符号量として求める符号量割当手段と、各
ブロック毎に前記符号量割当手段により割り当てられた
割当符号量を越えないように、前記可変長符号化を打ち
切るべく前記可変長符号化手段を制御する打ち切り手段
と、前記量子化手段に対し、予め定めた量子化幅を用い
て量子化を行わせるべく制御する制御手段とを備え、前
記可変長符号化手段には前記直交変換により得られる前
記各ブロック単位の画像データのうち、直流成分につい
ては手前の符号化処理ブロックでの直流成分との差分を
得ると共にこの差分を可変長符号化する直流成分用の符
号化処理部と、この直流成分の符号化処理部の処理が終
った後、前記交流成分について可変長符号化する交流成
分用の符号化処理部とを設け、前記符号代打ち切り手段
は交流成分用の符号化処理部に対してのみ打ち切り制御
を可能にする構成とする。
Furthermore, the present invention divides image data into blocks, and each divided block sequentially undergoes orthogonal transformation to decompose the image data for each block from low frequency components to high frequency components in order, and performs this transformation. In an encoding device which quantizes an output by a quantization means, gives this quantized output to a variable length encoding means to perform variable length encoding, and encodes data for each block, the third step is a code of the block. In encoding, based on the code amount generated by the encoding process in the block to be encoded and the allocated code amount in the block, the excess or deficiency of the generated code amount with respect to the allocated code amount is calculated. The code amount obtained by adding the calculated excess/deficiency amount to the standard code amount per block predetermined according to the target total code amount, which is the allowable code amount, is used as the allocated code amount for the next block to be processed. a desired code amount allocation means; and an abort means for controlling the variable length encoding means to abort the variable length encoding so as not to exceed the allocated code amount allocated by the code amount allocation means for each block; control means for controlling the quantization means to perform quantization using a predetermined quantization width; For the DC component of the data, there is an encoding processing unit for the DC component that obtains the difference from the DC component in the previous encoding processing block and encodes this difference with variable length coding, and an encoding processing unit for the DC component. and an AC component encoding processing unit that performs variable length encoding on the AC component after the processing is completed, and the code cost aborting means is capable of performing abort control only on the AC component encoding processing unit. The configuration is as follows.

また、第4には前記可変長符号化手段により符号化され
た画像全体の変換係数の符号量を算出する符号量算出手
段と、この符号量算出手段により算出された画像全体の
符号量と、画面あたりの許される目的総符号量とから最
適な量子化幅を予測すると共に、前記量子化手段にこの
予測量子化幅を与える量子化幅予測手段と、前記ブロッ
クの符号化にあたり、当該符号化処理するブロックでの
符号化処理により発生した符号量と当該ブロックでの割
当符号量とに基づいてこの発生符号量の前記割当符号量
に対する過不足量を算出すると共に、前記目的総符号量
に基づき決定された1ブロック当たりの基準符号量に前
記算出した過不足量を加えた符号量を次に処理するブロ
ックの前記割当符号量として求める符号量割当手段と、
各ブロック毎に前記符号量割当手段により割り当てられ
た割当符号量を越えないように前記可変長符号化を打ち
切るべく前記可変長符号化手段を制御する打切手段と、
前記量子化手段に対し、初めに前記目的総符号量から予
め定めた暫定的な量子化幅を用いて最適な量子化幅を予
測する第1の符号化処理を少なくとも1回実施させ、次
に前記量子化幅予測手段により予測された最適な量子化
幅を用いて第2の符号化処理を実施させるべく制御する
制御手段とを設けて構成する。
Fourthly, a code amount calculation means for calculating the code amount of the transform coefficients of the entire image encoded by the variable length encoding means; and a code amount of the entire image calculated by the code amount calculation means; quantization width prediction means for predicting an optimal quantization width from the permitted target total code amount per screen and giving the predicted quantization width to the quantization means; Based on the code amount generated by the encoding process in the block to be processed and the allocated code amount in the block, the excess or deficiency of the generated code amount with respect to the allocated code amount is calculated, and based on the target total code amount. code amount allocation means for determining the code amount obtained by adding the calculated surplus/deficiency amount to the determined reference code amount per block as the allocated code amount of the block to be processed next;
Termination means for controlling the variable length encoding means to terminate the variable length encoding so as not to exceed the allocated code amount allocated by the code amount allocation means for each block;
The quantization means first performs a first encoding process at least once to predict an optimal quantization width using a predetermined provisional quantization width from the target total code amount, and then and a control means for controlling the second encoding process to be performed using the optimum quantization width predicted by the quantization width prediction means.

また、本発明は画像データをブロックに分割し、この分
割された各ブロックは順にそれぞれ直交変換を行ってこ
の変換出力を量子化手段により量子化し、この量子化出
力を可変長符号化手段に与えて可変長符号化し、各ブロ
ック毎にデータの符号化をする符号化装置において、 第5には圧縮率を指定する圧縮率指定手段と、この圧縮
率指定手段にて指定された圧縮率に応じて画面あたりの
許される目的総符号量および暫定的に定めた量子化幅お
よび1ブロック当たりの基準割当符号量とを決定する圧
縮率選択手段と、前記可変長符号化手段により符号化さ
れた変換係数の画像全体の符号量を算出する符号量算出
手段と、この符号量算出手段により算出された前記画像
全体の符号量と、前記目的総符号量とから最適な量子化
幅を予測すると共に、前記量子化手段にこの予測量子化
幅を与える量子化幅予測手段と、前記ブロックの符号化
にあたり、当該符号化処理するブロックでの符号化処理
により発生した符号量と当該ブロックでの割当符号量と
に基づいてこの発生符号量の前記割当符号量に対する過
不足量を算出すると共に、前記圧縮率選択手段により決
定された1ブロック当たりの基準符号量に前記算出した
過不足量を加えた符号量を次に処理するブロックの前記
割当符号量として求める符号量割当手段と、各ブロック
毎に前記符号量割当手段により割り当てられた割当符号
量を越えないように前記可変長符号化を打ち切るべく前
記可変長符号化手段を制御する打切手段と、前記量子化
手段に対し、初めに前記目的総符号量から予め定めた暫
定的な量子化幅を用いて最適な量子化幅を予測する第1
の符号化処理を少なくとも1回実施させ、次に前記量子
化幅予測手段により予測された最適な量子化幅を用いて
第2の符号化処理を実施させるべく制御する制御手段と
を設けて構成する。
Furthermore, the present invention divides image data into blocks, sequentially performs orthogonal transformation on each divided block, quantizes the transform output by a quantization means, and supplies the quantized output to a variable length encoding means. In an encoding device that performs variable length encoding and encodes data for each block, the fifth component is a compression rate designation means for designating a compression rate, and a compression rate designation means that corresponds to the compression rate designated by the compression rate designation means. a compression ratio selection means for determining a target total code amount allowed per screen, a provisionally determined quantization width, and a reference allocated code amount per block; and a conversion encoded by the variable length encoding means. a code amount calculating means for calculating the code amount of the entire image of coefficients; predicting an optimal quantization width from the code amount of the entire image calculated by the code amount calculating means and the target total code amount; quantization width prediction means for giving this predicted quantization width to the quantization means; and a code amount generated by the encoding process in the block to be encoded and an allocated code amount in the block when encoding the block; Based on this, calculate the excess or deficiency of the generated code amount with respect to the allocated code amount, and add the calculated excess or deficiency amount to the reference code amount per block determined by the compression rate selection means. code amount allocating means for determining the allocated code amount of the next block to be processed; an abort means for controlling the long encoding means; and a first method for predicting an optimal quantization width for the quantization means using a provisional quantization width predetermined from the target total code amount.
and a control means for performing control so as to perform the encoding process at least once, and then perform a second encoding process using the optimal quantization width predicted by the quantization width prediction means. do.

更に第6には画像データをブロックに分割し、この分割
された各ブロックは順にそれぞれ直交変換を行って低い
周波数成分から順に高い周波数成分へと前記ブロック毎
の画像データを成分分解し、 ゛この変換出力を量子化
手段により量子化し、この量子化出力を可変長符号化手
段に与えて可変長符号化し、各ブロック毎にデータの符
号化をする符号化装置において、 前記可変長符号化手段により符号化された画像全体の変
換係数の符号量を算出する符号量算出手段と、この符号
量算出手段により算出された画像全体の符号量と、画面
あたりの許される目的総符号量とから最適な量子化幅を
予測すると共に、前記量子化手段にこの予測量子化幅を
与える量子化幅子ff1l1手段と、前記ブロックの符
号化にあたり、当該符号化処理するブロックでの符号化
処理により発生した符号量と当該ブロックでの割当符号
量=  34 − とに基づいてこの発生符号量の前記割当符号量に対する
過不足量を算出すると共に、前記目的総符号量に基づき
決定された1ブロック当たりの基準符号量に前記算出し
た過不足量を加えた符号量を次に処理するブロックの前
記割当符号量として求める符号量割当手段と、前記量子
化手段に対し、初めに前記目的総符号量から予め定めた
暫定的な量子化幅を用いて最適な量子化幅を予i1+1
]する第1の符号化処理を少なくとも1回実施させ、次
に前記量子化幅予測手段により予測された最適な量子化
幅を用いて第2の符号化処理を実施させるべく制御する
制御手段とを備え、 前記可変長符号化手段には前記直交変換により得られる
前記各ブロック単位の画像データのうち、直流成分につ
いては手前の符号化処理ブロックでの直流成分との差分
を得ると共にこの差分を可変長符号化する直流成分用の
符号化処理部と、この直流成分の符号化処理部の処理が
終った後、前記交流成分について可変長符号化する交流
成分用の符号化処理部とを設け、前記符号代打ち切り手
段は交流成分用の符号化処理部に対してのみ打ち切り制
御を可能にする構成とする。
Furthermore, in the sixth step, the image data is divided into blocks, each of the divided blocks is subjected to orthogonal transformation, and the image data of each block is decomposed into components from low frequency components to high frequency components in order. In a coding device that quantizes a transform output by a quantization means, supplies the quantized output to a variable length coding means to perform variable length coding, and codes data for each block, the variable length coding means A code amount calculation means that calculates the code amount of the transform coefficients of the entire encoded image, the code amount of the entire image calculated by this code amount calculation means, and the allowable objective total code amount per screen. quantization width ff1l1 means for predicting a quantization width and giving the predicted quantization width to the quantization means; and a code generated by the encoding process in the block to be encoded when encoding the block; The excess or deficiency of the generated code amount with respect to the allocated code amount is calculated based on the amount and the allocated code amount in the block = 34 −, and the reference code per block determined based on the target total code amount. For the code amount allocation means and the quantization means, which obtain the code amount obtained by adding the calculated surplus/deficiency amount to the code amount as the allocated code amount of the block to be processed next, Preliminarily determine the optimal quantization width using the provisional quantization width i1+1
] control means for performing control so as to perform a first encoding process at least once, and then perform a second encoding process using the optimal quantization width predicted by the quantization width prediction means; The variable length encoding means obtains the difference between the DC component of the image data in each block obtained by the orthogonal transformation and the DC component of the previous encoding processing block, and calculates this difference. A DC component encoding processing section that performs variable length encoding, and an AC component encoding processing section that performs variable length encoding on the AC component after the processing of the DC component encoding processing section is completed. , the code cost truncation means is configured to enable truncation control only for the AC component encoding processing section.

また、第7には画像データをブロックに分割し、この分
割された各ブロックは順にそれぞれ直交変換を行ってか
らこれを量子化し、この量子化データを可変長符号化す
ることにより、各ブロック毎にデータの符号化をする符
号化方法において、前記データの符号化処理を行って画
像全体の符号量を調べる第1のステップと、この第1の
ステップで得た画像全体の符号量から最適化に必要な量
子化幅の予測を行う第2のステップと、この予測した量
子化幅を用いて前記各ブロック毎の量子化を行う第3の
ステップと、前記ブロックの符号化にあたり、当該符号
化処理するブロックでの符号化処理により発生した符号
量と当該ブロックでの割当符号量とに基づいてこの発生
符号量の前記割当符号量に対する過不足量を算出すると
共に、画像当りの許される符号量である目的の総符号量
に応じて予め決定した1ブロック当たりの基準符号量に
前記算出した過不足量を加えた符号量を次に処理するブ
ロックの前記割当符号量として求める第4のステップと
、この第4のステップにおける各ブロック毎の割当符号
量に収まる範囲でそのブロックの可変長符号化を実施す
る第5のステップとよりなることを特徴とする。
Seventhly, the image data is divided into blocks, each divided block is sequentially orthogonally transformed, then quantized, and this quantized data is variable-length coded. In an encoding method that encodes data, the first step is to perform encoding processing on the data and check the code amount of the entire image, and the optimization is performed from the code amount of the entire image obtained in this first step. a second step of predicting the quantization width necessary for the block; a third step of performing quantization for each block using the predicted quantization width; Based on the code amount generated by the encoding process in the block to be processed and the allocated code amount in the block, the excess or deficiency of the generated code amount with respect to the allocated code amount is calculated, and the allowable code amount per image is calculated. a fourth step of determining the code amount obtained by adding the calculated surplus/deficiency amount to the reference code amount per block predetermined according to the target total code amount as the allocated code amount of the block to be processed next; , and a fifth step of performing variable length encoding of each block within the allocated code amount for each block in the fourth step.

更に第8には画像データをブロックに分割し、この分割
された各ブロックは順にそれぞれ直交変換を行って低い
周波数成分から順に高い周波数成分へと前記ブロック毎
の画像データを成分分解し、この成分分解されたものを
量子化した後、可変長符号化することにより各ブロック
毎にデータの符号化をする符号化方法において、 前記可変長符号化処理においては前記直交変換により得
られる前記各ブロック単位の画像データのうち、直流成
分については手前の符号化処理ブロックでの直流成分と
の差分を得ると共にこの差分を可変長符号化し、この直
流成分用の符号化処理が終わった後、前記交流成分につ
いて可変長符号化して、これにより最適化するに必要な
画像全体の符号量を調べる第1のステップと、この第1
のステップで得た画像全体の符号量に基づき最適化に必
要な量子化幅の予測を行う第2のステップと、この予測
した量子化幅を用いて前記各プロ・ツク毎の量子化を行
う第3のステップと、前記ブロックの符号化にあたり、
当該符号化処理するブロックでの符号化処理により発生
した符号量と当該ブロックでの割当符号量とに基づいて
この発生符号量の前記割当符号量に対する過不足量を算
出すると共に、画像当りの許される符号量である目的の
総符号量に応じて予め決定した1ブロック当たりの基準
符号量に前記算出した過不足量を加えた符号量を次に処
理するブロックの前記割当符号量として求める第4のス
テップとよりなることを特徴とする。
Furthermore, in the eighth step, the image data is divided into blocks, each of the divided blocks is sequentially subjected to orthogonal transformation, and the image data for each block is decomposed into components from low frequency components to high frequency components in order. In an encoding method in which data is encoded for each block by variable length encoding after quantizing the decomposed data, in the variable length encoding process, each block unit obtained by the orthogonal transformation is For the DC component of the image data, the difference between the DC component and the previous encoding processing block is obtained and this difference is variable-length encoded. After the encoding process for the DC component is completed, the AC component is The first step is to perform variable length coding on the image and check the amount of code for the entire image required for optimization.
A second step of predicting the quantization width necessary for optimization based on the code amount of the entire image obtained in the step, and performing quantization for each of the above-mentioned programs using the predicted quantization width. In the third step and encoding the block,
Based on the code amount generated by the encoding process in the block to be encoded and the allocated code amount in the block, the excess or deficiency of the generated code amount with respect to the allocated code amount is calculated, and the allowance per image is calculated. A fourth step of determining the code amount obtained by adding the calculated surplus/deficiency amount to the reference code amount per block predetermined according to the target total code amount, which is the code amount to be processed, as the allocated code amount of the block to be processed next. It is characterized by steps and more.

〔作 用〕[For production]

このような構成において、画像データをブロックに分割
し、この分割された各ブロックは順にそのブロック毎に
直交変換を行い変換係数を得、この直交変換された変換
係数に対し、量子化手段により量子化を行ってから、こ
れを可変長符号化して行くが、第1の構成の場合、1画
像当りの許される符号量である目的の総符号量に応じて
予め決定した1ブロック当たりの基準割当符号量と、こ
のブロックの前のブロックでの符号化処理における発生
符号量の、前記割当符号量に対する過不足分とを合わせ
て得た現在処理中のブロック用の割当符号量を基準に、
現在処理中のブロックにおける符号化処理の発生符号量
を監視し、これが前記割当符号量を越える前にそのブロ
ックでの符号化を打ち切るように可変長符号化処理を行
う。
In such a configuration, image data is divided into blocks, each divided block is sequentially orthogonally transformed to obtain transform coefficients, and the orthogonally transformed transform coefficients are quantized by a quantizer. In the first configuration, standard allocation per block is predetermined according to the target total code amount, which is the allowable code amount per image. Based on the allocated code amount for the block currently being processed, which is obtained by combining the code amount and the excess or deficiency of the code amount generated in the encoding process of the block before this block with respect to the allocated code amount,
The variable length encoding process is performed so as to monitor the generated code amount of the encoding process in the block currently being processed, and stop the encoding in that block before the amount exceeds the allocated code amount.

また、第2の構成の場合、圧縮率を選択することにより
、選択された圧縮率に対応じての目的総符号量および量
子化幅および1ブロック当たりの符号量とを決定し、画
像データをブロック化して直交変換を行い、前記量子化
幅で量子化を行った後、前記1ブロック当たりの基準符
号量と、このブロックの前のブロックでの符号化処理に
おける発生符号量の、前記割当符号量に対する過不足分
とを合わせて得た現在処理中のブロック用の割当符号量
を基準に、現在処理中のブロックにおける符号化処理の
発生符号量を監視し、これか前記割当符号量を越える前
にそのブロックでの符号化を打ち切るように可変長符号
化処理を行う。
In the case of the second configuration, by selecting the compression rate, the target total code amount, quantization width, and code amount per block are determined according to the selected compression rate, and the image data is After dividing into blocks, performing orthogonal transformation, and performing quantization with the quantization width, the assigned code of the reference code amount per block and the code amount generated in the encoding process of the block before this block. Based on the allocated code amount for the block currently being processed, which is obtained by combining the excess and deficiency with respect to the amount, the generated code amount of the encoding process in the currently processed block is monitored, and whether this amount exceeds the allocated code amount. Variable-length encoding processing is performed to terminate encoding in that block beforehand.

また、第3の構成の場合、画像データをブロックに分割
し、この分割されたブロックは順にそのブロック毎に直
交変換を行って低い周波数成分から順に高い周波数成分
へと画像データを成分分解し、この変換出力を量子化手
段により量子化し、その後、この量子化出力を可変長符
号化手段に与えて可変長符号化し、データの符号化をす
るか、前記直交変換により得られる前記各ブロック単位
の画像データのうち、直流成分についてはこのブロック
の手前のブロックでの直流成分との差分を得ると共に、
この差分を可変長符号化し、この直流成分用の符号化処
理が終わった後、前記交流成分について、目的総符号量
に応じて予め決定しておいた1ブロック当たりの基準符
号量と、このブロックの前のブロックでの符号化処理に
おける発生符号量の、前記割当符号量に対する過不足分
とを合わせて得た現在処理中のブロック用の劃当符号量
を基準に、現在処理中のブロックにおける符号化処理の
発生符号量を監視し、これが前記割当符号量を越える前
にそのブロックでの符号化を打ち切るように可変長符号
化処理を行う。
In addition, in the case of the third configuration, the image data is divided into blocks, and the divided blocks are sequentially subjected to orthogonal transformation for each block to decompose the image data from low frequency components to high frequency components in order, This transform output is quantized by a quantization means, and then this quantized output is given to a variable-length encoding means to be variable-length encoded to encode data, or each block unit obtained by the orthogonal transformation is For the DC component of the image data, obtain the difference between this block and the DC component in the previous block, and
This difference is variable-length encoded, and after the encoding process for the DC component is completed, the reference code amount per block, which is predetermined according to the target total code amount, and the block The code amount for the block currently being processed is calculated based on the allocated code amount for the block currently being processed, which is obtained by adding up the excess or deficiency of the code amount generated in the encoding process of the previous block to the allocated code amount. The variable length encoding process is performed so that the amount of code generated in the encoding process is monitored and the encoding of the block is terminated before the amount of code generated exceeds the allocated amount of code.

また、第4の構成の場合、画像データをブロック化して
直交変換を行い、暫定的な量子化幅で量子化を行った後
、可変長符号化し、画像全体の符号量を算出し、これか
ら最適な量子化幅を予測する。そして、次に再び直交変
換された変換係数に対し、新しい量子化幅で量子化を行
った後、目的総符号量に応じて予め決定した1ブロック
当たりの基準割当符号量と、このブロックの前のブロッ
クでの符号化処理における発生符号量の、前記割当符号
量に対する過不足分とを合わ□せて得た現在処理中のブ
ロック用の割当符号量を基準に、現在処理中のブロック
における符号化処理の発生符号量を監視し、これが前記
割当符号量を越える前にそのブロックでの符号化を打ち
切るように可変長符号化処理を行う。
In addition, in the case of the fourth configuration, the image data is divided into blocks, orthogonally transformed, quantized with a provisional quantization width, variable-length encoded, the code amount of the entire image is calculated, and the optimal Predict the quantization width. Then, after quantizing the transform coefficients that have undergone orthogonal transformation again using the new quantization width, the standard allocated code amount per block determined in advance according to the target total code amount and the previous block The code for the block currently being processed is calculated based on the allocated code amount for the block currently being processed, which is obtained by adding up the excess or deficiency of the code amount generated in the encoding process for the block with respect to the allocated code amount. The variable-length encoding process is performed so that the amount of code generated in the coding process is monitored, and the coding in that block is terminated before the amount of code generated in the coding process exceeds the allocated code amount.

また、第5の構成の場合、圧縮率を選択することにより
、選択された圧縮率に応じて目的総符号量および暫定的
量子化幅および1ブロック当たりの基準割当符号量とを
決定し、画像データをブロック化して直交変換を行い、
前記暫定的な量子化幅で量子化を行った後、可変長符号
化し、画像全体の符号量を算出し、これから最適な量子
化幅を予測し、次に再び直交変換された変換係数に対し
、前記予測して得た新しい量子化幅で量子化を行った後
、前記1ブロック当たりの基準割当符号量と、このブロ
ックの前のブロックでの符号化処理における発生符号量
の、前記割当符号量に対する過不足分とを合わせて得た
現在処理中のブロック用の割当符号量を基準に、現在処
理中のブロックにおける符号化処理の発生符号量を監視
し、これが前記割当符号量を越える前にそのブロックで
の符号化を打ち切るように可変長符号化処理を行う。
In the case of the fifth configuration, by selecting the compression rate, the target total code amount, provisional quantization width, and reference allocated code amount per block are determined according to the selected compression rate, and the Block the data and perform orthogonal transformation,
After performing quantization using the provisional quantization width, variable-length encoding is performed, the code amount of the entire image is calculated, the optimal quantization width is predicted from this, and then the orthogonal transformed transform coefficients are , after performing quantization with the new quantization width obtained by the prediction, the allocated code of the standard allocated code amount per block and the generated code amount in the encoding process of the block before this block. Based on the allocated code amount for the block currently being processed, which is obtained by combining the excess and deficiency with respect to the amount, the generated code amount of the encoding process in the currently processed block is monitored, and before this exceeds the allocated code amount. Then, variable-length encoding processing is performed to terminate encoding in that block.

また、第6の構成の場合、画像データをブロックに分割
し、この分割されたブロックは順にそのブロック毎に直
交変換を行って低い周波数成分から順に高い周波数成分
へと前記ブロック毎の画像データを成分分解し、この変
換出力を量子化手段により量子化し、その後、この量子
化出力を可変長符号化手段に与えて可変長符号化し、デ
ータの符号化をするが、前記直交変換により得られる前
記各ブロック単位の画像データのうち、直流成分につい
てはこのブロックの手前のブロックでの直流成分との差
分を得ると共に、この差分を可変長符号化し、前記交流
成分についてはこの直流成分用の符号化処理が終わった
後、最適化するに必要な画像全体の符号量を調べ、これ
により最適な量子化幅を予測し、この予測量子化幅を用
いて前記各ブロック毎の量子化を行い、目的総符号量に
応じて予め決定しておいた1ブロック当たりの基準割当
符号量と、このブロックの前のブロックでの符号化処理
における発生符号量の、前記割当符号量に対する過不足
量とを合わせて得た現在処理中のブロック用の割当符号
量を基準に、現在処理中のブロックにおける符号化処理
の発生符号量を監視し、これが前記割当符号量を越える
前にそのブロックでの符号化を打ち切るように可変長符
号化処理を行う。
In the case of the sixth configuration, the image data is divided into blocks, and the divided blocks are sequentially orthogonally transformed for each block to transform the image data for each block from low frequency components to high frequency components. The components are decomposed, this transform output is quantized by a quantizing means, and then this quantized output is given to a variable length encoding means to be variable length encoded to encode data. Among the image data for each block, for the DC component, the difference between this block and the DC component in the previous block is obtained, and this difference is variable-length coded, and for the AC component, this DC component is encoded. After the processing is completed, check the amount of code required for the entire image for optimization, predict the optimal quantization width from this, perform quantization for each block using this predicted quantization width, and The standard allocated code amount per block, which is predetermined according to the total code amount, and the amount of excess or deficiency of the generated code amount in the encoding process of the block before this block with respect to the allocated code amount are combined. Based on the allocated code amount for the block currently being processed obtained by Variable length encoding processing is performed so as to terminate the process.

また、第7の方法においては、画像データをブロックに
分割し、この分割された各ブロック2よ順にそれぞれ直
交変換を行ってからこれを量子化し、この量子化データ
を可変長符号化することにより、各ブロック毎にデータ
の符号化をするにあたり、前記データの符号化処理を行
って画像全体の符号量を調べ、これにより得た画像全体
の符号量から最適化に必要な量子化幅の予測を行い、こ
の予測した量子化幅を用いて前記各ブロック毎の量子化
を行い、また、前記ブロックの符号化にあたり、当該符
号化処理するブロックでの符号化処理により発生した符
号量と当該ブロックでの割当符号量とに基づいてこの発
生符号量の前記割当符号量に対する過不足量を算出する
と共に、画像当りの許される符号量である目的の総符号
量に応じて予め決定した1ブロック当たりの基準符号量
に前記算出した過不足量を加えた符号量を次に処理する
ブロックの前記割当符号量として求め、この求めた各ブ
ロック毎の割当符号量に収まるように、各ブロックの可
変長符号化を実施する。
In addition, in the seventh method, image data is divided into blocks, each divided block 2 is subjected to orthogonal transformation in order, and then quantized, and this quantized data is variable-length encoded. , When encoding data for each block, perform the encoding process on the data, check the code amount of the entire image, and predict the quantization width necessary for optimization from the obtained code amount of the entire image. The predicted quantization width is used to perform quantization for each block, and when encoding the block, the code amount generated by the encoding process in the block to be encoded and the block The amount of excess or deficiency of this generated code amount with respect to the allocated code amount is calculated based on the allocated code amount in The code amount obtained by adding the calculated surplus/deficiency amount to the standard code amount of Perform encoding.

更に第8の方法においては、画像データをブロックに分
割し、この分割された各ブロックは順にそれぞれ直交変
換を行って低い周波数成分から順に高い周波数成分へと
前記ブロック毎の画像データを成分分解し、この成分分
解されたものを量子化した後、可変長符号化することに
より各ブロック毎にデータの符号化をするにあたり、前
記可変長符号化処理においては前記直交変換により得ら
れる前記各ブロック単位の画像データのうち、直流成分
については手前の符号化処理ブロックでの直流成分との
差分を得ると共にこの差分を可変長符号化し、この直流
成分用の符号化処理が終わった後、前記交流成分につい
て可変長符号化して、これにより最適化するに必要な画
像全体の符号量を調べ、これにより得た画像全体の符号
量に基づき最適化に必要な量子化幅の予測を行い、この
予測した量子化幅を用いて前記各ブロック毎の量子化を
行い、また、前記ブロックの符号化にあたり、当該符号
化処理するブロックでの符号化処理により発生した符号
量と当該ブロックでの割当符号量とに基づいてこの発生
符号量の前記割当符号量に対する過不足量を算出すると
共に、画像当りの許される符号量である目的の総符号量
に応じて予め決定した1ブロック当たりの基準符号量に
前記算出した過不足量を加えた符号量を次に処理するブ
ロックの前記割当符号量として求める。
Furthermore, in the eighth method, image data is divided into blocks, and each divided block is sequentially subjected to orthogonal transformation to decompose the image data for each block into components from low frequency components to high frequency components. , After quantizing this component decomposition, data is encoded for each block by variable length encoding. In the variable length encoding process, each block unit obtained by the orthogonal transformation is For the DC component of the image data, the difference between the DC component and the previous encoding processing block is obtained and this difference is variable-length encoded. After the encoding process for the DC component is completed, the AC component is Variable-length coding is performed on the image, and the amount of code required for the entire image to be optimized is determined. Based on the amount of code for the entire image obtained, the quantization width required for optimization is predicted. Quantization is performed for each block using the quantization width, and when encoding the block, the code amount generated by the encoding process in the block to be encoded and the allocated code amount in the block are calculated. The amount of excess or deficiency of this generated code amount with respect to the allocated code amount is calculated based on the amount of generated code, and the amount of excess or deficiency of this generated code amount with respect to the allocated code amount is calculated, and the reference code amount per block determined in advance is The code amount obtained by adding the calculated surplus/deficiency amount is determined as the allocated code amount of the block to be processed next.

このように本装置は、目的とする符号量から1ブロック
当たりの符号量を決定し、順次符号化出力を見ながら、
所望の符号量内で収まるように、可変長符号化をブロッ
ク単位で制御し、符号化出力を最終出力として得るよう
にしたものである。
In this way, this device determines the amount of code per block from the target amount of code, and sequentially monitors the encoded output.
Variable length encoding is controlled on a block-by-block basis so that the amount of code is within a desired amount, and the encoded output is obtained as the final output.

また、本装置は最初に少なくとも1回の統計処理を行い
、量子化幅を最適化してから符号化処理を行うと、更に
良好な結果が得られるため、まず統計処理により量子化
幅を最適化するに必要な画像全体の符号量を調べ、次に
この統計処理により得た情報をもとに最適化された符号
化を行うための処理に入り、順次、符号化出力を見なが
ら所望の符号量内で収まるように、可変長符号化をブロ
ック単位で制御し、符号化出力を最終出力として得るよ
うにしたものである。
Additionally, if this device first performs statistical processing at least once to optimize the quantization width and then performs encoding processing, even better results can be obtained, so first optimize the quantization width by statistical processing. The amount of code required for the entire image is checked, and then the process begins to perform optimized encoding based on the information obtained through this statistical processing. Variable length encoding is controlled on a block-by-block basis so that the encoded output is obtained as the final output.

そのため、最初に画像のブロック化、このブロック化さ
れた画像の要素に対する目的とする符号量から予め決定
された量子化幅を使用しての量子化、この量子化により
得られた変換係数の可変長符号化、そして、この可変長
符号化に当たり、目的とする符号量から予め求めた1ブ
ロック当たりの割り当て符号量とそれま°での符号化に
より発生した割り当て符号量の過不足とを加えたブロッ
クの割り当て符号量に収まる範囲内での当該要素の可変
長符号化、処理対象画像の全符号の保存のための出力処
理と云った処理を行い、最終出力を得るようにしたもの
であるから、得られた画像データに対し、一定の符号量
以内に収まるように符号化できるようになり、画像の記
憶枚数が規定される場合等では、記憶手段の記憶容量に
対して、一定の記憶可能枚数を保証することができる他
、−度の符号化処理で処理が終るから、一定の処理= 
47− 時間内で符号化を行うことができるようになる。
Therefore, first, the image is blocked, quantized using a quantization width predetermined from the target code amount for the elements of this blocked image, and the transform coefficients obtained by this quantization are varied. Long coding and variable length coding are performed by adding the allocated code amount per block obtained in advance from the target code amount and the excess or deficiency of the allocated code amount caused by previous encoding. This is because the final output is obtained by performing variable-length encoding of the element within the allocated code amount of the block and output processing to save all the codes of the image to be processed. , the obtained image data can now be encoded within a certain amount of code, and in cases where the number of images to be stored is specified, a certain amount of storage capacity can be achieved with respect to the storage capacity of the storage means. In addition to being able to guarantee the number of sheets, constant processing =
47- It becomes possible to perform encoding within time.

また、符号量の制御は1ブロック当たりの割り当て符号
量と、そのブロックまでの割り当て符号量の過不足のみ
を用いるので、大きな記憶領域を必要とせず、比較的簡
単な構成で実現できる。更に符号化の打ち切りは、高い
周波数の成分に対して行うので、画質の劣化も比較的少
ない。
Further, since the code amount control uses only the allocated code amount per block and the excess or deficiency of the allocated code amount up to that block, a large storage area is not required and it can be realized with a relatively simple configuration. Furthermore, since the coding is terminated for high frequency components, there is relatively little deterioration in image quality.

また、最初に暫定的な量子化幅を使用しての統計処理を
少なくとも一回行って最適な量子化幅を予測した後、こ
れに基づき得られた最適な量子化幅を用いて符号化する
方法では、少なくとも一回の統計処理のパスと符号化処
理のパスの決まった回数のパスで処理が終わるから、一
定の処理時間内で符号化を行うことができと共に、符号
化における符号の打ち切りの発生が非常に少なくなる上
に、符号化の打ち切りは高い周波数の成分に対して行う
ため、画質の劣化も殆どない。
Also, first perform statistical processing using a provisional quantization width at least once to predict the optimal quantization width, and then encode using the optimal quantization width obtained based on this. In this method, processing is completed in at least one pass of statistical processing and a fixed number of passes of encoding processing, so it is possible to perform encoding within a fixed processing time, and it also eliminates code truncation during encoding. In addition, since the coding is terminated for high frequency components, there is almost no deterioration in image quality.

従って、この発明によれば、簡単な構成により、一定の
処理時間内で一定の符号量内に収まるように符号化でき
るようになる他、画質の劣化も殆どない。更に本発明に
よれば、符号自体には影響を及ぼさないので、従来例で
示した国際標準東方式や本発明の課題の項で示した再生
時の互換性を保つことができる。言い換えれば再生装置
は共通で良い。
Therefore, according to the present invention, with a simple configuration, it is possible to perform encoding within a certain amount of code within a certain processing time, and there is almost no deterioration in image quality. Furthermore, according to the present invention, since the code itself is not affected, it is possible to maintain compatibility during playback with the International Standard East System shown in the conventional example and in the section of the problem to be solved by the present invention. In other words, a common playback device may be used.

〔実施例〕〔Example〕

以下、本発明の実施例を図面に基づいて説明する。 Embodiments of the present invention will be described below based on the drawings.

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

すなわち、本発明は例えば、1つの画像(画面)をブロ
ックに区分し、これら各ブロックを順に、ブロック単位
でそのブロックの構成画素のデータを直交変換してこれ
を更に量子化し、圧縮符号化するにあたり、1画像当り
の最終的に収めたい符号量である目的総符号量に基づい
て予め決定した量子化幅により、前記各ブロックの画像
データを順に量子化すると共に、この量子化したものを
符号化し、この符号化により得られる符号量が、前記目
的総符号量から予め決定した1ブロック当たりの基準割
当符号量と、このブロックより一つ前の処理順番に当っ
たブロックにおける当該符号化処理での発生符号量の割
当符号量に対する過不足量とを加えた量にて定まるその
ブロックの許容される符号量である割当符号量に収まる
ように、符号量を監視しながら符号化を進め、E OB
 (End Of Block)符号を含め、符号量が
前記割当符号量に達するとそのブロックの符号化は終了
させるか、直流成分は調整割当符号量を越える場合でも
、必ず符号化させ、そのときの前記割当符号量に対する
過不足を記憶しておき、次のブロックの符号化に移ると
共に当該次のブロックにおいてこの過不足量分を基準割
当符号量に加えて調整し、このブロックでの割当符号量
とし、この割当符号量の範囲で可変長符号化すると云っ
たものである。
That is, the present invention divides one image (screen) into blocks, and sequentially orthogonally transforms the data of the constituent pixels of each block for each block, further quantizes the data, and compresses and encodes the data. In this process, the image data of each block is sequentially quantized using a quantization width determined in advance based on the target total code amount, which is the final amount of code that is desired to be stored per image, and the quantized data is encoded. , and the code amount obtained by this encoding is determined by the standard allocated code amount per block predetermined from the target total code amount and the encoding process for the block that is in the processing order immediately before this block. Encoding is proceeded while monitoring the code amount so that the code amount is within the allocated code amount, which is the allowable code amount for the block, which is determined by adding the amount of excess or deficiency of the generated code amount to the allocated code amount. OB
(End Of Block) When the code amount reaches the allocated code amount, including the code, the coding of that block is terminated, or even if the DC component exceeds the adjusted allocated code amount, it is always encoded, and the above-mentioned at that time The excess/deficiency with respect to the allocated code amount is memorized, and when the next block is encoded, this excess/deficit amount is added to the standard allocated code amount and adjusted, and the allocated code amount is set as the allocated code amount for this block. , variable length encoding is performed within this allocated code amount range.

また、もう一つの考え方として、本発明は前記各ブロッ
クを順に、ブロック単位でそのブロックの構成画素のデ
ータを量子化し、圧縮符号化するにあたり、1画像当り
の最終的に収めたい符号量である目的総符号量に基づい
て予め決定した量子化幅により、前記各ブロックの画像
データを順に量子化してその符号量から最適な量子化幅
を予測し、この予測した最適量子化幅を用いて再び、上
記各ブロックの画像データを順に量子化すると共に、こ
の量子化したものを符号化し、この符号化により得られ
る符号量が、前記目的総符号量から予め決定した1ブロ
ック当たりの基準割当符号量と、このブロックより一つ
前の処理順番に当ったブロックにおける当該符号゛比処
理での発生符号量の割当符号量に対する過不足分とを加
えた量にて定まるそのブロックの許容される符号量であ
る割当符号量に収まるように、符号量を監視しながら符
号化を進め、EOB符号を含め、符号量が前記割当符号
量に達するとそのブロックの符号化は終了させるが、直
流成分は調整割当符号量を越える場合でも、必ず符号化
させ、そのときの前記割当符号量に対する過不足を記憶
しておき、次のブロックの符号化に移ると共に当該次の
ブロックにおいてこの過不足量分を基準割当符号量に加
えて= 51− 調整し、このブロックでの割当符号量とし、この割当符
号量の範囲で可変長符号化すると云ったものである。
Another way of thinking is that the present invention sequentially quantizes the data of the constituent pixels of each block in block units, and when compressing and encoding the data, the amount of code that is ultimately desired to be stored per image is determined. The image data of each block is sequentially quantized using a quantization width predetermined based on the target total code amount, and the optimal quantization width is predicted from the code amount. , the image data of each block is quantized in order, and the quantized data is encoded, and the code amount obtained by this encoding is the standard allocated code amount per block determined in advance from the target total code amount. The allowable code amount for that block, which is determined by the sum of the amount of code generated in the code ratio processing of the block in the processing order immediately before this block, and the excess or deficiency of the allocated code amount. Encoding is proceeded while monitoring the code amount so that it stays within the allocated code amount, and when the code amount reaches the allocated code amount, including the EOB code, the encoding of that block is terminated, but the DC component is adjusted. Even if the allocated code amount is exceeded, the code is always encoded, the excess or deficiency with respect to the allocated code amount at that time is memorized, and when the next block is encoded, this excess or deficiency is used as the standard for the next block. In addition to the allocated code amount, =51- is adjusted to be the allocated code amount for this block, and variable length encoding is performed within the range of this allocated code amount.

前者は1パス、後者は2パス方式であり、いずれもある
量子化幅で量子化してこれを可変長符号化するに際し、
各ブロックに割り当てた基準割当符号量を一つの基準と
し、各ブロックでの発生符号量にばらつきかあるのを、
次のブロックで吸収することで調整しようと云うもので
、この調整したものを割当符号量とし、この割当符号量
の範囲でブロックでの符号化を実施し、割当符号量を越
えるときはそのブロックの符号化を打ち切るようにする
。しかし、画像データは直交変換により直流成分と交流
成分に分解されおり、視覚的に影響の大きい直流成分に
ついては符号量が仮に割当符号量を越えても符号化打ち
切りは行わず、次のブロックでの割当符号量をそのオー
バした分だけ差し引き、また、交流成分に入って割当符
号量をオーバする危険が生した場合は符号化を打ち切る
The former is a 1-pass method, and the latter is a 2-pass method, and in both cases, when quantizing with a certain quantization width and variable length encoding,
Using the standard allocated code amount assigned to each block as a standard, we can calculate the variation in the generated code amount in each block.
This is to make adjustments by absorbing it in the next block, and this adjusted amount is set as the allocated code amount, and the block is encoded within the range of this allocated code amount, and when the allocated code amount is exceeded, that block is The encoding of is terminated. 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 entering the AC component and exceeding the allocated code amount, encoding is discontinued.

また、符号化により発生した符号量が割当符号量に満た
ないときはその余剰分を、次のブロックの割当符号量に
加えて、当該次のブロックでの割当符号量を多くする。
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.

交流成分の打ち切りに関しては、高い周波数成分は特に
周波数が高くなる程、視覚的影響が少ないと云う傾向が
あることを逆に利用している。このようにして、一つ前
の処理ブロックでの符号量が割当符号量に対して過不足
を生じた場合に、その過不足分を次のブロックの割当符
号量に反映させ、調整すると云う手法をとっている点に
特徴がある。  ・ 2パス方式を具体的に述べると、本発明では最初に第1
パスの処理として、目的総符号量から予め求めた暫定的
な量子化幅を用いて統計処理を行い、最適な量子化係数
を予測する。次に、第2パスの処理として最終的な符号
化処理を実施する。
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. In this way, if 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. It is distinctive in that it takes - To specifically describe the two-pass method, in the present invention, the first
As pass processing, statistical processing is performed using a provisional quantization width determined in advance from the target total code amount to predict an optimal quantization coefficient. Next, final encoding processing is performed as second pass processing.

第2パス目は各ブロック毎に前記予測量子化係数により
量子化すると共に、これを符号化し、この符号化により
得られる符号量が、目的とする総符号ffiに基づいて
予め決定した1ブロック当たリノ括準割当符号量と、そ
のブロックの1つ前のプロツク(a)についての符号化
処理で生じた符号量の過不足分(当該1つ前のブロック
(a)に割り当てられた割当符号量に対する当該ブロッ
ク(a)での発生符号量との差分)とを加えた量で定ま
る割当符号量内に収まるように、符号量を監視しながら
、符号化を進め、EOB符号を含め、符号量が割当符号
量に達するとそのブロックの符号化は終了させるが、直
流成分は割当符号量を越える場合でも必ず符号化させ、
そのときの割当符号量の過不足を記憶しておき、次のブ
ロックの符号化に移って行く。
In the second pass, each block is quantized using the predictive quantization coefficient and encoded, and the amount of code obtained by this encoding is determined per block in advance based on the target total code ffi. The excess/deficiency of the code amount caused by the encoding process for the block (a) immediately before that block (the assigned code allocated to the block (a) immediately before the block) Encoding is proceeded while monitoring the code amount so that the amount of code is within the allocated code amount determined by adding the difference between the amount of code generated in the block (a) and the amount of code generated in the block (a). When the amount of code reaches the allocated code amount, encoding of that block is terminated, but the DC component is always encoded even if it exceeds the allocated code amount.
The surplus/deficiency of the allocated code amount at that time is memorized and the next block is encoded.

この1ブロック当たりの割当符号量を用いたブロック毎
の符号化打ち切りによる符号量制御は、それのみで画像
全体の符号量制御を行わせることもできれば、おおよそ
の符号量制御を行ったときの符号量が目的の符号量をオ
ーバしたときの微調整に使用することもできる。
This code amount control by aborting coding for each block using the allocated code amount per block can be used to control the code amount for the entire image by itself, or the code amount control when performing approximate code amount control It can also be used for fine adjustment when the amount exceeds the target code amount.

統計処理を行わすに1パスで符号化を行う場合が先に述
べた1パス方式であり、1パスで符号化を終了するため
、短時間で処理が行えると云う非常に大きな効果が得ら
れるが、いつも似たような画像、つまり符号化により発
生する符号量が同じような画像を符号化するようなシス
テムてないと、画像によってはあまり良−好な画質が得
られないことがある。
The one-pass method mentioned earlier is when encoding is performed in one pass for statistical processing, and since the encoding is completed in one pass, it has the great effect of being able to perform processing in a short time. However, unless there is a system that always encodes similar images, that is, images with the same amount of code generated by encoding, it may not be possible to obtain very good image quality depending on the image.

これに対し、統計処理を用いる場合が2バス方式であり
、この統計処理と1ブロック当たりの割り当て符号量を
用いたブロック毎の符号化打ち切りによる符号量制御と
を組み合わせたときに、特に大きな効果が得られる。、
以下、この場合を例にとって詳細に説明する。
On the other hand, when statistical processing is used, the two-bus method is used, and when this statistical processing is combined with code amount control by cutting off coding for each block using the allocated code amount per block, it is particularly effective. is obtained. ,
Hereinafter, this case will be explained in detail by taking an example.

統計処理は最適な量子化幅を予測するものであり、この
最適化された量子幅を符号化処理で使用することで、は
ぼ目的の総符号量に近付けることができるようになる。
Statistical processing predicts the optimal quantization width, and by using this optimized quantum width in encoding processing, it becomes possible to approach the total code amount as desired.

そして、この時点で符号量が目的総符号量内に収まれば
、この処理だけで十分であるが、1画像のデータ量の上
限が規定されている場合、1バイトはおろか、1ビツト
でも目的の符号量をオーバすることは許されない。そこ
で、オーバしたときの処理法が必要になる。
If the code amount falls within the target total code amount at this point, this processing alone is sufficient, but if an upper limit for the data amount of one image is specified, even 1 bit, let alone 1 byte, is enough to reach the target amount. Exceeding the code amount is not allowed. Therefore, a processing method is needed when the number exceeds the limit.

それがブロック毎の割当符号量による制御である。これ
は符号化を行ったときの符号量が目的総符号量(1画像
のデータ量の上限対応の値)をオーバした時の微調整に
使用するものである。符号化処理を統計処理において予
測した最適な量子化幅で実行した結果を見て、オーバし
なかったときは終了、オーバしたときは後処理と云うよ
うにしても良いが、その場合、統計処理、符号化処理、
後処理の3ステツプとなり、時間かかかるばかりでなく
、符号化処理と後処理の間で、長さの異なる符号を繋ぎ
合わせることなく区別がつくように、保存する必要か生
じ、多くのメモリが必要となると云う問題があるから、
符号化処理の最中に微調整を行うことが望まれる。しか
し、無闇にデータを落とすことは画質の劣化に繋がるの
で、避けねばなら、ない。
This is control based on the allocated code amount for each block. This is used for fine adjustment when the code amount during encoding exceeds the target total code amount (a value corresponding to the upper limit of the data amount of one image). It is also possible to check the results of executing the encoding process using the optimal quantization width predicted by statistical processing, and if it does not exceed the quantization width, end the process, and if it exceeds it, perform post-processing, but in that case, the statistical processing , encoding process,
There are three post-processing steps, which not only takes time, but also requires storage between the encoding process and post-processing so that codes of different lengths can be distinguished without being concatenated, which requires a lot of memory. Because there is a problem that it is necessary,
It is desirable to make fine adjustments during the encoding process. However, recklessly dropping data will lead to deterioration of image quality, so it must be avoided.

そこで、本発明では各ブロックの高い周波数成分から省
略して行くことにより視覚的な影響を最小にする。とこ
ろが、符号量がオーバするか否かは符号化を終了してみ
ないと分からないので、本発明ではそれを各ブロック毎
に符号化の時点で判定させるようにする。
Therefore, in the present invention, the visual influence is minimized by omitting the high frequency components of each block. However, since it is not known whether the amount of code exceeds until the encoding is finished, in the present invention, this is determined for each block at the time of encoding.

目的総符号量に応じて予め定めた暫定的な量子化幅と1
ブロック当たりの割当符号量を決めておき、これを「各
ブロックの符号量がこれを越えない限り画像全体の符号
量が目的の符号量を越えることはない」と云うガイドラ
インにし、このガイドラインを各ブロック毎の割当符号
量として監視の基準にする。そして、本発明における符
号化処理では各ブロックにおいて1、ブロックの割当符
号量を越えないように各ブロックにおいて符号化を打ち
切る。
A provisional quantization width predetermined according to the target total code amount and 1
Determine the amount of code to be allocated per block, and use this as a guideline that says, ``Unless the amount of code for each block exceeds this, the amount of code for the entire image will not exceed the target amount of code.'' This guideline is applied to each block. The allocated code amount for each block is used as a monitoring standard. In the encoding process according to the present invention, 1 is added to each block, and encoding is terminated in each block so as not to exceed the allocated code amount of the block.

各ブロックは直交変換により、そのブロックでの画像デ
ータが持つ空間周波数に応じて周波数成分別に分解され
、そのデータが量子化されているので、各ブロックの符
号化においては、低い周波数成分から高い周波数成分を
順次、符号化してゆく際に、ガイドライン(割当符号N
)を越えないように監視しながら符号化を進める。ここ
で、このガイドラインでは十分すぎて割り当てられた符
号量を全部使わずに符号化を終了してしまうブロックと
、逆に足りないブロックとが存在すると云う画像が一般
的である。そこで、オーバしなかったブロック、すなわ
ち、EOBを含めて発生した符号量が割り当てられた符
号量よりも少なかった、゛あるいは丁度向じたったブロ
ックは問題なく符号化を終了、つまりEOBを出力する
。途中てオーバしてしまうブロックは割り当てられた符
号量を越える前に符号化を打ち−Jす、それ以上の高周
波成分は符号化せずに、カットしてしまうことで割当符
号量内収まるようにする。要するに、途中でオーバして
しまうブロックはオーバする前にそのブロックの符号化
を終了、つまり、EOBを出力する。そして、この途中
打ち切りそ割当符号量に対する余りが生しることが多い
ので(可変長符号化であるため、データ値により符号長
が変わることから途中で打ち切ると余りが生じることが
多い)、その余りを1ブロックの基準割当符号量に加え
、次のブロックの割当符号量とする。
Each block is decomposed into frequency components by orthogonal transformation according to the spatial frequency of the image data in that block, and the data is quantized, so when encoding each block, the frequency components are divided from low frequency components to high frequencies. When sequentially encoding components, guidelines (allocation code N
) while monitoring to ensure that it does not exceed the encoding limit. In general, this guideline is used for images in which there are blocks that are so sufficient that the coding ends without using the entire allocated amount of code, and blocks that are insufficient. Therefore, for blocks that do not overlap, that is, for blocks in which the generated code amount including EOB is less than the allocated code amount, or blocks that have just reached the allocated code amount, coding is completed without any problem, that is, EOB is output. Blocks that exceed the allocated code amount are encoded before they exceed the allocated code amount, and higher frequency components are cut without being encoded so that they stay within the allocated code amount. do. In short, for blocks that overlap midway, the encoding of that block is finished before the block exceeds the limit, that is, an EOB is output. Since this mid-term termination often results in a surplus of the allocated code amount (because it is variable-length encoding, the code length changes depending on the data value, a surplus often occurs if it is terminated midway). The remainder is added to the standard allocated code amount for one block, and is used as the allocated code amount for the next block.

極端に圧縮率を高くしない限り、現実にはありえないが
、万一、与えられた割当符号量が直流成分さえも符号化
するに足りない場合には、直流成分のみは符号化を実施
し、そのブロックの符号化を終了、つまり、EOBを出
力する。そして足りなかった符号量は不足分として、次
のブロックに繰越、その不足分を1ブロックの基準割当
符号量から減じ、次のブロックの割当符号量とする。こ
のとき、EOBもハフマン符号の−っであるから、EO
Bも含めて割当符号量内に収まるように符号化打ち切り
制御する必要がある。。
This is not possible in reality unless the compression rate is extremely high, but 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 and the Finish encoding the block, that is, output EOB. The insufficient amount of code is carried over to the next block as a shortage, and the shortage is subtracted from the standard allocated code amount of one block to become the allocated code amount of the next block. At this time, EOB is also Huffman code -, so EO
It is necessary to perform coding abort control so that the amount of code including B is within the allocated code amount. .

このようにして、例えば、大部分のブロックは打ち切る
必要無く符号化を終了し、残りの一部は極く高い周波数
の一部が省略されて、符号化を終了したとすれば、欠落
する情報は極めてゎずがてあり、しかも、欠落するのは
視覚的に影響の少ない高い周波数成分の情報にとどめる
ことができる。そして、この方式により統計処理、符号
化処理の2ステツプで必ず符号化を終了することができ
、従来のように何度も最適化を繰り返すことが不要であ
るとともに、比較的簡単な機構で符号量の制御かでき、
従来のように多数の作業用メモリも必要とせずに、総符
号量を規定値内に収めることができるようになり、しか
も、画質の劣化も抑制できる。
In this way, for example, if most blocks finish coding without needing to be truncated, and some of the remaining blocks finish coding with some very high frequencies omitted, there will be missing information. However, what is missing is only information in high frequency components that have little visual impact. With this method, encoding can be completed in two steps: statistical processing and encoding processing, and there is no need to repeat optimization many times as in the conventional method. You can control the amount,
It is now possible to keep the total code amount within a specified value without requiring a large number of working memories as in the past, and furthermore, deterioration in image quality can be suppressed.

本発明は画像の各ブロックにおける発生符号量は予々異
なる、つまり、局所的な符号量の片寄りはあるが、数ブ
ロックあるいは数十ブロックのかたまりをマイクロブロ
ックとしてとらえることにすると、このマイクロブロッ
ク毎の発生符号量は比較的片寄りが少ないことに着目し
たものである。よって、1ブロック当たりの基準割当符
号量を固定しておいても、発生符号量の割当符号量に対
する余剰分を、以降のブロックの割当符号量へと繰り越
すことにより、各ブロックの発生符号量の変化に適応さ
せながらも、マイクロブロックでは発生符号量を制御し
ていることになる。
In the present invention, the amount of code generated in each block of an image is different in advance, that is, the amount of code generated is locally uneven, but if we consider a group of several blocks or tens of blocks as a microblock, each microblock This method focuses on the fact that the amount of generated codes is relatively unbalanced. Therefore, even if the standard allocated code amount per block is fixed, the generated code amount of each block can be reduced by carrying over the surplus of the generated code amount to the allocated code amount of subsequent blocks. While adapting to changes, microblocks control the amount of generated code.

この原理では、符号化の一番最初の方に発生符号量の多
いブロックが集中すると、本来の効果が得られないこと
があるが、通常このようなケースは殆どあり得ないし、
万一、あったとしても画一  60  = 像の視覚的にあまり重要ではない位置にその影響が現れ
るので、問題は少ないが、画像全体の目的の符号量の例
えば90%をブロックの数で割って1ブロック当たりの
基準割当符号量にすると共に、残りの10%をあたかも
前ブロックでの割当符号量の剰余分であるかのようにし
て最初のブロックの符号化の際に与えると云った手法を
採れば解決できる。
With this principle, if blocks with a large amount of generated code are concentrated at the beginning of encoding, the intended effect may not be obtained, but normally such a case is almost impossible,
Even if there is, the effect will appear in visually unimportant positions of the image, so it is not a problem, but if you divide, for example, 90% of the desired amount of code for the entire image by the number of blocks, In this method, the remaining 10% is given as a surplus of the allocated code amount for the previous block when encoding the first block. It can be solved by taking

以上の原理を用いた本装置の実施例を説明する。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 operating section of the electronic camera body 1, and the switch 30 is connected to a control circuit 90.

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

前記記録系70はインタフェース回路70aおよび記録
媒体として用いられるIcメモリを内蔵したメモリカー
ド71とからなる。メモリカード71は電子カメラ本体
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 71 can be attached to and removed from the electronic camera body 1.

制御回路90はマイクロプロセッサ(MPU)によす実
現されている。
The control circuit 90 is implemented using 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.

L CD表示器48には制御回路90の制御のもとに撮
影モードやコマ数、日付、時間等、種々の値や状態が表
示される。本電子カメラでは、電子カメラ本体1の操作
部に設けられたスイッチ30を操作することにより、画
像の圧縮率を所望の値に設定することができる。すなわ
ち、制御回路90には予め標準的な複数種の圧縮率情報
が設定されており、これがスイッチ30の操作により設
定される撮影可能枚数の値をもとに、装着されているメ
モリカード(記録媒体)の容量から、適用する圧縮率を
求め、この求めた圧縮率の値およびメモリカードに記録
できる画像の枚数の値に換算されて操作部のLCD表示
器48に表示させるようになっている。そして、ユーザ
がスイッチ30を押すと、制御回路90はスイッチ30
が押される毎に、これらの値を変更する。
The LCD display 48 displays various values and statuses 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 is pressed.

ユーザは表示される変更値を見ながら、所望の値のとこ
ろでスイッチ30を押すのを止めることにより、制御回
路90はその時点での撮影可能画像枚数指示値に対応す
る指示圧縮率を設定するようになっている。これは圧縮
率に応じて定まる画像当りの標準的な総71号量を制御
回路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 amount of 71 codes per image, which is determined according to the compression rate, and providing this to the encoding circuit 80 as target code amount setting information. Further, when the shutter operation button 50, which is a switch, is pressed, the shutter function is activated and 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. Therefore, by reading and controlling this, a video signal can be obtained from the image sensor 40b. These controls are also controlled by the control circuit 90.

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

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

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

本実施例では、輝度系Yのデータを読出してブロック化
し、後段の処理系に与えて、このY成分データについて
の統計処理を行わせ、該統計処理が終了したならば、次
にクロマ系Crs Cb酸成分データについての統計処
理に入るべく該クロマ系Cr、 CI>成分のデータの
読出しとブロック化に入る。
In this embodiment, the 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.After the statistical processing is completed, the chroma system Crs In order to start statistical processing of the Cb acid component data, reading and blocking data of the chroma system Cr, CI>component is started.

クロマ系のブロック化は1.最初にCr成分の画像デー
タについてすべてのブロック化を行い、その後に、Cb
酸成分画像データをブロック化して行くものとする。
Chroma block formation is 1. First, all the image data of the Cr component is divided into blocks, and then the Cb
It is assumed that the acid component image data is divided into blocks.

符号化回路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 (transformation coefficients) output from the orthogonal transformation circuit 4, and in the first quantization, changes the quantization width for each frequency component set in advance to the shooting mode. The transform coefficients are quantized using a quantization width corrected by multiplying by a preset quantization coefficient α, and in the second time, quantization is performed using the optimal quantization coefficient α determined by the previous process. This is the configuration to do.

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では、入力した量子化された変換係
数を第9図に示す順序でスキャンするジグザグ・スキャ
ンと呼ばれる手法により、低い周波数成分から高い周波
数成分への走査を行う。
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.

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

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

符号量算出回路14は入力されたY、 Cr、 Cb各
成分の各符号毎の符号長の積算を行い、YSCrscb
各成分の符号量を計算し、この画像全体の符号量のデー
タについて量子化幅予測回路12に出力すると共に、各
色成分毎の符号量と画像全体の符号量のデータについて
は符号量割当て回路20に出力する構成としである。
The code amount calculation circuit 14 integrates the code length for each code of the input Y, Cr, and Cb components, and calculates YSCrscb.
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 the configuration to output to.

量子化幅予測回路12は第1バスの開始にあたり制御回
路18から目的とする符号量の情報を受け、この符号量
情報から次式 %式%(1) 但し、BRは符号量(1画素あたりのビ・ソト数)、s
pは量子化係数、a、bは定数。
The quantization width prediction circuit 12 receives information on the target code amount from the control circuit 18 at the start of the first bus, and uses this code amount information to calculate the following formula (%). Bi-soto number), s
p is a quantization coefficient, and a and b are constants.

の関係を用いて量子化係数αの初期値を設定し、量子化
回路6に出力し、第2パスの開始に先駆けて、符号量算
出回路14から入力された画像全体の符号量と、1画像
当りの許容される最大のデータ量である目的総符号゛量
とから、例えば、(1)式の=  70 − 関係を用い、線形予測により目的総符号量に近づけるの
に最適な量子化係数αを、今回実際に使用した量子化係
数を勘案して予測するものである。
The initial value of the quantization coefficient α is set using the relationship of From the target total code amount, which is the maximum allowable data amount per image, for example, using the = 70 - relationship in equation (1), determine 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.

ここで、量子化係数を如何にして最適な値にするかか、
重要な課題となるので、この点について少し説明する。
Here, how to set the quantization coefficient to the optimal value?
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 quantization 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ブロックあ
たりの割当符号量を算出して符号化打切回路16に出力
するものである。
The code amount allocation circuit 20 calculates the code amount to be allocated 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 total code amount. is calculated and output to the encoding abort circuit 16.

ここでの算出の方法は、例えば、各色成分毎の符号量の
比で、目的総符号量を比例配分し、更に各色成分毎の割
当符号量をブロック数で割る。
The calculation method here is, for example, by proportionally allocating the target total code amount using the ratio of the code amounts for each color component, and further dividing the allocated code amount for each color component by the number of blocks.

例えば、ある色成分の符号量と目的総符号量との乗算を
行い、それを画像全体の符号量で割った後、その色成分
のブロック数で更に割ることにより、その色成分の1ブ
ロック当たりの割当符号量を決定する。この結果、各色
成分の割当符号量は、その色成分での実際の符号量°に
応じて符号量か少ない場合はそれ相応に、間に合う程度
に抑えられ、符号量の多い色成分にはそれ相応に多く割
り当てられる。
For example, by multiplying the code amount of a certain color component by the target total code amount, dividing it by the code amount of the entire image, and then further dividing by the number of blocks of that color component, Determine the allocated code amount. As a result, the amount of code allocated to each color component is suppressed to the extent that it is possible to make it in time, depending on the actual amount of code for that color component. will be allocated a lot to

符号量割当回路20は符号量情報テーブルとブロック割
当符号量データテーブルとを持ち、符号量情報テーブル
における該当ブロック位置の符号量情報を符号量算出回
路14から入力された符号量情報に書き替える一方、符
号量算出回路14から入力された各色成分毎の符号量お
よび画像全体の符号量と、目的総符号量とから各色成分
の1ブロッり当たりの基準割当符号量を算出し、この算
出した各色成分の1ブロック当たりの基準割当符号量の
データをブロック割当符号量データテーブルに格納する
。このブロック割当符号量データテーブルの各色成分別
の1ブロック当たりの基準割当符号量は、該当の色成分
が可変長符号化処理される際に符号化打切回路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. , calculates the standard allocated code amount per block for each color component from the code amount for each color component and the code amount for the entire image inputted from the code amount calculation circuit 14, and the target total code amount, and calculates the standard allocated code amount per block for each color component. The data of the standard allocated code amount per block of the component is stored in the block allocated code amount data table. The standard allocated code amount per block for each color component in this block allocated code amount data table is given to the encoding abort circuit 16 when the corresponding color component is subjected to variable length encoding processing.

符号化打切回路16は、符号量割当回路20からの該当
色成分の1ブロック当たりの基準割当符号量と1つ手前
のブロックでの発生符号量の割当符号量に対する過不足
骨を加えて該当ブロックの割当符号量とすると共に、符
号量割当回路20からの各符号の符号長を割当符号量か
ら減算し、割当符号量の残りが、送出すべき符号量とE
OBの符号との合計符号量より小さくなった場合には打
切り信号を出力して可変長符号化回路8に与え、そのブ
ロックの符号化を終了し、該ブロックの割当符号量から
送出した符号量を減じてその値を割当符号量の余りとし
て゛保持すると云った機能を有する。
The encoding abort circuit 16 adds the standard allocated code amount per block for the corresponding color component from the code amount allocation circuit 20 and the excess/deficiency of the generated code amount in the previous block to the corresponding block. At the same time, the code length of each code from the code amount allocation circuit 20 is subtracted from the allocated code amount, and the remaining allocated code amount is equal to the code amount to be sent and E
If the total code amount is smaller than the total code amount with the OB code, an abort signal is output and given to the variable length encoding circuit 8, the encoding of that block is finished, and the code amount transmitted from the allocated code amount of the block is It has the function of subtracting the value and holding that value as the remainder of the allocated code amount.

従って、符号化打切回路16ではこの割当符号= 74
− 量を参照し、入力された送出すべき符号量およびEOB
の符号を送出しても割当符号量を越えない場合は、打切
りは行われず、そのブロックの符号化を終了し、該ブロ
ックの割当符号量から送出すべき符号量を減じてその値
を割当符号量の余りとして保持すると云った動作を行う
。また、符号化打切回路16ではこの割当符号量を参照
し、入力された送出すべき直流成分の符号とEOBの符
号を送出するのに割当符号量が十分でない場合には、こ
の2つの符号を送出した後、そのブロックの符号化を終
了し、該ブロックの割当符号量から送出した符号量を減
する、すなわち、割当符号量の余りは負の値として保持
すると云った動作を行う。
Therefore, in the encoding abort circuit 16, this assigned code=74
- Referring to the amount, the input code amount to be sent and EOB
If the amount of codes to be transmitted does not exceed the allocated code amount, no truncation is performed, the encoding of that block is finished, the amount of codes to be sent is subtracted from the allocated code amount of the block, and that value is used as the allocated code. The operation is to hold the amount as a remainder. 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 transmission, the encoding of the block is finished, and the transmitted 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は符号出力回路であり、この符号出力回路10は可
変長符号化回路8より入力される可変長の符号をつなぎ
合わせるもので、この繋ぎ合わせた符号をメモリカード
等の記録媒体にて構成される記録系22に書き込むよう
に機能する。
10 is a code output circuit, and this code output circuit 10 connects the variable length codes inputted from the variable length encoding circuit 8. The code output circuit 10 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
pass), examines the amount of information for each color component and the amount of information for the entire image required for optimization, and then performs processing to perform optimized encoding based on the information obtained through this statistical processing. enter(
2nd pass).

そのため、最初に画像のブロック化、このブロック化さ
れた画像の要素に対する標準の量子化゛係数αを使用し
ての量子化、量子化により得られた変換係数の可変゛長
符号化、そして、この可変長符号化により得られる各色
成分の各要素の符号量情報と画像全体の符号量情報より
最適な符号量にするに必要な符号化係数αの予測、各色
成分の各要素における1ブロック当たりの基準割当符号
量の決定、これらに基づく処理対象画像への最適符号化
の処理モードへの移行、この処理モードの実施における
画像のブロック化処理、このブロック化された画像の要
素に対する前記予測量子化係数αを使用しての量子化処
理、この量子化により得られた変換係数の可変長符号化
、処理対象画像の全符号の保存のための出力処理と云っ
た手順を実施させるが、その全体の制御管理は図におけ
る制御回路18により行うようにしであるものとする。
To do this, we first block the image, quantize the elements of this blocked image using a standard quantization coefficient α, variable length encode the transform coefficients obtained by quantization, and then From the code amount information of each element of each color component obtained by this variable length encoding and the code amount information of the entire image, predict the coding coefficient α required to obtain the optimal code amount, per block for each element of each color component. Determining the standard allocated code amount, shifting 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, and determining the prediction quantum for the elements of this blocked image. The following steps are performed: quantization processing using the conversion 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. It is assumed that the overall control management is performed by the control circuit 18 in the figure.

尚、制御回路18のこのような碑能はマイクロプロセッ
サ(MPU)を使用することで容易に実現できる。
Incidentally, such functions of the control circuit 18 can be easily realized by using a microprocessor (MPU).

以上が符号化回路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 detachably connected to this, and the image data and quantization width (or information corresponding to this) encoded and output by the encoding circuit 80 are transferred to the recording medium via the interface circuit 70a. 71.

次に上記第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, a camera user operates a 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, a subject image or an optical image is formed on an 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内の増幅回路
60aによる増幅、A/D変換器[iobによるA/D
変換後、バッファメモリ60cに一時保持される。そし
て、この後、バッファメモリ60cから読み出され、信
号処理回路60内のプロセス回路Sodにより帯域補正
、色信号形成等の処理が行われる。
The image signal obtained by the image sensor 40b is input to a signal processing circuit 60, where it is amplified by an amplifier circuit 60a in the signal processing circuit 60, and is amplified by an A/D converter [A/D by iob].
After conversion, it is temporarily held in the buffer memory 60c. Thereafter, the signal is read out from the buffer memory 60c, and processed by the process circuit Sod in the signal processing circuit 60, such as band correction and color signal formation.

ここで、後の符号化処理がY(輝度) 、Cr。Here, the subsequent encoding process is Y (luminance), Cr.

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

プロセス回路60dにより分離された8×8のマトリッ
クスのブロック化画像信号における各色成分の画像信号
データは、符号化回路80に入力される。これにより、
1フレ一ム分(若しくは1フイ一ルド分)の画像データ
は、上記所定の大きさのブロックに分割されて順次、符
号化回路80に入力される。尚、プロセス回路60dに
より処理された各色成分の画像信号は、YSCr、 C
bの各成分別にバッファメモリに記憶させ、後の処理に
おいて、読出して使用するようにしても良い。
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 60d are YSCr, C
Each component of b 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 of the component image data is divided into blocks, which are then subjected to statistical processing at a later stage.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.

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

すると量子化回路6はこのブロック画像データ(変換係
数)に対して1パス目(第1回目)の量子化を行う。′
この第1回目の量子化では、予め設定された各周波数成
分毎(周波数成分はブロワりの各マトリックス位置に対
応じて決まる)の量子化マトリックスに対し、撮影に当
り使用者が設定した画質設定値に対応じて制御回路18
より与えられる標準(暫定)の量子化係数αを掛けた量
子化幅で、変換係数の量子化を行う(第8図(hl 。
Then, the quantization circuit 6 performs a first pass (first time) quantization on this block image data (transform coefficients). ′
In this first quantization, the image quality settings set by the user at the time of shooting are applied to the quantization matrix for each preset frequency component (frequency components are determined corresponding to each matrix position of the blower). The control circuit 18 corresponds to the value.
The transform coefficients are quantized using the quantization width multiplied by the standard (temporary) quantization coefficient α given by (Fig. 8 (hl).

j))。この時の量子化マトリックスは輝度系とクロマ
系とでそれぞれで同じであっても良いが、それぞれに適
した量子化マトリックスを設定する方が良い結果が得ら
れる。
j)). The quantization matrix at this time may be the same for 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 input quantized 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との差分値dHf−DCをハフマン符号化する(第8
図(di)、 (el))。
Since the first data in the scanning order in FIG. 7 is the DC acid component DC, the data of this DC component DC is the DC component D of the block (the previous block) that was subjected to variable length encoding immediately before.
The difference value dHf-DC with C is Huffman encoded (8th
Figures (di), (el)).

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

また、可変長符号化回路8は、ある係数以降64番目の
係数まで連続して無効係数が続く場合はブロックの終り
を示すEOB  (エンド・オブ・ブロック)の符号を
勾える。そして、その符号について発生した符号長を符
号量算出回路14に出力する(gl)。そして、1画像
分の全ブロックについてこのような処理を実行して行く
Further, the variable length encoding circuit 8 increments the sign of EOB (end of block) 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). Then, such processing is executed for all blocks of one image.

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

一方、符号量算出回路14は入力されたYsCrscb
各成分の各色成分毎に1画像全体の符号量の計算をすべ
く、Y、Cr、Cb各成分の各色成分毎の符号量の算出
と、その符号量の画像全体についての積算を行う(g2
)と共に、1つの色成分について全てのハフマン符号化
処理を終了した段階で、各色成分毎の符号量のデータを
符号量割当回路20に出力する。符号量割当回路20は
この各色成分毎の符号量のデータをブロック割当符号量
テーブルにおける該当色成分の符号量として書き込む。
On the other hand, the code amount calculation circuit 14 receives the input YsCrscb.
In order to calculate the code amount for the entire image for each color component, the code amount for each color component of Y, Cr, and Cb is calculated, and the code amount is integrated for the entire image (g2
), and when all Huffman encoding processing for one color component has been completed, the code amount data for each color component is output to the code amount allocation circuit 20. The code amount allocation circuit 20 writes the code amount data for each color component as the code amount of the corresponding color component in the block allocation code amount table.

そして、1画像分の全ブロックについてYlCr、 C
b各成分すべてのハフマン符号化処理を終了した段階で
、制御回路18の制御により符号量算出回路14は、こ
の画像全体の符号量のデータを量子化幅予測回路12に
出力すると共に、画像全体の符号量のデータを、符号量
割当回路20に出力する。
Then, for all blocks of one image, YlCr, C
When the Huffman encoding process for all components b is completed, the code amount calculation circuit 14 outputs the code amount data for the entire image to the quantization width prediction circuit 12 under the control of the control circuit 18, and The code amount data 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)).

また、符号量割当回路20は入力された各色成分毎の符
号量および画像全体の符号量と、目的総符号量とから各
色成分の1ブロック当たりの基準割当符号量を、例えば
各色成分毎の符号量の比で、目的総符号量を比例配分す
る等して算出する(第8図(h3))。
Further, the code amount allocation circuit 20 calculates the standard allocated code amount per block for each color component from the input code amount for each color component, the code amount for the entire image, and the target total code amount, for example, the code amount for each color component. It is calculated by proportionally allocating the target total code amount using the amount ratio (FIG. 8 (h3)).

具体的には、ある色成分の1ブロック当たりの基準割当
符号量を決定するには、当該色成分の符号量と目的総符
号量とを乗算し、それを画像全体の符号量で割ることで
得た結果を用いて、その色成分におけるブロック数で割
り、以てその色成分の1ブロック当たりの基準割当符号
量とする。
Specifically, to determine the standard allocated code amount per block for a certain color component, multiply the code amount of the color component by the target total code amount, and divide it by the code amount of the entire image. Using the obtained result, divide by the number of blocks in that color component, and use the result as the standard allocated code amount per block for that color component.

そして、この算出した各色成分の1ブロック当たりの基
準割当符号量のデータをブロック割当符号量データテー
ブルに格納する。このブロック割当符号量データテーブ
ルの各色成分別割当符号量のデータは、該当の色成分か
可変長符号化処理される際に符号化打切回路16に与え
られることになる。
Then, the data of the calculated standard allocated code amount per block for each color component is stored in the block allocated code amount data table. The allocated code amount data for each color component in this block allocated code amount data table is provided to the encoding abort circuit 16 when the corresponding color component 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, the second pass processing begins. This second pass process is
It is a process to obtain a final encoded output optimized to fit within the target total code amount.

この処理はまず、Y成分について行い、Y成分が終了し
た後にCr、 Cb酸成分ついて行うようにする。すな
わち、初めに画像データをブロック化して読出し、これ
1こついて抽出されて信号処理回路80から出力される
Y成分(輝度系)の画像信号データを符号化回路80に
入力する(a)。入力されたブロック化画像データは符
号化回路80における直交変換回路4に入力され、再び
直交変換が行われる(b)。この直交変換により得られ
た変換係数は量子化回路6に入力され、再び量子化が行
われる(C)。ただし、このとき使用する量子化係数α
は前回のパスにおいて量子化幅予測回路12が算出した
予測の最適量子化係数αである。
This process is first performed on the Y component, and after the Y component is completed, it is performed on the Cr and Cb acid components. That is, the image data is first read out in blocks, and the image signal data of the Y component (luminance system) extracted and output from the signal processing circuit 80 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の差分値djff−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 djff-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か
ら、そのブロック割当符号量データテーブルに格納され
ている当該要素における送出すべき1ブロック当たりの
基準割当符号量を符号化打切回路1Bに出力し、一方、
符号化打切回路16ではこの各色成分の1ブロック当た
りの基準割当符号量と前ブロックでの符号化処理におけ
る割当符号量に対する余りを加えて該当ブロックの割当
符号量とすると共に、送出すべき符号量および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 code per block to be transmitted for the element stored in the block allocation code amount data table. outputs the standard allocated code amount to the encoding abort circuit 1B, and on the other hand,
The encoding abort circuit 16 adds the standard allocated code amount per block for each color component and the remainder of the allocated code amount in the encoding process of the previous block to determine the allocated code amount for the corresponding block, and also calculates the allocated code amount for the corresponding block. If the allocated code amount is not exceeded even if the EOB code is sent out, a process is performed to reduce the code amount to be sent from the allocated code amount of the block without generating an abort signal.

そして、送出すべき該ブロックの符号量とEOBの符号
との合計の符号量が割当符号量の残りの符号量を上まわ
ったときに、符号化打切回路16は可変長符号化回路8
に打切り信号を出力し、そのブロックのハフマン符号化
を終了させると共に、該ブロックの割当符号量から送出
した符号量を減じてその値を割当符号量の余りとして保
持する。
Then, when the total code amount of the code amount of the block to be sent and the EOB code exceeds the remaining code amount of the allocated code amount, the coding abort circuit 16
An abort signal is output to terminate the Huffman encoding of that block, and at the same time, the transmitted code amount is subtracted from the allocated code amount of the block and the value is held as the remainder of the allocated code amount.

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

また、符号化打ち切り回路■6では、直流成分とEOB
の符号を送出するに割当符号量が足りない場合には、こ
れらの符号量は送出させた後、符号化打ち切り回路■6
は可変長符号化f回路8に打ち切り信号を出力し、その
ブロックのハフマン符号化を終了させると共に、該ブロ
ックの割当符号量から送出した符号量を減じて割当符号
量の余りを)の値として保持する。
In addition, in the encoding abort circuit ■6, 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 ■6.
outputs an abort signal to the variable length coding f circuit 8 to finish the Huffman encoding of the block, and subtracts the transmitted code amount from the allocated code amount of the block to obtain the remainder of the allocated code amount as the value of ). Hold.

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

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

このような動作を繰り返し、1画面の画像の全ブロック
の処理が終わることにより、全ての符号化処理を終了す
る。Y成分に対するこのような処理が終ると、次に同様
の手法でクロマ系成分(Cr、 Cb)の処理に入る。
By repeating such operations and completing processing of all blocks of one screen image, all encoding processing is completed. Once the Y component has been processed in this way, the chroma components (Cr, Cb) are processed in a similar manner.

クロマ系成分の処理でも量子化回路6は前回のパスにお
いて量子化幅予測回路12が算出した予測の最適量子化
係数αを使用する。
Even in processing the chroma component, the quantization circuit 6 uses the predicted optimal quantization coefficient α calculated by the quantization width prediction circuit 12 in the previous pass.

クロマ系成分について、1画面分の画像の全ブロックの
上記2パス目の処理が終わることにより、全ての符号化
処理を終了する。
As for the chroma components, all encoding processing ends when the second pass processing of all blocks of one screen worth of images is completed.

この終了にあたり、符号出力回路10では最適化された
1画像分のハフマン符号化データを記録系22に出力し
、記録系22におけるメモリカードと云った記憶媒体7
1に書き込む(f)。これは、符号出力回路10の出力
により行われるが、符号出力回路10は可変長符号化回
路8からの可変長符号であるハフマン符号をつなぎ合わ
せ、記憶媒体71であるメモリカードに与えることで書
き込む。この符号出力回路10の出力による記憶媒体7
1への書き込みは、第2パスが終わった段階でまとめて
行うようにしても良いが、第1パスが終って第2パス実
行に入った段階で可変長のハフマン符号をつなぎ合わせ
た結果が、1バイト若しくは数バイト単位、まとまり次
第、順次、記憶媒体へ書き込むようにしても良い。
Upon completion 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 card in the recording system 22.
Write to 1 (f). This is performed by the output of the code output circuit 10, and 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 by giving it to a memory card, which is a storage medium 71. . A storage medium 7 based on the output of this code output circuit 10
Writing to 1 may be done all at once after the second pass is completed, but when the first pass is completed and the second pass is executed, the result of connecting variable-length Huffman codes is , the data may be written to the storage medium sequentially in units of one byte or several bytes as soon as they are collected.

尚、これに先立ち、符号出力回路10では符号化に使用
した最適量子化係数αを当該符号化した画像の記憶デー
タにおけるヘッダ部分に書き込み、再生時の手掛かりと
して残す。
Note that, prior to this, the code output circuit 10 writes the optimal quantization coefficient α used for encoding into the header portion of the stored data of the encoded image, and leaves it as a clue during reproduction.

以上、本装置においては、撮影可能枚数に応じて定まる
記録画像−枚当たりの総符号量(目的総符号量)に対応
じて1ブロツ?当たりの基準割当符号量を定め、これに
当該ブロックの前のブロックでの割当符号量に対する発
生符号量の過不足性を調整して当該ブロックの割当符号
量とし、これを利用して各ブロックの発生符号量を制御
することにより、画像全体の発生符号量が目的総符号量
を越えないようにしたものであり、この点か本発明の重
要なポイントとなっている。
As described above, in this device, the number of recorded images determined according to the number of recordable images - the total code amount per image (target total code amount) is 1 block? Determine the standard allocated code amount for each block, adjust the surplus or deficiency of the generated code amount with respect to the allocated code amount in the block before the block, and use this to determine the allocated code amount for each block. By controlling the generated code amount, the generated code amount for the entire image is prevented from exceeding the target total code amount, and this 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.

但し、統計処理を実施して量子化幅を最適化することに
より、本発明の効果は特に顕著となり、また、処理時間
と、得られる効果の面から考えて、−9〇  − 統計処理を一回実施するのが最も得策である。また、統
計処理において、色成分毎の総符号量を得て、これを利
用して1ブロック当たりの符号量を決定するのではなく
、経験的に各色成分毎に符号量を重み付けしても良く、
また、各色成分毎の重み付けはせずに、1ブロック当た
りの符号量は同一でも良く、統計処理における統計量は
1ブロック当たりの基準割当符号量の決定には必ずしも
必要ではない。また統計処理は暫定的な量子化幅で、実
際に符号化を行って符号量を求めるものに限られるもの
ではなく、例えば、アクティビティを計算することによ
り、求めるものであっても良い。
However, by performing statistical processing and optimizing the quantization width, the effect of the present invention becomes particularly remarkable. It is best to carry out the test twice. In addition, in statistical processing, instead of obtaining the total code amount for each color component and using this to determine the code amount per block, the code amount may be weighted empirically for each color component. ,
Furthermore, the amount of code per block may be the same without weighting for each color component, and the amount of statistics in statistical processing is not necessarily necessary for determining the reference amount of allocated code per block. Further, statistical processing is not limited to calculating the code amount by actually performing encoding using a provisional quantization width, but may also be calculated by calculating activity, for example.

また、各色成分内での1ブロック当たりの割当符号量は
必ずしも均一である必要は無く、画像に対するブロック
位置で重み付け、例えば、画像の中心部のブロックには
周辺のブロックよりも多くの符号量を割り当てるように
しても良い。また、本実施例内でも示したように、目的
総符号量を全て1ブロック当たりの基準割当符号量に割
り振る必要は必すしもなく、例えば、目的の符号量を1
ブロック当たりの基準割当符号量に割り当てたときに割
り切れなかった余りを、最初のブロックに対し、前ブロ
ックまでの過不足分として与える等しても良い。
In addition, the amount of code allocated per block within each color component does not necessarily have to be uniform, but is weighted based on the block position relative to the image. For example, a block in the center of the image is assigned a larger amount of code than surrounding blocks. You may also assign it. Furthermore, as shown in this embodiment, it is not necessary to allocate the entire target total code amount to the standard allocated code amount per block; for example, the target code amount is
The remainder that cannot be divided evenly when allocated to the standard allocated code amount per block may be given to the first block as an excess or deficiency up to the previous block.

また、圧縮率は可変でなくとも良く、一種類の圧縮率に
固定であり、目的総符号量、量子化幅、1ブロック当た
りの基準割当符号量などが全て、固定値として与えられ
ても良く、このようにした場合にはその構成はより簡単
になる。また、画像データバッファメモリは直交変換回
路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 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. Encoding can be performed with high compression while minimizing deterioration.

以上、詳述した第1図および第2図の構成の本発明は、
要するに、目的総符号量から予め決定した1ブロック当
たりの基準割当符号量とそのブロックの前のブロックで
の発生符号量の、割当符号量に対するの過不足分とを加
えた割当符号量に、符号量が収まるように、ブロック毎
に符号量を監視しながら、符号化を進め、符号量が割当
符号量に達すると、そのブロックの符号化は終了させる
が、直流成分は割当符号量を越える場合でも必ず符号化
させ、そのときの割当符号量の過不足を記憶しておき、
次のブロックの符号化に移ってゆくというものである。
The present invention having the configuration shown in FIGS. 1 and 2 described above has the following features:
In short, the allocated code amount is the sum of the predetermined standard allocated code amount per block based on the target total code amount 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 amount of code remains within the allocated code amount, and when the code amount reaches the allocated code amount, the encoding of that block is terminated, but if the DC component exceeds the allocated code amount. However, be sure to encode it, and remember the excess or deficiency of the allocated code amount at that time.
The process moves on to encoding the next block.

これは、画像の各ブロックに、  おける発生符号量は
各々異なる、つまり、局所的な符号量の片寄りはあるが
、数ブロックあるいは数十ブロックのかたまりをマイク
ロブロック(8×8マトリツクスのいくつかのかたまり
)としてとらえることにすると、このマイクロブロッり
毎の発生符号量は比較的片寄りが少ないことに着目した
ものである。
This means that the amount of code generated in each block of an image is different, that is, the amount of code generated is locally uneven, but a group of several blocks or tens of blocks can be divided into microblocks (some of the 8x8 matrices). This study focuses on the fact that when viewed as a block, the amount of code generated for each microblock is relatively uneven.

よって、ブロック毎の符号量を適応的に割り当てずに、
ブロック当たりの割当符号量の割り当て方を固定してお
き、目的とする符号量を、その割り当て方に従って配分
してブロック当たりの基準割当符号量を決定しても、発
生符号量の割当符号量に対する余剰分を、以降のブロッ
クの割当符号量へと繰り越すことにより、各ブロックの
発生符号量の変化jこ適応させながらも、マイクロブロ
ックでは発生符号量を制御していることになる。
Therefore, without adaptively allocating the amount of code for each block,
Even if the method of allocating the amount of allocated code per block is fixed and the standard amount of allocated code per block is determined by allocating the target amount of code according to that allocation method, By carrying over the surplus to the allocated code amount of subsequent blocks, the generated code amount is controlled in the microblock while adapting to changes in the generated code amount of each block.

ブロック毎の割当符号量を画像毎に適応的に割り当てよ
うとすると、画像毎に各ブロック毎の統計量などを求め
る作業と、この結果、得られる各ブロック毎の基準割当
符号量を記憶しておくメモリが必要となるが、本方式で
はこれらか不要になると共に、圧縮率が変わっても、同
じノ\−ドウエアで対処でき、従って、目的圧縮重刷(
符号量刑)のハードウェアを用意する必要がないから、
応用する装置のコストダウンと小形化が図れる。
When trying to adaptively allocate the allocated code amount for each block for each image, it is necessary to calculate the statistics for each block for each image, and as a result, to memorize the standard allocated code amount for each block. However, this method eliminates the need for these, and even if the compression ratio changes, it can be handled with the same hardware. Therefore, the desired compression overprinting (
There is no need to prepare hardware for
It is possible to reduce the cost and size of the equipment to which it is applied.

さらにブロックの割当符号量は基準割当符号量に前ブロ
ックでの過不足分を加えて決め、これを基準に符号化を
制御するので、処理が単純化でき、従って、処理時間を
短くすることができる。
Furthermore, the allocated code amount for a block is determined by adding the surplus or deficiency in the previous block to the standard allocated code amount, and encoding is controlled based on this, which simplifies processing and reduces processing time. can.

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

第3図においては符号化回路80の処理の流れをわかり
易くするために、第1パスでの信号の流れを点線の矢印
■で、また、第2パスでの信号の流れを実線の矢印■で
それぞれ図示しである。この信号の流れに沿ってざっと
動作を追ってみると次のようになる。
In FIG. 3, in order to make it easier to understand the process flow of the encoding circuit 80, the signal flow in the first pass is indicated by a dotted arrow ■, and the signal flow in the second pass 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.

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

これはスイッチ30の操作により、使用者が所望の撮影
可能枚数を設定することにより、この設定した撮影可能
枚数に応じて制御回路90が最適符号量を選択し、これ
を目的総符号量の情報として符号化回路80に与えるこ
とで実現している。
The user sets the desired number of shots that can be taken by operating the switch 30, and the control circuit 90 selects the optimum code amount according to the set number of shots that can be taken. 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内においてディジタル信号に変換され
、バッファメモリに記憶された後、8×8画素のブロッ
ク単位で読み出され、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 8 x 8 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 Co
5jne Transform)が行われる。
This separation is first performed on the Y component, and the Y component image data output in blocks of 8 x 8 pixels is input to the orthogonal transformation circuit 4, and orthogonal transformation is performed for each block (in this example, DCT, discrete cosine Conversion (Discrete Co
5jne Transform) is performed.

直交変換回路4で得られたDCT変換係数は量子化回路
6に入力され、一方、制御回路18から目的総符号量が
量子化幅予測回路12に出力され、量子化幅予測回路1
2では目的総符号量から式(1)の関係を用いて量子化
係数αの初期値を設定し、量子化回路6に出力する。量
子化回路6では、入力された量子化係数αを用いて、変
換係数を線形量子化する。量子化された変換係数は可変
長符号化回路8に入力され、可変長符号化(本例ではハ
フマン符号化)が行われる。
The DCT transform coefficients obtained by the orthogonal transform circuit 4 are input to the quantization circuit 6, while the target total code amount is output from the control circuit 18 to the quantization width prediction circuit 12.
In step 2, the initial value of the quantization coefficient α 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 input quantization coefficient α. The quantized transform coefficients are input to a variable length encoding circuit 8, and variable length encoding (Huffman encoding in this example) 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
の符号を出力する。可変長符号化回路8は、以上のよう
な符号化が行われ、1つの符号が発生する毎に、その符
号長を符号量算出回路14に出力する。
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 that is not 0 (that is, valid) comes out, it is the consecutive 0 (zero) that existed immediately before it. Two-dimensional Huffman encoding is performed using the number of invalid coefficients (zero run) and the values of their valid coefficients. Also, if invalid output continues after a certain coefficient up to the 64th coefficient, EOB indicating the end of the block will be displayed.
Outputs the sign of . The variable length encoding circuit 8 performs the above encoding and outputs the code length to the code amount calculation circuit 14 each time one code is generated.

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

Y成分についてのこのような処理が終了すると、次にC
r成分、モしてcb酸成分ついても同様の処理を行う。
After completing this processing for the Y component, next
The same treatment is applied to the r component and the cb acid component.

一画像について、符号化が終了すると、符号量算出回路
14は累積した色成分毎の符号量を加算して画像全体の
符号量を総符号量値として算出する。この総符号量値は
量子化幅予測回路12に出力され、また、各色成分毎の
符号量及び°画像全体の符号量割当回路20に出力され
る。
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 output to the quantization width prediction circuit 12, and is also output to the code amount allocation circuit 20 for the code amount for each color component and the entire image.

以上の第1パスの符号化処理が終了すると、量子化幅予
測回路12では第1パスでの符号化により求められた絵
画像符号量と、制御回路18から与えられた目的符号量
とから、より適した量子化係数αを予fll’jl、、
ft子化回路6に出力する。また、符号量割当回路20
は符号量算出回路14から入力された各色成分毎の符号
量、画像全体の符号量と、目的符号量およびブロック数
から、各色成分毎の1ブロック当たりの割当符号量を算
出する。
When the first pass encoding process is completed, the quantization width prediction circuit 12 uses the picture image code amount obtained by the first pass encoding and the target code amount given from the control circuit 18. A more suitable quantization coefficient α is preset as full'jl, ,
It is output to the ft child conversion circuit 6. In addition, the code amount allocation circuit 20
calculates the allocated code amount per block for each color component 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.

続いて同じ画像データに対して第2パスの符号化処理が
行われる。第2パスでは信号処理回路60内のメモリか
ら読み出された画像データは、最初にY成分、次にCr
成分、次にcb酸成分分離され、それぞれの成分の画像
データは8×8画素のブロック化等の処理が行われた後
、直交変換回路4に入力され、ブロック毎に直交変換(
DCT変換)され、これにより、直交変換回路4で得ら
れたDCT変換係数は量子化回路6に入力される。
Subsequently, a second pass of encoding processing is performed on the same image data. In the second pass, the image data read out from the memory in the signal processing circuit 60 is first the Y component, then the Cr component.
The image data of each component is separated into 8x8 pixel blocks, etc., and then input to the orthogonal transformation circuit 4, where each block is subjected to orthogonal transformation (
DCT transform), whereby the DCT transform coefficients obtained by the orthogonal transform circuit 4 are input to the quantization circuit 6.

量子化回路6においては、与えられたこの予測による新
たな量子化係数αによる補正済み量子化幅を用いて、D
CT変換係数を線形量子化する。
In the quantization circuit 6, D
Linearly quantize the CT transform coefficients.

量子化された係数は可変長符号化回路8に入力され、第
1パスの符号化時と同様の方式でハフマン符号化される
。ここで符号化時に発生した符号量は第1パスの終了時
に求められ、符号量割当回路20に記憶されている1ブ
ロック当たりの割当符号量と、前ブロックでの割当符号
量の過不足とを加えた当該ブロックの割当符号量との比
較が行われ、これを越えた場合には符号打切回路16の
働きにより、そのブロック内でそれ以降の符号化が打ち
切られる。また、当該ブロックの符号化を終了した時点
での割当符号量の過不足は、符号量割当回路20に記憶
される。
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 allocated code amount per 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. Furthermore, the excess or 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.

以上の方法により目的総符号量に制御された符号化デー
タは順次、符号出力回路10を経由して記録系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にて記録された記録媒体7■の圧縮符号
化記録画像データの再生について説明する。
Next, the reproduction of compressed and encoded recorded image data recorded on the recording medium 72 by the recording system 70 will be explained.

第4図に再生機の構成を示す。図において、100は再
生機本体であり、この再生機本体100は読取部102
、復号化回路104および処理回路106および制御回
路108を備える。読取部102は記憶媒体71を着脱
でき、記憶媒体71の内容をインタフェース回路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 106, and a control circuit 108. The reading unit 102 can attach and detach the storage medium 71, and transfers the contents of the storage medium 71 to the interface circuit 110.
It is read out via .

復号化回路104は第5図のような機能ブロックを有す
る。すなわち、112はハフマン符号化データを復号化
するパフマン復号部、114はコノハフマン復号されて
得られたデータを、記憶媒体71から読み出されて設定
人力された量子化幅の情報に基づいて逆量子化する逆量
子化部、116はこの逆量子化されて得られたデータを
逆DCT変換して映像信号データとして出力するIDc
T (逆DCT変換)部、そして、118はこれらの制
御を司る制御部である。
The decoding circuit 104 has functional blocks as shown in FIG. That is, 112 is a Puffman decoding unit that decodes Huffman encoded data, and 114 is an inverse quantization unit that reads the data obtained by Konohuffman decoding from the storage medium 71 and performs inverse quantization based on the information on the quantization width that has been manually set. The inverse quantization unit 116 performs inverse DCT transformation on the data obtained by inverse quantization and outputs it as video signal data.
T (inverse DCT transformation) unit, and 118 is a control unit that controls 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全体の制−1,
01− 御を司るものであり、再生機本体100の読取部102
に対し、符号化時の量子化幅の情報を読み出すべく制御
して、その結果、記録媒体71から読み出された符号化
時の量子化幅の情報を復号化回路104の逆量子化部1
14に設定させ、続いて制御回路108は記録媒体71
から圧縮符号化された映像信号データを読出すべく、読
取部102を制御すると云った制御を行う。また、図示
しないが再生機本体100には、コマ送りスイッチ等が
あり、このスイッチにより指定されたコマ位置の映像を
再生したりすることができる。このような制御も制御回
路108が行、う。
The control circuit 108 controls the entire playback machine body 100.
01- The reading unit 102 of the main body 100 of the playback machine
, the information on the quantization width at the time of encoding is controlled to be read out, and as a result, the information on the quantization width at the time of encoding read out from the recording medium 71 is transferred to the inverse quantization unit 1 of the decoding circuit 104.
14, and then the control circuit 108 sets the recording medium 71 to
Control is performed such as controlling the reading unit 102 in order to read the compression-encoded video signal data from the . 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 108.

次に上記構成の再生機の動作を説明する。圧縮符号化さ
れた映像信号データが記録された記録媒体(メモリカー
ド)71が再生機本体100の読取部102に装着され
ると、ます、制御回路108は読取部102に対し、符
号化時の量子化幅の情報を読み出すべく制御する。その
結果、読取部102において記録媒体71から符号化時
の量子化幅の情報が読み出され、この情報は復号化回路
104の速量子化部114に設定される。続いて制御回
路108は記録媒体71から映像信号を読出すべく、読
取部102を制御するので、読取部102は記録媒体7
1から映像信号を順次読み出し、復号化回路104に入
力する。これを受けた復号化回路104では、ハフマン
復号部112においてハフマン符号を復号し、量子化係
数を得る。こうして得られた量子化係数は逆量子化回路
114に与えて逆量子化する。ここでの逆量子化は先に
設定されている前記量子化幅の情報を用いて行われる。
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 inserted into the reading section 102 of the main body 100 of the playback device, the control circuit 108 immediately instructs the reading section 102 to read the data at the time of encoding. Control is performed to read out quantization width information. As a result, information on the quantization width at the time of encoding is read from the recording medium 71 in the reading section 102, and this information is set in the fast quantization section 114 of the decoding circuit 104. Subsequently, the control circuit 108 controls the reading unit 102 to read the video signal from the recording medium 71, so that the reading unit 102 reads the video signal from the recording medium 71.
The video signals are sequentially read out from 1 and input to the decoding circuit 104. In the decoding circuit 104 that receives this, the Huffman code is decoded in the Huffman decoding unit 112 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.

逆量子化により得られた変換係数は、l DCT部11
6においてブロック毎に逆OCT変換され、元の映像信
号に復元される。このようにしてY、Cr。
The transform coefficients obtained by inverse quantization are transferred to l DCT unit 11
6, each block is subjected to inverse OCT transformation and restored to the original video signal. In this way, Y, Cr.

Cbの順で映像信号が復元されて復号化回路104から
出力され、処理回路10B内のバッファメモリ120に
書き込まれる。1画面の映像信号データの書き込みが終
了すると、バッファメモリ12(lから通常のテレビ信
号の走査順で映像信号データが読み出され、エンコーダ
122においてNTSC方式の映像信号に変換される。
The video signals are restored in the order of Cb, output from the decoding circuit 104, and written into the buffer memory 120 in the processing circuit 10B. When writing of the video signal data for one screen is completed, the video signal data is read out from the buffer memory 12 (l) in the normal scanning order of the television signal, and is converted into an NTSC video signal by the encoder 122.

更にD/A変換器124によりアナログ信号に変換され
、出力される。この映像信号をテレビモニタに入力する
ことにより、画像がテレビ映像として再生され、映像と
して鑑賞でき、また、ビデオプリンタ等のプリント装置
に与えてプリントすることにより、ハードコピーが得ら
れるので、写真等と同様な形で鑑賞することがきるよう
になる。
Furthermore, it is converted into an analog signal by the D/A 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画面
分の撮影画像データを量子化し、可変長符号化し、その
結果得られるその1画面分の撮影画像データの符号量よ
り最適量子化幅を予11111し、この予測した最適量
子化幅により前記1画面分の撮影画像データを量子化し
、可変長符号化するようにし、符号化された映像信号の
再生時には撮影時に使用した前記最適量子化幅を用いて
復号することにより、所望の圧縮率での符号化を圧縮率
別にハードウェアを設けること= 104〜 なく、共通の一つのハードウェアで実現でき、同様に所
望の圧縮率で符号化された画像データの復号化を圧縮率
別にハードウェアを設けることなく、共通の一つのハー
ドウェアで実現できる。
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 corresponding compression rate, and also temporarily sets the compression rate according to this set compression rate. Using a quantization width, one screen worth of captured image data is quantized and variable length coded, and the optimum quantization width is predetermined from the code amount of the one screen worth of captured image data obtained as a result. The captured image data for one screen is quantized using the predicted optimal quantization width, and variable length coded, and when the encoded video signal is played back, it is decoded using the optimal quantization width used at the time of shooting. By doing so, encoding at a desired compression rate can be realized with one common hardware without having to provide hardware for each compression rate, and decoding of image data encoded at a similar desired compression rate can be achieved. This can be achieved using a single common piece of hardware, without having to provide hardware for each compression ratio.

尚、実施例では符号化の過程が第1パス、第2パスの2
回の処理で終了する2バス方式としたが、これに限るも
のではなく、圧縮率から設定した量子化幅を用いて1回
のパスで符号化する方式でも実用上、十分な画像が得ら
れるし、第1パスを更に何度か繰り返しても、さらに良
好な結果が得られる。
In the embodiment, the encoding process consists of two passes: the first pass and the second pass.
Although we used a two-bus method that completes the process in one pass, the method is not limited to this, and a method that encodes in one pass using the quantization width set based on the compression rate can also obtain a practically sufficient image. However, even better results can be obtained by repeating the first pass several more times.

また、記録媒体にメモリカードを用いた例を示したが、
その他、フロッピディスク、光ディスク、磁気テープ等
を利用することもできる。また、カメラと再生機が別体
となっているものを示したが、カメラが再生機の機能を
合せ持つ一体型のものでもよい。さらにまた、実施例で
は量子化幅の値そのものを記録媒体に記録するようにし
たが、量子化幅値を変換あるいは符号化して記録するよ
うにしても良い。
Also, although we have shown an example using a memory card as the recording medium,
In addition, floppy disks, optical disks, magnetic tapes, etc. can 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.

以上の実施例では目的総符号量から量子化幅を設定して
いたが、複数の目的総符号量をモードで切換えて使用す
るようなアプリケーションにおいては、それぞれのモー
ドに対応する量子化幅および1ブロック当たりの割当符
号量を予め用意しておき、これをモードで切り換えて使
用するようにしても勿論差支えない。
In the above embodiments, the quantization width was set based on the target total code amount, but in applications where multiple target total code amounts are switched and used by mode, the quantization width and 1 Of course, it is also possible to prepare the allocated code amount per block 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.

また、上記実施例では圧縮率対応情報より総符号量の情
報を与え、この総符号量に対応した量子化幅を与えるこ
とのできる量子化係数の予測を行い、この予測された量
子化係数に基づく量子化幅で量子化を行うようにしてい
るが、予め圧縮率対応情報に対する量子化幅の関係を計
算で求めてテーブル化しておき、これをメモリ等に記憶
して、圧縮率対応情報から直接、量子化幅の情報(すな
わち、量子化係数或いは量子化幅の値)を出力させるよ
うにすることもできる。このようにすれば、所望の圧縮
率に対応する情報を入力すると、この入力された圧縮率
対応情報に対応じて一義的に定まる量子化幅の情報を読
出して出力でき、即座に最適量子化幅を設定できて直ち
に量子化回路にこの量子化幅で画像信号データを量子化
させることができるようになる。1ブロック当たりの基
準割当符号量についても同様である。
In addition, in the above embodiment, information on the total code amount 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 the predicted quantization coefficient is Quantization is performed using the 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 a memory etc., and it is calculated from the compression rate correspondence information. It is also possible to directly output quantization width information (ie, quantization coefficient or 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 optimal quantization can be performed immediately. Immediately after setting the width, the quantization circuit can quantize the image signal data using this quantization width. The same applies to the standard allocated code amount per block.

この構成によれば、メモリ等に各種の圧縮率に対応した
最適量子化幅の情報と1ブロック当たりの基準割当符号
量を予め記憶させて、これを入力圧縮率対応情報に対応
じて読出すだけで最適量子化幅と1ブロック当たりの基
準割当符号量の情報を与えることができるので、目的総
符号量に収まるよう符号化するに当り、その処理を極め
て短時間で行える他、ハードウェアも簡単で済むように
なる。
According to this configuration, the information on the optimal quantization width corresponding to various compression rates and the standard allocated code amount per block are stored in advance in a memory, etc., and this is read out in accordance with the input compression rate correspondence information. Since information on the optimal quantization width and standard allocated code amount per block can be provided by just using It becomes easy.

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

以上詳述したように、本発明によれば、大規模なハード
ウェアを必要とせずに、符号量の制御が行えると共に、
短時間で符号化処理が行えるので、ハードウェアのコス
トダウンと小形化を図ることができる等、電子カメラシ
ステム等に最適な画像データの符号化装置および符号化
方法を提供できる。
As described in detail above, according to the present invention, the amount of code can be controlled without the need for large-scale hardware, and
Since the encoding process can be performed in a short time, it is possible to reduce the cost and size of hardware, thereby providing an image data encoding apparatus and encoding method that are optimal for electronic camera systems and the like.

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

第1図は本発明の第1の実施例を示すブロック図、第2
図は本発明装置の要部構成例を示すブロック図、第3図
は第2図回路の動作の流れを説明するためのブロック図
、第4図および第5図は再生機の構成を示すブロック図
、第6図は本発明による電子カメラ本体の外観を示す斜
視図、第7図は8×8画素に分けられたブロックのジグ
ザグ・スキャンを説明するための図、第8図は本発明の
原理的な作用を説明するための動作遷移図、第9図は従
来技術を説明するための動作遷移図である。 1・・・電子カメラ本体、6・・・量子化回路、8・・
・可変長符号化回路、10・・・符号出力回路、12・
・・量子化幅予測回路、14・・・符号量算出回路、1
6・・・符号化打−10,8− 切回路、18.18a・・・制御回路、20・・・符号
量割当回路、24・・・DCPM回路、30・・・スイ
ッチ、40・・・撮像系、48・・・LCD表示器、6
0・・・信号処理回路、80・・・符号化回路、70・
・・記録系、71・・・記録媒体、90・・・制御回路
、100・・・再生機本体、102・・・読取部、10
4・・・復号化回路、106・・・処理回路、108・
・・制御回路、110・・インタフェース回路、112
・・・ハフマン復号部、114・・・逆量子化部、11
6・・・IDCT (逆DCT変換)部、+18・・・
制御部。 出願人代理人 弁理士 坪井  淳 ぐ ヨ 枢集く隻 l!9図 (h)
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 zigzag scanning of a block divided into 8×8 pixels, and FIG. 8 is a perspective view showing the appearance of the electronic camera body according to the present invention. FIG. 9 is an operation transition diagram for explaining the principle operation. FIG. 9 is an operation transition diagram for explaining the conventional technique. 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, 1
6... Encoding input-10, 8- cut circuit, 18.18a... Control circuit, 20... Code amount allocation circuit, 24... DCPM circuit, 30... Switch, 40... Imaging system, 48... LCD display, 6
0... Signal processing circuit, 80... Encoding circuit, 70...
... Recording system, 71 ... Recording medium, 90 ... Control circuit, 100 ... Playback main body, 102 ... Reading section, 10
4...Decoding circuit, 106...Processing circuit, 108.
...Control circuit, 110...Interface circuit, 112
... Huffman decoding section, 114... Inverse quantization section, 11
6...IDCT (inverse DCT conversion) section, +18...
control section. Applicant's representative Patent attorney Atsushi Tsuboi Figure 9 (h)

Claims (8)

【特許請求の範囲】[Claims] (1)画像データをブロックに分割し、この分割された
各ブロックは順にそれぞれ直交変換を行ってこの変換出
力を量子化手段により量子化し、この量子化出力を可変
長符号化手段に与えて可変長符号化し、各ブロック毎に
データの符号化をする符号化装置において、前記ブロッ
クの符号化にあたり、当該符号化処理するブロックでの
符号化処理により発生した符号量と当該ブロックでの割
当符号量とに基づいてこの発生符号量の前記割当符号量
に対する過不足量を算出すると共に、画像当りの許され
る符号量である目的の総符号量に応じて予め決定した1
ブロック当たりの基準符号量に前記算出した過不足量を
加えた符号量を次に処理するブロックの前記割当符号量
として求める符号量割当手段と、各ブロック毎に前記符
号量割当手段により割り当てられた割当符号量を越えな
いように、前記可変長符号化を打ち切るべく前記可変長
符号化手段を制御する打切手段と を備えたことを特徴とする画像データの符号化装置。
(1) Divide the image data into blocks, perform orthogonal transformation on each divided block in turn, quantize the transform output with a quantization means, and give the quantized output to a variable length encoding means to make it variable. In an encoding device that performs long encoding and encodes data for each block, when encoding the block, the amount of code generated by the encoding process in the block to be encoded and the amount of code allocated in the block. The amount of excess or deficiency of the generated code amount with respect to the allocated code amount is calculated based on the above, and the amount of excess or deficiency of this generated code amount with respect to the allocated code amount is calculated in advance.
code amount allocation means that calculates the code amount obtained by adding the calculated surplus/deficiency amount to the reference code amount per block as the allocated code amount of the next block to be processed; An apparatus for encoding image data, comprising: a termination means for controlling the variable length encoding means to terminate the variable length encoding so as not to exceed an allocated code amount.
(2)画像データをブロックに分割し、この分割された
各ブロックは順にそれぞれ直交変換を行ってこの変換出
力を量子化手段により量子化し、この量子化出力を可変
長符号化手段に与えて可変長符号化し、各ブロック毎に
データの符号化をする符号化装置において、圧縮率を指
定する圧縮率指定手段と、 この圧縮率指定手段にて指定された圧縮率に応じて画面
あたりの許される目的総符号量および量子化幅および1
ブロック当たりの基準割当符号量とを決定する圧縮率選
択手段と、前記ブロックの符号化にあたり、当該符号化
処理するブロックでの符号化処理により発生した符号量
と当該ブロックでの割当符号量とに基づいてこの発生符
号量の前記割当符号量に対する過不足量を算出すると共
に、前記圧縮率選択手段により決定された1ブロック当
たりの基準符号量に前記算出した過不足量を加えた符号
量を次に処理するブロックの前記割当符号量として求め
る符号量割当手段と、 各ブロック毎に前記符号量割当手段により割り当てられ
た割当符号量を越えないように前記可変長符号化を打ち
切るべく前記可変長符号化手段を制御する打切手段と、 前記可変長符号化手段により可変長符号化された変換係
数を符号として出力する符号化出力手段と、 前記量子化手段に対し、前記圧縮率選択手段により決定
された前記量子化幅を用いて量子化を行わせるべく制御
する制御手段と を備えたことを特徴とする画像データの符号化装置。
(2) Divide the image data into blocks, perform orthogonal transformation on each divided block in turn, quantize the transform output with a quantization means, and give the quantized output to a variable length encoding means to perform variable length encoding. In an encoding device that performs long encoding and encodes data for each block, there is a compression rate specifying means for specifying a compression rate, and an allowable amount per screen according to the compression rate specified by this compression rate specifying means. Target total code amount, quantization width, and 1
a compression rate selection means for determining a standard allocated code amount per block; and a compression rate selection means for determining a standard allocated code amount per block; Based on this, the excess or deficiency of the generated code amount with respect to the allocated code amount is calculated, and the code amount obtained by adding the calculated excess or deficiency amount to the reference code amount per block determined by the compression rate selection means is calculated as follows. code amount allocation means for determining the allocated code amount of the block to be processed; and the variable length code for terminating the variable length encoding so as not to exceed the allocated code amount allocated by the code amount allocation means for each block. terminating means for controlling the quantization means; encoding output means for outputting the transform coefficients variable-length encoded by the variable-length encoding means as a code; and a control means for controlling quantization using the quantization width.
(3)画像データをブロックに分割し、この分割された
各ブロックは順にそれぞれ直交変換を行って低い周波数
成分から順に高い周波数成分へと前記ブロック毎の画像
データを成分分解し、この変換出力を量子化手段により
量子化し、この量子化出力を可変長符号化手段に与えて
可変長符号化し、各ブロック毎にデータの符号化をする
符号化装置において、前記ブロックの符号化にあたり、
当該符号化処理するブロックでの符号化処理により発生
した符号量と当該ブロックでの割当符号量とに基づいて
この発生符号量の前記割当符号量に対する過不足量を算
出すると共に、画像当りの許される符号量である目的の
総符号量に応じて予め決定した1ブロック当たりの基準
符号量に前記算出した過不足量を加えた符号量を次に処
理するブロックの前記割当符号量として求める符号量割
当手段と、各ブロック毎に前記符号量割当手段により割
り当てられた割当符号量を越えないように、前記可変長
符号化を打ち切るべく前記可変長符号化手段を制御する
打ち切り手段と、 前記量子化手段に対し、予め定めた量子化幅を用いて量
子化を行わせるべく制御する制御手段とを備え、 前記可変長符号化手段には前記直交変換により得られる
前記各ブロック単位の画像データのうち、直流成分につ
いては手前の符号化処理ブロックでの直流成分との差分
を得ると共にこの差分を可変長符号化する直流成分用の
符号化処理部と、この直流成分の符号化処理部の処理が
終った後、前記交流成分について可変長符号化する交流
成分用の符号化処理部とを設け、前記符号化打ち切り手
段は交流成分用の符号化処理部に対してのみ打ち切り制
御を可能にする構成とすることを特徴とする画像データ
の符号化装置。
(3) Divide the image data into blocks, perform orthogonal transformation on each divided block in order, decompose the image data for each block into components from low frequency components to high frequency components, and use this transformation output as In an encoding device that performs quantization by a quantization means, supplies this quantized output to a variable length encoding means to perform variable length encoding, and encodes data for each block, upon encoding the block,
Based on the code amount generated by the encoding process in the block to be encoded and the allocated code amount in the block, the excess or deficiency of the generated code amount with respect to the allocated code amount is calculated, and the allowance per image is calculated. The code amount obtained by adding the calculated surplus/deficiency amount to the reference code amount per block predetermined according to the target total code amount, which is the code amount to be processed, is the code amount obtained as the allocated code amount of the next block to be processed. an allocation means; an abort means for controlling the variable length encoding means to abort the variable length encoding so as not to exceed the allocated code amount allocated by the code amount allocation means for each block; and the quantization. control means for controlling the means to perform quantization using a predetermined quantization width; As for the DC component, there is a DC component encoding processing unit that obtains the difference between the DC component and the previous encoding processing block and variable-length encoding this difference, and a processing of this DC component encoding processing unit. and an AC component encoding processing unit that performs variable length encoding on the AC component after the AC component is finished, and the encoding aborting means is configured to enable abort control only for the AC component encoding processing unit. An image data encoding device characterized by:
(4)画像データをブロックに分割し、この分割された
各ブロックは順にそれぞれ直交変換を行って低い周波数
成分から順に高い周波数成分へと前記ブロック毎の画像
データを成分分解し、この変換出力を量子化手段により
量子化し、この量子化出力を可変長符号化手段に与えて
可変長符号化し、各ブロック毎にデータの符号化をする
符号化装置において、前記可変長符号化手段により符号
化された画像全体の変換係数の符号量を算出する符号量
算出手段と、 この符号量算出手段により算出された画像全体の符号量
と、画面あたりの許される目的総符号量とから最適な量
子化幅を予測すると共に、前記量子化手段にこの予測量
子化幅を与える量子化幅予測手段と、 前記ブロックの符号化にあたり、当該符号化処理するブ
ロックでの符号化処理により発生した符号量と当該ブロ
ックでの割当符号量とに基づいてこの発生符号量の前記
割当符号量に対する過不足量を算出すると共に、前記目
的総符号量に基づき決定された1ブロック当たりの基準
符号量に前記算出した過不足量を加えた符号量を次に処
理するブロックの前記割当符号量として求める符号量割
当手段と、 各ブロック毎に前記符号量割当手段により割り当てられ
た割当符号量を越えないように前記可変長符号化を打ち
切るべく前記可変長符号化手段を制御する打切手段と、 前記量子化手段に対し、初めに前記目的総符号量から予
め定めた暫定的な量子化幅を用いて最適な量子化幅を予
測する第1の符号化処理を少なくとも1回実施させ、次
に前記量子化幅予測手段により予測された最適な量子化
幅を用いて第2の符号化処理を実施させるべく制御する
制御手段とを設けて構成することを特徴とする画像デー
タの符号化装置。
(4) Divide the image data into blocks, perform orthogonal transformation on each divided block, decompose the image data for each block into components from low frequency components to high frequency components, and use this transformation output as In an encoding device that performs quantization by a quantization means, supplies the quantized output to a variable length encoding means to perform variable length encoding, and encodes data for each block, the data is encoded by the variable length encoding means. a code amount calculation means for calculating the code amount of the transform coefficients for the entire image; and a quantization width prediction means that predicts the predicted quantization width and gives the predicted quantization width to the quantization means, and when encoding the block, the amount of code generated by the encoding process in the block to be encoded and the block. The excess or deficiency of this generated code amount with respect to the allocated code amount is calculated based on the allocated code amount in code amount allocating means for determining the code amount added by the amount as the allocated code amount of the next block to be processed; an abort means for controlling the variable length encoding means to abort the quantization; and an abort means for controlling the variable length encoding means to abort the quantization; control means for controlling to perform a first encoding process to predict at least once and then to perform a second encoding process using the optimal quantization width predicted by the quantization width prediction means; 1. An image data encoding device comprising:
(5)画像データをブロックに分割し、この分割された
各ブロックは順にそれぞれ直交変換を行ってこの変換出
力を量子化手段により量子化し、この量子化出力を可変
長符号化手段に与えて可変長符号化し、各ブロック毎に
データの符号化をする符号化装置において、圧縮率を指
定する圧縮率指定手段と、 この圧縮率指定手段にて指定された圧縮率に応じて画面
あたりの許される目的総符号量および暫定的に定めた量
子化幅および1ブロック当たりの基準割当符号量とを決
定する圧縮率選択手段と、前記可変長符号化手段により
符号化された変換係数の画像全体の符号量を算出する符
号量算出手段と、 この符号量算出手段により算出された前記画像全体の符
号量と、前記目的総符号量とから最適な量子化幅を予測
すると共に、前記量子化手段にこの予測量子化幅を与え
る量子化幅予測手段と、前記ブロックの符号化にあたり
、当該符号化処理するブロックでの符号化処理により発
生した符号量と当該ブロックでの割当符号量とに基づい
てこの発生符号量の前記割当符号量に対する過不足量を
算出すると共に、前記圧縮率選択手段により決定された
1ブロック当たりの基準符号量に前記算出した過不足量
を加えた符号量を次に処理するブロックの前記割当符号
量として求める符号量割当手段と、 各ブロック毎に前記符号量割当手段により割り当てられ
た割当符号量を越えないように前記可変長符号化を打ち
切るべく前記可変長符号化手段を制御する打切手段と、 前記量子化手段に対し、初めに前記目的総符号量から予
め定めた暫定的な量子化幅を用いて最適な量子化幅を予
測する第1の符号化処理を少なくとも1回実施させ、次
に前記量子化幅予測手段により予測された最適な量子化
幅を用いて第2の符号化処理を実施させるべく制御する
制御手段とを設けて構成することを特徴とする画像デー
タの符号化装置。
(5) Divide the image data into blocks, perform orthogonal transformation on each divided block in turn, quantize the transform output with a quantization means, and give the quantized output to a variable length encoding means to make it variable. In an encoding device that performs long encoding and encodes data for each block, there is a compression rate specifying means for specifying a compression rate, and an allowable amount per screen according to the compression rate specified by this compression rate specifying means. compression ratio selection means for determining a target total code amount, a provisionally determined quantization width, and a reference allocated code amount per block; and a code for the entire image of transform coefficients encoded by the variable length encoding means. a code amount calculating means for calculating the amount of code, and predicting an optimal quantization width from the code amount of the entire image calculated by the code amount calculating means and the target total code amount, and A quantization width prediction means for giving a predicted quantization width, and a quantization width prediction means that generates a predicted quantization width based on the amount of code generated by the encoding process in the block to be encoded and the amount of code allocated in the block when encoding the block. A block that calculates an excess or deficiency of the code amount with respect to the allocated code amount, and then processes the code amount obtained by adding the calculated excess or deficiency amount to the reference code amount per block determined by the compression rate selection means. a code amount allocating means for determining the allocated code amount for each block; and controlling the variable length encoding means to terminate the variable length encoding so as not to exceed the allocated code amount allocated by the code amount allocating means for each block. a first encoding process for predicting an optimal quantization width using a predetermined provisional quantization width from the target total code amount at least once on the quantization means; and a control means for controlling the second encoding process to be performed using the optimum quantization width predicted by the quantization width prediction means. encoding device.
(6)画像データをブロックに分割し、この分割された
各ブロックは順にそれぞれ直交変換を行って低い周波数
成分から順に高い周波数成分へと前記ブロック毎の画像
データを成分分解し、この変換出力を量子化手段により
量子化し、この量子化出力を可変長符号化手段に与えて
可変長符号化し、各ブロック毎にデータの符号化をする
符号化装置において、前記可変長符号化手段により符号
化された画像全体の変換係数の符号量を算出する符号量
算出手段と、 この符号量算出手段により算出された画像全体の符号量
と、画面あたりの許される目的総符号量とから最適な量
子化幅を予測すると共に、前記量子化手段にこの予測量
子化幅を与える量子化幅予測手段と、 前記ブロックの符号化にあたり、当該符号化処理するブ
ロックでの符号化処理により発生した符号量と当該ブロ
ックでの割当符号量とに基づいてこの発生符号量の前記
割当符号量に対する過不足量を算出すると共に、前記目
的総符号量に基づき決定された1ブロック当たりの基準
符号量に前記算出した過不足量を加えた符号量を次に処
理するブロックの前記割当符号量として求める符号量割
当手段と、 前記量子化手段に対し、初めに前記目的総符号量から予
め定めた暫定的な量子化幅を用いて最適な量子化幅を予
測する第1の符号化処理を少なくとも1回実施させ、次
に前記量子化幅予測手段により予測された最適な量子化
幅を用いて第2の符号化処理を実施させるべく制御する
制御手段とを備え、 前記可変長符号化手段には前記直交変換により得られる
前記各ブロック単位の画像データのうち、直流成分につ
いては手前の符号化処理ブロックでの直流成分との差分
を得ると共にこの差分を可変長符号化する直流成分用の
符号化処理部と、この直流成分の符号化処理部の処理が
終った後、前記交流成分について可変長符号化する交流
成分用の符号化処理部とを設け、前記符号化打ち切り手
段は交流成分用の符号化処理部に対してのみ打ち切り制
御を可能にする構成とすることを特徴とする画像データ
の符号化装置。
(6) Divide the image data into blocks, perform orthogonal transformation on each divided block, decompose the image data for each block into components from low frequency components to high frequency components, and use this transformation output as In an encoding device that performs quantization by a quantization means, supplies the quantized output to a variable length encoding means to perform variable length encoding, and encodes data for each block, the data is encoded by the variable length encoding means. a code amount calculation means for calculating the code amount of the transform coefficients for the entire image; and a quantization width prediction means that predicts the predicted quantization width and gives the predicted quantization width to the quantization means, and when encoding the block, the amount of code generated by the encoding process in the block to be encoded and the block. The excess or deficiency of this generated code amount with respect to the allocated code amount is calculated based on the allocated code amount in a code amount allocating means that obtains the code amount obtained by adding the amount of code as the allocated code amount of the next block to be processed; a first encoding process in which the optimum quantization width is predicted by the quantization width prediction means is performed at least once, and then a second encoding process is performed using the optimum quantization width predicted by the quantization width prediction means. and a control means for controlling the execution, and the variable length encoding means has a control means for controlling the DC component of the image data for each block obtained by the orthogonal transformation, and the DC component of the previous encoding processing block. a DC component encoding processing section that obtains the difference between the two and variable-length encoding the difference; and an AC component encoding processing section that performs variable-length encoding on the AC component after the processing of the DC component encoding processing section is completed. 1. An image data encoding apparatus, characterized in that the encoding processing section is provided with a coding processing section, and the coding aborting means is configured to enable aborting control only for the alternating current component encoding processing section.
(7)画像データをブロックに分割し、この分割された
各ブロックは順にそれぞれ直交変換を行ってからこれを
量子化し、この量子化データを可変長符号化することに
より、各ブロック毎にデータの符号化をする符号化方法
において、 前記データの符号化処理を行って画像全体の符号量を調
べる第1のステップと、 この第1のステップで得た画像全体の符号量から最適化
に必要な量子化幅の予測を行う第2のステップと、 この予測した量子化幅を用いて前記各ブロック毎の量子
化を行う第3のステップと、 前記ブロックの符号化にあたり、当該符号化処理するブ
ロックでの符号化処理により発生した符号量と当該ブロ
ックでの割当符号量とに基づいてこの発生符号量の前記
割当符号量に対する過不足量を算出すると共に、画像当
りの許される符号量である目的の総符号量に応じて予め
決定した1ブロック当たりの基準符号量に前記算出した
過不足量を加えた符号量を次に処理するブロックの前記
割当符号量として求める第4のステップと、この第4の
ステップにおける各ブロック毎の割当符号量に収まる範
囲でそのブロックの可変長符号化を実施する第5のステ
ップとよりなることを特徴とする画像データの符号化方
法。
(7) Divide the image data into blocks, perform orthogonal transformation on each divided block, quantize it, and variable-length code the quantized data. In the encoding method, the first step is to perform encoding processing on the data and check the amount of code for the entire image, and the amount of code required for optimization is determined from the amount of code for the entire image obtained in this first step. a second step of predicting a quantization width; a third step of quantizing each block using the predicted quantization width; and a block to be encoded when encoding the block. Based on the code amount generated by the encoding process and the allocated code amount in the block, calculate the excess or deficiency of the generated code amount with respect to the allocated code amount, and also calculate the amount of code that is allowed per image. a fourth step of determining the code amount obtained by adding the calculated surplus/deficiency amount to the reference code amount per block predetermined according to the total code amount of the block as the allocated code amount of the block to be processed next; 4. A method for encoding image data, comprising: a fifth step of performing variable length encoding of each block within the amount of code allocated to each block in step 4.
(8)画像データをブロックに分割し、この分割された
各ブロックは順にそれぞれ直交変換を行って低い周波数
成分から順に高い周波数成分へと前記ブロック毎の画像
データを成分分解し、この成分分解されたものを量子化
した後、可変長符号化することにより各ブロック毎にデ
ータの符号化をする符号化方法において、 前記可変長符号化処理においては前記直交変換により得
られる前記各ブロック単位の画像データのうち、直流成
分については手前の符号化処理ブロックでの直流成分と
の差分を得ると共にこの差分を可変長符号化し、この直
流成分用の符号化処理が終わった後、前記交流成分につ
いて可変長符号化して、これにより最適化するに必要な
画像全体の符号量を調べる第1のステップと、 この第1のステップで得た画像全体の符号量に基づき最
適化に必要な量子化幅の予測を行う第2のステップと、 この予測した量子化幅を用いて前記各ブロック毎の量子
化を行う第3のステップと、 前記ブロックの符号化にあたり、当該符号化処理するブ
ロックでの符号化処理により発生した符号量と当該ブロ
ックでの割当符号量とに基づいてこの発生符号量の前記
割当符号量に対する過不足量を算出すると共に、画像当
りの許される符号量である目的の総符号量に応じて予め
決定した1ブロック当たりの基準符号量に前記算出した
過不足量を加えた符号量を次に処理するブロックの前記
割当符号量として求める第4のステップと よりなることを特徴とする画像データの符号化方法。
(8) Divide the image data into blocks, and perform orthogonal transformation on each divided block in order to decompose the image data for each block from low frequency components to high frequency components in order. In the encoding method, the data is encoded for each block by variable length encoding after quantizing the data, wherein in the variable length encoding process, the image of each block obtained by the orthogonal transformation is For the DC component of the data, the difference between the DC component and the previous encoding processing block is obtained and this difference is variable-length coded. After the encoding process for the DC component is completed, the AC component is changed. The first step is to perform long coding and check the code amount of the entire image required for optimization, and the quantization width required for optimization is calculated based on the code amount of the entire image obtained in this first step. a second step of performing prediction; a third step of performing quantization for each block using the predicted quantization width; and a third step of performing quantization for each block using the predicted quantization width; Based on the code amount generated by the processing and the allocated code amount in the block, the excess or deficiency of the generated code amount with respect to the allocated code amount is calculated, and the target total code amount, which is the allowable code amount per image, is calculated. a fourth step of determining the code amount obtained by adding the calculated surplus/deficiency amount to the reference code amount per block predetermined according to the above as the allocated code amount of the block to be processed next; Image data encoding method.
JP29392490A 1990-10-31 1990-10-31 Image data encoding device Expired - Lifetime JP2959831B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP29392490A JP2959831B2 (en) 1990-10-31 1990-10-31 Image data encoding device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP29392490A JP2959831B2 (en) 1990-10-31 1990-10-31 Image data encoding device

Publications (2)

Publication Number Publication Date
JPH04167868A true JPH04167868A (en) 1992-06-15
JP2959831B2 JP2959831B2 (en) 1999-10-06

Family

ID=17800927

Family Applications (1)

Application Number Title Priority Date Filing Date
JP29392490A Expired - Lifetime JP2959831B2 (en) 1990-10-31 1990-10-31 Image data encoding device

Country Status (1)

Country Link
JP (1) JP2959831B2 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0846964A (en) * 1994-07-28 1996-02-16 Nec Corp System for controlling code quantity
US5548336A (en) * 1993-11-29 1996-08-20 Nec Corporation Video code conversion with an optimum conversion speed which matches a reproduction speed of a reproducing unit
US6404933B1 (en) 1997-06-02 2002-06-11 Nec Corporation Image encoding method and apparatus thereof
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
JP2003289543A (en) * 1992-07-23 2003-10-10 Samsung Electronics Co Ltd Method and equipment for decoding data
US7542183B2 (en) 1992-11-19 2009-06-02 Olympus Corporation Electronic imaging apparatus

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003289543A (en) * 1992-07-23 2003-10-10 Samsung Electronics Co Ltd Method and equipment for decoding data
US7542183B2 (en) 1992-11-19 2009-06-02 Olympus Corporation Electronic imaging apparatus
US7599581B2 (en) 1992-11-19 2009-10-06 Olympus Corporation Electronic imaging apparatus
US7804626B2 (en) 1992-11-19 2010-09-28 Olympus Corporation Electronic imaging apparatus
US5548336A (en) * 1993-11-29 1996-08-20 Nec Corporation Video code conversion with an optimum conversion speed which matches a reproduction speed of a reproducing unit
JPH0846964A (en) * 1994-07-28 1996-02-16 Nec Corp System for controlling code quantity
US6404933B1 (en) 1997-06-02 2002-06-11 Nec Corporation Image encoding method and apparatus thereof
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

Also Published As

Publication number Publication date
JP2959831B2 (en) 1999-10-06

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
US6885395B1 (en) Selectively adjusting the resolution levels or the quality levels of digital images stored in a digital camera memory
US7990434B2 (en) Digital camera for recording a still image while shooting a moving image
US5416604A (en) Image compression method for bit-fixation and the apparatus therefor
US6144763A (en) Method and apparatus for compression coding of image data representative of a color image and digital camera including the same
US20020005909A1 (en) Image processing apparatus, image processing method, digital camera, and program
US5293252A (en) Method of compressing digital image data and device thereof
JPH0832037B2 (en) Image data compression device
EP1377071A1 (en) Image processing device, image processing method, image processing program, and recording medium
JP2959831B2 (en) Image data encoding device
JP3795932B2 (en) Image data compression encoding method and apparatus
JP2952000B2 (en) Image data encoding apparatus and encoding method
JP2001359117A (en) Image processing unit and image processing method or the unit
JP3406924B2 (en) Image processing apparatus and method
JPWO2002080575A1 (en) Image processing apparatus, image processing method, image processing program, and recording medium
JP3037961B2 (en) Electronic camera device and image data encoding device
JP2002252759A (en) Image quantization method and device, and image coder utilizing them
JP3038022B2 (en) Electronic camera device
JP3192133B2 (en) Electronic camera device
JPH04114564A (en) Picture signal recording device
JPH04207266A (en) Encoder and encoding method for image data
JPH04179371A (en) Device and method for encoding picture data
JPH04207352A (en) Encoding device and encoding method for image data