JP3038022B2 - Electronic camera device - Google Patents

Electronic camera device

Info

Publication number
JP3038022B2
JP3038022B2 JP2404233A JP40423390A JP3038022B2 JP 3038022 B2 JP3038022 B2 JP 3038022B2 JP 2404233 A JP2404233 A JP 2404233A JP 40423390 A JP40423390 A JP 40423390A JP 3038022 B2 JP3038022 B2 JP 3038022B2
Authority
JP
Japan
Prior art keywords
code amount
quantization
information
quantization width
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP2404233A
Other languages
Japanese (ja)
Other versions
JPH04211588A (en
Inventor
秀俊 山田
千尋 中川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Olympus Corp
Original Assignee
Olympus Optic 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 Optic Co Ltd filed Critical Olympus Optic Co Ltd
Priority to JP2404233A priority Critical patent/JP3038022B2/en
Priority to US07/771,791 priority patent/US5291282A/en
Publication of JPH04211588A publication Critical patent/JPH04211588A/en
Application granted granted Critical
Publication of JP3038022B2 publication Critical patent/JP3038022B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Television Signal Processing For Recording (AREA)

Description

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

【0001】[0001]

【産業上の利用分野】本発明は電子カメラ装置および電
子カメラ再生装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an electronic camera device and an electronic camera reproducing device.

【0002】[0002]

【従来の技術】CCDに代表される固体撮像装置等によ
り撮像された画像信号をメモリカード、磁気ディスク、
あるいは磁気テープ等の記憶媒体にディジタルデータと
して記録する場合、そのデータ量は膨大なものとなるた
め、多くのフレーム画像を限られた記録容量の範囲で記
録しようとするには、得られた画像信号のデータに対
し、何らかの圧縮を行うことが必要となる。例えば、デ
ィジタル電子スチルカメラなどにおいては、撮影した画
像を銀塩フィルムの代わりに、メモリカードや磁気ディ
スク等のデータ記憶媒体にディジタルデータとして保存
するので、1枚のメモリカードあるいは磁気ディスク装
置に記録できる画像の枚数は、保証されなければならな
い。
2. Description of the Related Art An image signal picked up by a solid-state image pickup device represented by a CCD or the like is transferred to a memory card, a magnetic disk,
Alternatively, when recording digital data on a storage medium such as a magnetic tape, the amount of data is enormous. It is necessary to perform some kind of compression on the signal data. For example, in a digital electronic still camera, a photographed image is stored as digital data on a data storage medium such as a memory card or a magnetic disk instead of a silver halide film, so that the image is recorded on a single memory card or a magnetic disk device. The number of possible images must be guaranteed.

【0003】同様に、ディジタルVTR(ビデオテープ
レコーダ)等の場合もフレーム当たりの画像のデータ量
に影響されることなく、所定量のフレームを記録できな
ければならない。すなわち、スチル像であっても、動画
像であっても、必要なコマ数分を確実に記録できる必要
がある。
Similarly, in the case of a digital VTR (video tape recorder) or the like, a predetermined amount of frames must be recorded without being affected by the amount of image data per frame. That is, it is necessary to reliably record the required number of frames, whether a still image or a moving image.

【0004】このような条件に対処するための画像デー
タの圧縮方法として、直交変換符号化とエントロピー符
号化を組み合わせた符号化方法が広く知られている。そ
の代表的なものとして、静止画符号化国際標準化におい
て検討されている方式について次に概略を説明する。
As a method for compressing image data to cope with such a condition, a coding method combining orthogonal transform coding and entropy coding is widely known. As a representative example, an outline of a method studied in international standardization of still image coding will be described below.

【0005】この方式はまず、画像データを所定の大き
さのブロックに分割し、分割されたブロック毎に直交変
換として2次元のDCT(離散コサイン変換)を行う。
次に各周波数成分に応じた線形量子化を行い、この量子
化された値に対しエントロピー(単位通報当りの情報
量)符号化としてハフマン符号化を行う。この時、直流
成分に関しては近傍ブロックの直流成分との差分値をハ
フマン符号化する。交流成分はジグザグスキャンと呼ば
れる低い周波数成分から高い周波数成分へのスキャンを
行い、無効(値が0)の成分の連続する個数とそれに続
く有効な成分の値とから2次元のハフマン符号化を行
う。
In this method, first, image data is divided into blocks of a predetermined size, and two-dimensional DCT (discrete cosine transform) is performed as orthogonal transform for each of the divided blocks.
Next, linear quantization according to each frequency component is performed, and Huffman coding is performed on the quantized value as entropy (information amount per unit report) coding. At this time, the difference value between the DC component and the DC component of the neighboring block is Huffman-coded. The AC component scans from a low frequency component to a high frequency component called a zigzag scan, and performs two-dimensional Huffman coding from the continuous number of invalid (value 0) components and the value of the valid components that follow. .

【0006】以上がこの方式の基本部分である。この基
本部分だけでは、エントロピー符号化であるハフマン符
号化を用いているために符号量が画像毎に一定ではなく
なってしまう。
The above is the basic part of this system. With this basic portion alone, the code amount is not constant for each image because Huffman coding, which is entropy coding, is used.

【0007】そこで、符号量の制御の方法として次の方
式が提案されている。まず、前記基本部分の処理を行う
と同時に全画面の発生した総符号量を求める。この総符
号量と目的とする符号量とからDCT係数に対する目的
とする符号量に近づけるのに最適な量子化幅を予測す
る。次にこの量子化幅を用いて前記基本部分の量子化以
降の処理を繰り返す。そして、今回発生した総符号量
と、前回発生した総符号量と、目的とする符号量とから
再び目的の符号量に近づけるのに最適な量子化幅を予測
する。そして、この予測した量子化幅と前回の量子化幅
が一致し、かつ目的の符号量よりも今回発生した総符号
量の方が少ない場合には処理を終了し、符号を出力す
る。そうでない場合には新しい量子化幅を用いて処理を
繰り返す。
Therefore, the following method has been proposed as a method of controlling the code amount. First, the processing of the basic portion is performed, and at the same time, the total code amount of the entire screen is obtained. From the total code amount and the target code amount, an optimal quantization width for approaching the target code amount for the DCT coefficient is predicted. Next, processing after the quantization of the basic portion is repeated using this quantization width. Then, from the total code amount generated this time, the total code amount generated last time, and the target code amount, an optimum quantization width for approaching the target code amount again is predicted. If the predicted quantization width matches the previous quantization width and the total code amount generated this time is smaller than the target code amount, the process is terminated and a code is output. Otherwise, the process is repeated using the new quantization width.

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

【0009】従って上記DCTを行うことにより、画像
データは直流成分DCと交流成分ACに変換され、8 ×8 の
マトリックス上には原点位置(0,0 位置) に直流成分DC
の値を示すデータが、そして、0 ,7 位置には横軸方向
の交流成分ACの最大周波数値を示すデータが、そして、
7 ,0 位置には縦軸方向の最大交流成分ACの周波数値を
示すデータが、さらに7 ,7 位置には斜め方向の交流成
分ACの最大周波数値を示すデータが、それぞれ格納さ
れ、中間位置ではそれぞれの座標位置により関係付けら
れる方向における周波数データが、原点側より順次高い
周波数のものが出現する形で格納されることになる。
Therefore, by performing the DCT, the image data is converted into a DC component DC and an AC component AC, and the DC component DC is placed at the origin position (0, 0 position) on the 8 × 8 matrix.
At the 0 and 7 positions, data indicating the maximum frequency value of the AC component AC in the horizontal axis direction, and
Data indicating the frequency value of the maximum AC component AC in the vertical axis direction is stored at the 7, 0 positions, and data indicating the maximum frequency value of the AC component AC in the oblique direction are stored at the 7, 7 positions. In this case, the frequency data in the directions associated with the respective coordinate positions are stored in such a manner that those having higher frequencies than the origin side appear.

【0010】次にこのマトリックスにおける各座標位置
の格納データを、定められた量子化マトリックスと量子
化幅係数αを掛け合わせて得られる各周波数成分毎の量
子化幅により割ることにより、各周波数成分に応じた線
形量子化を行い(c) 、この量子化された値に対しエント
ロピー符号化としてハフマン符号化を行う。この時、直
流成分DCに関しては近隣ブロックの直流成分との差分値
をグループ番号(付加ビット数)と付加ビットで表現
し、そのグループ番号をハフマン符号化し、得られた符
号語と付加ビットを合わせて符号化データとする(d1 ,
d2,e1,e2) 。
Next, the data stored at each coordinate position in the matrix is divided by a quantization width for each frequency component obtained by multiplying a predetermined quantization matrix by a quantization width coefficient α, thereby obtaining each frequency component. (C), and Huffman encoding is performed on the quantized value as entropy encoding. At this time, for the DC component DC, the difference value from the DC component of the neighboring block is represented by a group number (number of additional bits) and additional bits, the group number is Huffman-coded, and the obtained code word and additional bits are combined. As encoded data (d1,
d2, e1, e2).

【0011】交流成分ACに関しても有効である(値が
“0”でない)係数は、グループ番号と付加ビットで表
現する。
Coefficients that are also effective for the AC component AC (values are not “0”) are represented by group numbers and additional bits.

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

【0013】ハフマン符号化はフレーム画像あたりの上
記直流成分DCおよび交流成分ACの各々のデータ分布にお
ける発生頻度のピークのものを中心として、この中心の
ものほど、データビットを少なくし、周辺になるほどビ
ット数を多くするようにしてビット割り当てをした形で
データを符号化して符号語を得ることで行う。
The Huffman coding is centered on the peak of the frequency of occurrence in the data distribution of each of the DC component DC and AC component AC per frame image. This is performed by encoding data in a form where bits are allocated so as to increase the number of bits to obtain a codeword.

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

【0015】この基本部分だけでは、エントロピー符号
化であるハフマン符号化を用いているために符号量が画
像毎に一定ではなくなってしまうから、符号量の制御の
方法として例えば、次のように処理する。
Since only the basic portion uses Huffman coding, which is entropy coding, the code amount is not constant for each image. Therefore, as a method of controlling the code amount, for example, the following processing is performed. I do.

【0016】まず、暫定的な量子化幅係数αを用いて前
記基本部分の処理を行うと同時に、全画面の発生した総
符号量(総ビット数)を求める(g) 。この総符号量と、
目的とする符号量と、用いた暫定的な量子化幅係数αの
3者とからDCT係数に対する目的とする符号量に近づ
けるのに最適な量子化幅係数αをニュートン‐ラプソン
‐イタレーション(Newton Raphson Iteration)により
予測する(h) 。
First, the basic portion is processed using the provisional quantization width coefficient α, and at the same time, the total code amount (total number of bits) generated for the entire screen is obtained (g). This total code amount,
From the target code amount and the tentative quantization width coefficient α used, the optimum quantization width coefficient α for approaching the target code amount for the DCT coefficient is calculated by Newton-Raphson-Iteration (Newton Raphson Iteration) (h).

【0017】次にこの量子化幅係数αを用い(i) 、前述
の基本部分の量子化以降の処理を繰り返す。そして、今
回発生した総符号量と、前回発生した総符号量と、目的
とする符号量と、今回用いた量子化幅係数αと、前回用
いた量子化幅係数αとから、再び目的の符号量に近づけ
るのに最適な量子化幅係数αを予測する。そして、この
予測した量子化幅係数αと前回の量子化幅係数αが一致
し、かつ目的の符号量よりも今回発生した総符号量の方
が少ない場合には処理を終了し、今回発生した符号化デ
ータを出力してメモリカードに記憶する(f) 。そうでな
い場合には量子化幅係数αを変更し、この新しい量子化
幅αを用いて処理を繰り返す。
Next, using the quantization width coefficient α (i), the above-mentioned processing after quantization of the basic part is repeated. Then, from the total code amount generated this time, the total code amount generated last time, the target code amount, the quantization width coefficient α used this time, and the quantization width coefficient α used last time, The quantization width coefficient α that is optimal for approaching the amount is predicted. Then, if the predicted quantization width coefficient α matches the previous quantization width coefficient α, and the total code amount generated this time is smaller than the target code amount, the process ends, and the current The encoded data is output and stored in the memory card (f). If not, the quantization width coefficient α is changed, and the process is repeated using the new quantization width α.

【0018】[0018]

【発明が解決しようとする課題】上述したように、例え
ば、ディジタル電子スチルカメラなどにおいては、1枚
のメモリカードあるいは磁気ディスク装置あるいは1本
の磁気テープに記録できる画像の枚数が保証されていな
ければならず、そのため、画像データを圧縮して記録す
るが、高能率で画像データの圧縮が行える事が望まれ
る。これらはディジタル電子スチルカメラに限らず、他
のアプリケーションにおいても、少なからず要求される
項目である。
As described above, for example, in a digital electronic still camera, the number of images that can be recorded on one memory card, magnetic disk device, or one magnetic tape must be guaranteed. Therefore, the image data is compressed and recorded, and it is desired that the image data can be compressed with high efficiency. These are not only items required for digital electronic still cameras but also for other applications.

【0019】しかしながら、上述の国際標準案方式によ
る圧縮方法は、画像データをブロック化して離散コサイ
ン変換に代表されるような直交変換を行う符号化また
は、予測符号化(DPCM)等の画像情報圧縮により前処理の
圧縮を行い、その結果を得て量子化した後、その量子化
出力をハフマン符号化に代表される可変長符号化によっ
て符号化する方法であることから、このような可変長符
号化を組合わせた画像データ圧縮方式は高能率圧縮が可
能であるものの、可変長符号化を用いているが故に、実
際に符号化を終了するまで、その符号量がわからず、符
号量を制御することが難しいと云う問題があった。
However, the above-mentioned compression method based on the international standard scheme employs image information compression such as coding for performing orthogonal transform as represented by discrete cosine transform by blocking image data or predictive coding (DPCM). This is a method of performing pre-processing compression, obtaining the result, quantizing the result, and encoding the quantized output by variable-length coding represented by Huffman coding. Although the image data compression method combined with encoding can perform high-efficiency compression, it uses variable-length coding, so the code amount is not known until the coding is actually completed, and the code amount is controlled. There was a problem that it was difficult to do.

【0020】一方、限られた容量の記録媒体に記録でき
る画像の枚数を、増やすため、データの圧縮率を変える
ようにする提案がある。例えば、特開昭63-286078 号に
見られるように、データをそのまま記録するモードと、
圧縮して記録するモードとを切換えて使用することが、
また、特開平1-292987号には圧縮の度合いを切換えるこ
とで、複数の画質モードを選択できるようにすることが
提案されている。これは一般に、圧縮率を高くすると画
質は低下することになるため、記録枚数を優先するモー
ド(低画質モード)と、画質を重視する高画質モードを
ユーザの希望や用途に応じ、選択切換えできるようにす
るためである。
On the other hand, there is a proposal to change the data compression ratio in order to increase the number of images that can be recorded on a recording medium having a limited capacity. For example, as shown in JP-A-63-286078, a mode for recording data as it is,
Switching and using the mode of recording by compression,
Japanese Patent Application Laid-Open No. 1-292987 proposes that a plurality of image quality modes can be selected by switching the degree of compression. Generally, when the compression ratio is increased, the image quality is reduced. Therefore, a mode in which the number of recorded images is prioritized (a low image quality mode) and a high image quality mode in which the image quality is emphasized can be selectively switched according to a user's desire or application. That's why.

【0021】これらの先行技術では複数の画質モードに
応じた圧縮率の圧縮回路を各別に設け、これらを画質モ
ードに応じて切換えて使用するようにしているため、ハ
ードウェア構成が複雑となり、カメラの大型化、コスト
アップをもたらす。また、これらの先行例は無圧縮モー
ドと、圧縮モードとの切換え、あるいは数種類の固定圧
縮率の中のいずれかを選択するものであり、圧縮率を任
意の値に設定することや、一定容量の記録媒体に記録で
きる画像枚数をユーザの希望に応じて自由に設定できる
ようにすることは出来ない。
In these prior arts, a compression circuit having a compression ratio corresponding to a plurality of image quality modes is separately provided, and these are switched and used according to the image quality mode. The size and cost increase. In these prior examples, switching between the non-compression mode and the compression mode, or selecting one of several types of fixed compression ratios, the compression ratio can be set to an arbitrary value, and a fixed capacity can be set. It is not possible to freely set the number of images that can be recorded on the recording medium according to the user's request.

【0022】また、高画質モードと低画質モードを選択
できたとしても、このモードの違いにより、当然、画像
当り(コマ当り)の目的符号量も変り、これに合わせて
圧縮符号化する必要が生じるが、画像はその内容によ
り、空間周波数の分布状態がまちまちであり、従って、
選択した圧縮率が固定では、空間周波数の分布状態に応
じて圧縮後のデータ容量がまちまちになってしまう。こ
れでは一定容量の記録媒体に対し、何枚記録できるかは
常に不確定であり、実際に記録して見ないとわからない
ことから、使い勝手の上で極めて不都合である。また、
人間が知覚する色信号の帯域幅は輝度信号のそれに比較
して狭くても良いので、画像の輝度信号成分と色信号成
分を分離して量子化幅を制御し、色信号の情報量を輝度
信号に比較して少なくすることにより、再生画像の画質
を劣化させることなく、情報量を削減することが可能に
なる。 しかしながら、上記従来技術においては、輝度信
号と色信号を区別せずに量子化幅αを制御していたた
め、情報量が多くなると云う問題があった。また、情報
量が多くなると、情報の記録に時間がかかり、特に速写
性の要求される電子カメラにおいては問題となってい
た。 また、1コマ当たりの画像の情報量が多くなると記
録媒体に記録可能な撮影可能枚数が少なくなるという問
題もあった。
Even if the high image quality mode and the low image quality mode can be selected, the target code amount per image (per frame) naturally changes due to the difference between these modes, and it is necessary to perform compression encoding in accordance with this. However, depending on the content of the image, the spatial frequency distribution varies, and
If the selected compression ratio is fixed, the data capacity after compression will vary depending on the spatial frequency distribution state. In this case, it is always uncertain how many sheets can be recorded on a recording medium of a fixed capacity, and it is inconvenient in terms of usability because it cannot be known unless actually recorded. Also,
Human perceived color signal bandwidth compared to luminance signal bandwidth
The luminance and chrominance signal components of the image.
Control the quantization width by separating
By reducing the number compared to the signal, the image quality of the reproduced image
Can reduce the amount of information without deteriorating
Become. However, in the above prior art, the luminance signal
The quantization width α was controlled without distinguishing the signal from the color signal.
Therefore, there is a problem that the amount of information increases. Also information
If the volume is large, it takes time to record information, especially
Is a problem for electronic cameras that require
Was. It also states that the amount of image information per frame increases.
Question that the number of recordable images that can be recorded on
There was also a title.

【0023】そこで、本発明の目的とするところは、所
望の画質モードを選択でき、しかも、その選択した画質
モードに応じた一定枚数分の画像を撮影記録できるよう
にしたり、あるいは所望の枚数分の画像を設定してその
枚数分、撮影記録できるようにすると共に、圧縮率別の
ハードウェアを用意することなく、共通のハードウェア
で各種圧縮率に対応できるようにし、且つ、設定圧縮率
の範囲内で最良の画質が維持できるようにした電子カメ
ラ装置を提供することにある。また、本発明の目的は、
再生画像の画質を高画質に保ちつつ、容量の小さい情報
量に圧縮することで、撮影可能枚数が多く、速写性にも
優れた電子カメラ装置を提供することにある。
Therefore, an object of the present invention is to enable a desired image quality mode to be selected and to allow a fixed number of images to be photographed and recorded in accordance with the selected image quality mode, or to provide a desired number of images. The number of images can be set, and shooting and recording can be performed for the number of images. Also, it is possible to support various compression ratios with common hardware without preparing hardware for each compression ratio. An object of the present invention is to provide an electronic camera device capable of maintaining the best image quality within the range. The object of the present invention is
Information with small capacity while maintaining high image quality of playback images
By compressing the amount, the number of shootable images is large, and
An object of the present invention is to provide an excellent electronic camera device.

【0024】[0024]

【課題を解決するための手段】上記目的を達成するた
め、本発明は次のように構成する。すなわち、映像信号
を生成する撮影系を有し、この撮影系により得た画像信
号を、A/D変換し、輝度信号成分と色信号成分に分離
直交変換もしくは予測符号化等を行う画像情報圧縮手
段により前処理した後、量子化手段により量子化し、こ
の量子化出力を可変長符号化手段により可変長符号化
し、この可変長符号化した画像信号データを、読出し可
能に記録する記録媒体に記録して保存するようにした電
子カメラ装置であって、所望の圧縮率に対応する情報を
入力する入力手段と、各種の圧縮率に対応した量子化幅
の情報を予め有し、前記入力手段により入力された圧縮
率対応情報より、該圧縮率対応情報に対応した輝度信号
成分と色信号成分に対する量子化幅の情報を各々出力す
る量子化幅設定手段と、この量子化幅設定手段より出力
された前記量子化幅の情報を前記記録媒体に読出し可能
に記録する手段とを設けると共に、前記量子化手段は前
記量子化幅設定手段から出力される量子化幅の情報を受
けてその量子化幅で前記前処理済み画像信号データを量
子化する構成とすることを特徴とする。
In order to achieve the above object, the present invention is configured as follows. That is, it has a photographing system for generating a video signal, and A / D converts an image signal obtained by this photographing system into a luminance signal component and a color signal component.
After performing pre-processing by image information compressing means for performing orthogonal transformation or predictive coding, etc., quantizing by quantizing means, the quantized output is variable-length coded by variable-length coding means, and the variable-length coded image An electronic camera device configured to record and store signal data on a recording medium that records signal data in a readable manner, comprising: input means for inputting information corresponding to a desired compression rate; and a quantum device corresponding to various compression rates. A luminance signal corresponding to the compression ratio corresponding information, based on the compression ratio corresponding information input by the input means, having information of the compression width in advance.
A quantization width setting unit that outputs information of a quantization width for each of the component and the color signal component; and a unit that readablely records the information of the quantization width output from the quantization width setting unit on the recording medium. And the quantization means receives the information on the quantization width output from the quantization width setting means and quantizes the preprocessed image signal data with the quantization width. I do.

【0025】[0025]

【0026】また、第2には所望の圧縮率に対応する情
報を入力する入力手段と、可変長符号化手段の出力を受
け、画面単位の総符号量を求めてこれを算出符号量情報
として出力する符号量算出手段と、前記入力手段により
入力された圧縮率対応情報より、画像当りの収めるべき
総符号量の情報を与えると共に初めに統計処理指令を発
令し、統計処理が終わると符号化処理指令を発令する制
御手段と、前記統計処理指令による実行開始時には前記
制御手段からの総符号量の情報に基づき、該総符号量の
枠に対応した量子化幅の予測を行って該予測した量子化
幅の情報を前記量子化手段に与え、符号化処理指令によ
る実行開始時には入力される前記算出符号量情報に基づ
き旋回予測した量子化幅の情報に対して前記総符号量の
枠に収まるよう補正した量子化幅の情報を得て、この補
正した量子化幅の情報を前記量子化手段に与える量子化
幅予測手段と、この量子化幅予測手段の予測した量子化
幅の情報を前記記録媒体に読出し可能に記録する手段と
を設けると共に、前記量子化手段は量子化幅の情報を受
けてその量子化幅で前記前処理済み画像データを量子化
する構成とすることを特徴とする。
Secondly , the input means for inputting information corresponding to a desired compression ratio and the output of the variable length coding means are obtained, and the total code amount per screen is obtained, and this is used as calculated code amount information. From the output code amount calculating means and the compression ratio correspondence information input by the input means, information on the total code amount to be stored per image is given, and a statistical processing command is first issued, and the coding is performed when the statistical processing is completed. Control means for issuing a processing command, and at the start of execution by the statistical processing command, based on information on the total code amount from the control means, predicts a quantization width corresponding to the frame of the total code amount and performs the prediction. The quantization width information is provided to the quantization means, and at the start of execution according to the encoding processing command, the quantization width information predicted to be swivel based on the input calculated code amount information falls within the frame of the total code amount. Supplement Quantization width prediction means for obtaining the information of the corrected quantization width and providing the information of the corrected quantization width to the quantization means; and storing the information of the quantization width predicted by the quantization width prediction means in the recording medium. Means for readable recording is provided, and the quantization means receives the information of the quantization width and quantizes the preprocessed image data with the quantization width.

【0027】更に、第3には所望の圧縮率に対応する情
報を入力する入力手段と、可変長符号化手段の出力を受
け、画面単位の総符号量を求めてこれを算出符号量情報
として出力する符号量算出手段と、前記入力手段により
入力された圧縮率対応情報より、画像当りの収めるべき
総符号量の情報を与えると共に初めに統計処理指令を発
令し、統計処理が終わると符号化処理指令を発令する制
御手段と、前記統計処理指令による実行開始時には前記
制御手段からの総符号量の情報に主付き、該総符号量の
枠に対応した量子化幅の予測を行って該予測した量子化
幅の情報を前記量子化手段に与え、符号化処理指令によ
る実行開始時には入力される前記算出符号量情報に基づ
き前回予測した量子化幅の情報に対して前記総符号量の
枠に収まるよう補正した量子化幅の情報を得て、この補
正した量子化幅の情報を前記量子化手段に与える量子化
幅予測手段と、前記統計処理指令による実行時に前記算
出符号量情報と前記収めるべき総符号量の情報とに基づ
き、前記各ブロックの割当て符号量を求める符号量割当
手段と、前記符号化処理指令による実行時、前記各ブロ
ック毎の前記算出符号量情報がそのブロックでの前記割
当て符号量に達すると前記可変長符号化手段の当該ブロ
ックに対する符号化を打切るべく制御する符号化打切手
段と、前記量子化幅予測手段の予測した量子化幅の情報
を前記記録媒体に読出し可能に記録する手段とを設ける
と共に前記量子化手段は量子化幅の情報を受けてその量
子化幅で前記前処理済み画像データを量子化する構成と
し、前記可変長符号化手段は前記打切り指令を受ける毎
に現在処理中のブロックに対する符号化を打切る構成と
する。
Furthermore, the third input means for inputting the information corresponding to the desired compression ratio, receives the output of the variable length coding means, it seeking total code amount in the unit of a picture as calculated code quantity information From the output code amount calculating means and the compression ratio correspondence information input by the input means, information on the total code amount to be stored per image is given, and a statistical processing command is first issued, and the coding is performed when the statistical processing is completed. Control means for issuing a processing command, and at the start of execution according to the statistical processing command, information on the total code amount from the control means is attached, and a prediction of a quantization width corresponding to the frame of the total code amount is performed. The quantized width information is given to the quantizing means, and at the start of the execution according to the encoding process command, the information of the previously predicted quantization width based on the calculated code amount information inputted is set in the frame of the total code amount. Supplement to fit Quantization width prediction means for obtaining the information of the corrected quantization width and providing the information of the corrected quantization width to the quantization means, and the calculated code amount information and the total code to be contained when executed by the statistical processing command. Code amount allocating means for calculating the allocated code amount of each block based on the amount information, and the calculated code amount information for each block, when executed by the coding processing command, is the allocated code amount in the block. , The variable length coding means controls the coding to stop the coding for the block, and the quantization width information predicted by the quantization width prediction means is recorded in the recording medium in a readable manner. The quantization means receives the information of the quantization width and quantizes the preprocessed image data with the quantization width. Ri to abort the encoding configuration and for the block currently being processed for each receiving a command.

【0028】[0028]

【0029】また、第4には映像信号を生成する撮影系
を有し、この撮影系により得た画像信号を画像データ化
すると共に、この画像データは所定画素単位でブロック
化し、この各ブロックについて順に直交変換を行って周
波数成分別係数データ化した後、量子化手段により量子
化し、この量子化出力を可変長符号化手段により可変長
符号化し、この可変長符号化した画像信号データを読出
し可能に記録する記録媒体に記録して保存するようにし
た電子カメラ装置において、前記量子化手段には前期ブ
ロック毎の周波数成分別前記係数データを、統計処理時
には暫定的な周波数成分別量子化幅係数を用いて低周波
数成分から順に量子化を行わせ、符号化処理時には周波
数成分別最適量子化幅係数を用いて低周波数成分から順
に量子化を行わせる構成とし、また、可変長符号化手段
からの符号化出力の符号量を算出する算出手段と、最初
に統計処理を行い、その後に符号化処理を行うべき制御
すると共に、統計処理においては前期ブロック毎の周波
数成分別前記係数データを、各周波数成分から順に予め
定めた暫定的な周波数成分別量子化幅係数を用いて量子
化を行うべく量子化手段を制御し、符号化処理時には前
期ブロック毎の周波数成分別前記係数データを、低周波
数成分から順に周波数成分別最適量子化幅係数を用いて
量子化を行うべく量子化手段を制御すると共に、前記算
出手段から得られる前記統計処理時の発生総符号量から
画像の収めるべき最適な総符号量を決定してこれを前記
最適目的符号量とする制御手段と、最適目的符号量およ
び統計処理時に得られる算出手段からの符号量情報から
得られる画像あたりの発生した総符号量と各ブロック別
符号量とから各ブロック別の割当符号量を決定する符号
割当手段と、前記符号化処理時に前記可変長符号化手段
の出力する前記各ブロック毎の符号化出力がそのブロッ
クでの前記割当符号量を越えないように符号化を打ち切
る打ち切り手段とを設けて構成する。
Further, having an imaging system for generating a video signal in the fourth, the image signal obtained by the imaging system as well as the image data of this image data into blocks with predetermined pixel units, for the respective blocks After performing orthogonal transform in order to generate coefficient data for each frequency component, quantize by a quantizing means, and quantize the quantized output by a variable length coding means, and read out the variable length coded image signal data. In the electronic camera device, the coefficient data for each frequency component for each block is stored in the quantizing means, and a provisional quantization component for each frequency component is used during statistical processing. To perform quantization in order from the low frequency component, and in the encoding process, perform quantization in order from the low frequency component using the optimal quantization width coefficient for each frequency component. And a calculating means for calculating the code amount of the coded output from the variable-length coding means, a control for performing a statistical process first, and then performing a coding process. The quantization means is controlled to quantize the coefficient data for each frequency component using a predetermined temporary quantization width coefficient for each frequency component in order from each frequency component. The coefficient data for each frequency component is controlled in order from the low frequency component to quantize using the optimal quantization width coefficient for each frequency component, and the occurrence of the statistical processing obtained from the calculation means is controlled. A control means for determining an optimum total code amount to be included in the image from the total code amount and setting the optimum target code amount to the optimum target code amount; Code assigning means for determining an assigned code amount for each block from the total code amount generated per image and the code amount for each block obtained from the code amount information of the variable length encoding means during the encoding process. And a truncation means for terminating the encoding so that the encoded output of each block to be output does not exceed the allocated code amount of the block.

【0030】[0030]

【作用】本発明は映像信号を生成する撮影系を有し、こ
の撮影系により得た画像信号を、画像情報圧縮手段によ
り前処理(例えば、ブロック化してDCT等の直交変換
を行う、またはDPCMを行う等)した後、量子化手段
に与えて量子化し、この量子化出力を可変長符号化手段
により可変長符号化し、この可変長符号化した画像信号
データを、読出し可能に記録する記録媒体に記録して保
存するようにした電子カメラ装置において、第1の構成
の場合、入力手段より所望の圧縮率に対応する情報を入
力すると、量子化幅設定手段はこの入力された圧縮率対
応情報に対応した輝度信号成分と色信号成分に対する
子化幅の情報を出力し、これを前記量子化手段に与える
と共に、記録手段にも与え、記録手段はこの量子化幅設
定手段より与えられた量子化幅の情報を前記記録媒体に
読出し可能に記録する。また、前記量子化手段は量子化
幅設定手段から出力された量子化幅の情報を受けてその
量子化幅で前記前処理済み画像信号データを量子化す
る。この構成によりれば、量子化幅設定手段には各種の
圧縮率に対応した輝度信号成分と色信号成分に対する
子化幅の情報を予め記憶してあり、これを入力圧縮率対
応情報に対応して読出すだけで最適量子化幅の情報を与
えることができるので、目的の符号量に収まるよう符号
化するに当り、その処理を極めて短時間で行える他、ハ
ードウェアも簡単で済むようになる。また、本発明によ
れば、映像信号を輝度信号成分と色信号成分に分離した
に、これらの各成分に応じた量子化幅の情報を用いて
符号化処理を行っているので、再生画像の画質を高画質
に保ちながらも、容量の小さい情報量に圧縮できること
で、撮影可能枚数が多く、速写性にも優れた電子カメラ
装置を提供することができる。また、量子化幅の情報を
記録媒体に記録することで、画像の再生時にこの量子化
幅の情報を用いれば、簡単且つ迅速に画像再生が可能に
なる。
According to the present invention, there is provided a photographing system for generating a video signal, and an image signal obtained by this photographing system is preprocessed (for example, divided into blocks and subjected to orthogonal transformation such as DCT or DPCM) by image information compression means. And the like, and the resulting signal is supplied to a quantization means for quantization, the quantized output is subjected to variable-length coding by a variable-length coding means, and the variable-length-coded image signal data is recorded in a readable recording medium. In the case of the first configuration, when information corresponding to a desired compression ratio is input from the input unit, the quantization width setting unit uses the input compression ratio corresponding information. And outputs the information of the quantization width for the luminance signal component and the chrominance signal component corresponding to the quantization signal, and supplies the information to the quantization means and the recording means. More Readably recorded was the information of the quantization width to the recording medium. Further, the quantization means receives the information of the quantization width output from the quantization width setting means and quantizes the preprocessed image signal data with the quantization width. According to this configuration, the quantization width setting means previously stores the quantization width information for the luminance signal component and the chrominance signal component corresponding to various compression ratios, and stores the information in the input compression ratio. The information of the optimal quantization width can be given only by reading corresponding to the corresponding information, so that the encoding process can be performed in a very short time and the hardware can be simplified in order to fit in the target code amount. Will be enough. Further, according to the present invention,
Video signal was separated into a luminance signal component and a chrominance signal component.
Later , using the quantization width information corresponding to each of these components,
Encoding process enables high quality playback images
Can be compressed to a small amount of information while maintaining
An electronic camera that has a large number of images that can be taken
An apparatus can be provided. Also, the information of the quantization width is
By recording on a recording medium, this quantization
Easy and quick image playback using width information
Become.

【0031】[0031]

【0032】第2のケースでは、入力手段により所望の
圧縮率に対応する情報を入力すると、制御手段は該入力
された圧縮率対応情報より、画像当りの収めるべき総符
号量の情報を求め、前記量子化幅予測手段に与える。制
御手段は、初めに統計処理指令を発令し、これにより量
子化幅予測手段は前記制御手段からの総符号量の情報に
基づき、該総符号量の枠に対応した量子化幅の予測を行
って暫定的な量子化幅の情報としてこれを前記量子化手
段に与える。量子化手段はこれを用いて撮像系からの画
像信号データを量子化し、この量子化した画像信号デー
タは画像信号圧縮手段に与え、可変長符号化する。一
方、符号量算出手段はこの画像信号圧縮手段からの可変
長符号化出力を受けて画面単位の総符号量を求め、これ
を算出符号量情報として量子化幅予測手段に出力する。
In the second case, when information corresponding to a desired compression rate is input by the input means, the control means obtains information on the total code amount to be stored per image from the input compression rate correspondence information. This is given to the quantization width prediction means. The control means first issues a statistical processing command, whereby the quantization width prediction means predicts the quantization width corresponding to the total code amount frame based on the information on the total code amount from the control means. This is given to the quantization means as provisional quantization width information. The quantization means quantizes the image signal data from the image pickup system by using this, and supplies the quantized image signal data to the image signal compression means to perform variable length coding. On the other hand, the code amount calculation means receives the variable length coded output from the image signal compression means, calculates the total code amount for each screen, and outputs this to the quantization width prediction means as calculated code amount information.

【0033】制御手段は統計処理が終わると符号化処理
指令を発令し、量子化幅予測手段は入力された前記算出
符号量情報と前回予測した量子化幅の情報に基づいて前
記総符号量の枠に収まるような量子化幅を予測し直し、
この新たな予測量子化幅の情報を得て、この補正した量
子化幅の情報を前記量子化手段に与え、該量子化手段に
この量子化幅の情報に基づいた量子化幅で前記前処理済
み画像データを量子化させる。また、記録手段は前記量
子化幅予測手段の予測した量子化幅の情報を前記記録媒
体に読出し可能に記録すると云うものである。
When the statistical processing is completed, the control means issues a coding processing instruction, and the quantization width prediction means uses the calculated code amount information inputted and the information of the previously predicted quantization width to calculate the total code amount. Re-estimate the quantization width that fits in the frame,
The information on the new predicted quantization width is obtained, and the information on the corrected quantization width is given to the quantization means. The preprocessing is performed by the quantization means based on the quantization width based on the information on the quantization width. And quantizes the already processed image data. Further, the recording means records the information of the quantization width predicted by the quantization width prediction means on the recording medium in a readable manner.

【0034】要約すると、第2のケースは、所望の圧縮
率を与えることができ、この圧縮率変化により画像当り
の総符号量(目的符号量)が変化しても、その時の指定
される目的符号量により定まる暫定的な量子化幅情報で
量子化して可変長符号化すると云った調査のための符号
化処理を行い、この結果得られる総符号量より最適な量
子化幅の予測を行い、この予測した最適な量子化幅で量
子化して最終的な符号化を行う2パス方式であり、この
方式では調査のための符号化処理を行うので、最終的な
符号量を目標値に収めるに最適な量子化幅を見付けて目
標符号量内に内輪で目一杯に収めることができるように
なる。しかも、圧縮率別のハードウェアを用いずに全て
の圧縮率共用のハードウェアにより得られるようになる
ので、コストダウンと小型化が図れる。
In summary, in the second case, a desired compression rate can be given, and even if the total code amount per image (target code amount) changes due to the change in the compression ratio, the designated target Perform the encoding process for investigation such as quantizing with the temporary quantization width information determined by the code amount and performing variable length coding, and perform the prediction of the optimal quantization width from the total code amount obtained as a result, This is a two-pass method in which quantization is performed with the predicted optimum quantization width and final encoding is performed. In this method, encoding processing for investigation is performed, so that the final code amount is set to a target value. It is possible to find the optimum quantization width and fill the target code amount with the inner ring. In addition, since the compression rate can be obtained by hardware that shares all compression rates without using hardware for each compression rate, cost reduction and size reduction can be achieved.

【0035】また、第3のケースは、画像データをブロ
ックに分割し、この分割されたブロック毎に直交変換等
を行って前処理した後、量子化手段により量子化し、こ
の量子化出力を可変長符号化手段により可変長符号化す
る場合に、入力手段により所望の圧縮率に対応する情報
を入力すると、制御手段は該入力された圧縮率対応情報
より、画像当りの収めるべき総符号量の情報を求め、前
記量子化幅予測手段に与える。制御手段は、初めに統計
処理指令を発令し、これにより量子化幅予測手段は前記
制御手段からの総符号量の情報に基づき、該総符号量の
枠に対応した量子化幅の予測を行って暫定的な量子化幅
の情報としてこれを前記量子化手段に与える。量子化手
段はこれを用いて撮像系からの画像信号データを量子化
し、この量子化した画像信号データは画像信号圧縮手段
に与え、可変長符号化する。
In the third case, the image data is divided into blocks, and the divided blocks are pre-processed by performing an orthogonal transformation or the like, and then quantized by a quantization means, and the quantized output is changed. In the case of performing variable-length encoding by the long encoding unit, when information corresponding to a desired compression ratio is input by the input unit, the control unit uses the input compression ratio corresponding information to determine the total code amount to be contained per image from the input compression ratio corresponding information. Information is obtained and given to the quantization width prediction means. The control means first issues a statistical processing command, whereby the quantization width prediction means predicts the quantization width corresponding to the total code amount frame based on the information on the total code amount from the control means. This is given to the quantization means as provisional quantization width information. The quantization means quantizes the image signal data from the image pickup system by using this, and supplies the quantized image signal data to the image signal compression means to perform variable length coding.

【0036】一方、符号量算出手段は可変長符号化手段
の出力を受け、画面単位の総符号量を求めてこれを算出
符号量情報として出力する。また、符号量割当手段は前
記算出符号量情報と前記収めるべき総符号量の情報とに
基づき、前記各ブロックの割当て符号量を求める。
On the other hand, the code amount calculating means receives the output of the variable length coding means, calculates the total code amount for each screen, and outputs this as calculated code amount information. Further, the code amount allocating means obtains the allocated code amount of each block based on the calculated code amount information and the information of the total code amount to be contained.

【0037】制御手段は統計処理が終わると符号化処理
指令を発令し、量子化幅予測手段は入力された前記算出
符号量情報と前回予測した量子化幅の情報とに基づき、
前記総符号量の枠に収まるよう量子化幅の最適値予測を
行い、この最適値予測した量子化幅の情報を前記量子化
手段に与え、該量子化手段にこの量子化幅の情報に基づ
いた量子化幅で前記前処理済み画像データを量子化させ
る。
When the statistical processing is completed, the control means issues a coding processing instruction, and the quantization width prediction means performs the following processing on the basis of the input information of the calculated code amount and the information of the previously predicted quantization width.
Optimum value prediction of the quantization width is performed so as to be within the frame of the total code amount, information on the quantization value predicted by the optimum value is given to the quantization means, and the quantization means is provided based on the information on the quantization width. The pre-processed image data is quantized by the determined quantization width.

【0038】そして、量子化手段からの量子化出力は、
可変長符号化手段により可変長符号化されて出力され
る。また、符号量算出手段は可変長符号化手段の出力を
受け、画面単位の総符号量を求めてこれを算出符号量情
報として出力し、符号化打切手段は符号量割当手段の求
めた前記各ブロック別割当て量を参照し、前記符号化処
理指令による実行時、前記各ブロック毎の前記算出符号
量情報がそのブロックでの前記割当て符号量に達すると
前記可変長符号化手段の当該ブロックに対する符号化を
打切るべく制御する。量子化手段は量子化幅の情報を受
けてその量子化幅で前記前処理済み画像データを量子化
し、可変長符号化手段はこれを可変長符号化して出力す
るが、前記打切り指令を受ける毎に現在処理中のブロッ
クに対する符号化を打切る。また、記録手段は前記量子
化幅予測手段の予測した量子化幅の情報を前記記録媒体
に読出し可能に記録する。
The quantized output from the quantizing means is:
The output is variable-length coded by the variable-length coding means. Further, the code amount calculating means receives the output of the variable length coding means, calculates the total code amount for each screen, and outputs the calculated total code amount information as calculated code amount information. Referring to the allocation amount for each block, when the calculated code amount information for each block reaches the allocated code amount in the block at the time of execution according to the coding processing command, the code for the block by the variable-length coding unit is assigned to the block. Control to terminate the conversion. The quantization means receives the information of the quantization width, quantizes the preprocessed image data with the quantization width, and the variable-length coding means outputs the variable-length encoded data. , The coding for the block currently being processed is discontinued. The recording means records the information of the quantization width predicted by the quantization width prediction means on the recording medium in a readable manner.

【0039】要するに、第3のケースの場合は、2回の
パスで処理を終了する2パス方式であり、目的符号量に
近い符号量が得られる量子化幅を与えることができる係
数αを用いて統計処理すると、早く、しかも、より精度
良く、最適量子化幅係数αを見付けることができること
を利用して、暫定的な量子化幅係数として、目的符号量
に基づいて設定した最適な量子化幅に近い量子化幅係数
を用いて第1パスの量子化を行い、これにより得た総符
号量から目的符号量に収めることができる量子化幅係数
を知って、これを第2パス目で使用して最終的な符号化
を行うが、ブロック単位で符号量の調整を行い、そのブ
ロックでの符号量が割り当て量を越えるとそのブロック
での符号化をうち切るので符号量が目標量に綺麗に収ま
るようになる。これらのことにより、画像データを短い
時間で、精度良く目的符号量の枠一杯に符号化し、これ
によって、許される符号量に目一杯近付けることができ
ることで、失うデータを最小限にとどめ、画質も維持で
きるようになるものである。しかも、圧縮率別のハード
ウェアを用いずに全ての圧縮率共用のハードウェアによ
り得られるようになるので、コストダウンと小形化が図
れる。
In short, the third case is a two-pass method in which the processing is completed in two passes, and uses a coefficient α capable of giving a quantization width that can obtain a code amount close to the target code amount. When the statistical processing is performed, the optimum quantization width coefficient α can be found quickly and more accurately, and the optimal quantization width coefficient set based on the target code amount is used as a provisional quantization width coefficient. The first pass quantization is performed using a quantization width coefficient close to the width, and from the obtained total code amount, a quantization width coefficient that can be included in the target code amount is known, and this is used in the second pass. The final encoding is performed by using this function.However, the amount of code is adjusted in units of blocks, and if the amount of code in the block exceeds the allocated amount, the encoding in that block is terminated. It will fit neatly. As a result, the image data can be accurately encoded in a short period of time in the entire frame of the target code amount, thereby making it possible to approach the allowable code amount as much as possible, thereby minimizing lost data and improving image quality. It will be able to maintain. In addition, since the compression ratio can be obtained by hardware that shares all compression ratios without using hardware for each compression ratio, cost reduction and miniaturization can be achieved.

【0040】本発明は、画像データを前処理し、この出
力を量子化し、この量子化出力を可変長符号化する符号
化装置において、前記量子化の量子化幅を目的の符号量
に応じて最適値に可変設定することを特徴としている。
According to the present invention, in a coding apparatus for pre-processing image data, quantizing the output, and variable-length encoding the quantized output, the quantization width of the quantization is set according to a target code amount. It is characterized by being variably set to an optimum value.

【0041】これにより画像データを目的の符号量に収
まるように最適量子化幅で量子化して、可変長符号化す
ることができるものであるが、画像データを前処理し、
この出力を量子化し、これを可変長符号化する場合、量
子化にあたっての量子化幅を変化させることにより、発
生する符号量が変化することは周知の事実である。これ
は、ハフマン符号化に代表される可変長符号化は、符号
化するデータの発生確率の偏りを利用してそのデータを
表現するのに必要な符号量を減少させることから、前記
「量子化幅を変化させる」と云うことは、量子化値の発
生確率を変化させると云うことでもあるから、量子化幅
を変化させることにより当然、発生符号量も変化する。
また、同じ量子化幅で同一の符号化を行っても、そのと
きの画像データによって発生符号量は異なる。しかし、
1つの画像データに対して量子化幅を変化させて同一の
符号化を行った場合は量子化幅と、発生符号量との間に
は一定の関係が得られる。また、多くの画像データで量
子化幅と発生符号量の関係を求めると、最も発生頻度の
高い関係が統計的に得られることが明らかになり、多く
の場合、次の関係が得られる。つまり、ある量子化幅に
対する相対的な比をSFとし、発生符号量1画素あたりの
ビット数(ビットレート)で表わし、BRとすると、 lo
g BR=a ×log SF+b なる関係になる。a は同一の符号
化であれば、画像によらず略一定であり、b は画像に依
存する。このb の値は画像により、一定の分布を持ち、
この発生頻度分布から代表的なb が得られる。
Thus, the image data can be quantized by the optimal quantization width so as to be within the target code amount and subjected to variable-length coding.
It is a well-known fact that when this output is quantized and is subjected to variable-length encoding, the amount of code generated varies by changing the quantization width in quantization. This is because variable-length coding represented by Huffman coding reduces the amount of code necessary to represent the data to be coded by utilizing the bias in the occurrence probability of the data to be coded. "To change the width" means to change the probability of occurrence of the quantized value. Therefore, by changing the quantization width, the generated code amount naturally changes.
Even if the same encoding is performed with the same quantization width, the generated code amount differs depending on the image data at that time. But,
When the same encoding is performed on one image data while changing the quantization width, a certain relationship is obtained between the quantization width and the generated code amount. Further, when the relationship between the quantization width and the generated code amount is obtained for a large amount of image data, it becomes clear that the relationship having the highest frequency of occurrence can be obtained statistically. In many cases, the following relationship is obtained. That is, SF is a relative ratio with respect to a certain quantization width, and is represented by the number of bits (bit rate) per pixel generated code amount.
g BR = a × log SF + b If a is the same encoding, it is substantially constant regardless of the image, and b depends on the image. The value of b has a certain distribution depending on the image,
Representative b is obtained from this occurrence frequency distribution.

【0042】本発明の特徴はこのような量子化幅と符号
量との関係を利用して目的の符号量に応じた量子化幅を
設定すると云うところにある。従って、本発明によれ
ば、目的符号量を変化させても、それに適応して符号量
が目的の符号量になるような量子化幅を与えることがで
きる最適量子化幅係数αを短時間で求めることができ、
早く目的符号量に圧縮できると共に、それぞれの目的符
号量の範囲内で最良な画質が得られるようにし、且つ、
ハードウェアのコストダウンと小形化を図ることの出来
る電子カメラ装置を提供できる。
A feature of the present invention resides in that a quantization width according to a target code amount is set using such a relationship between the quantization width and the code amount. Therefore, according to the present invention, even if the target code amount is changed, the optimum quantization width coefficient α that can provide a quantization width that allows the code amount to become the target code amount in a short time can be obtained. Can be sought,
It is possible to quickly compress to the target code amount, and to obtain the best image quality within the range of each target code amount, and
An electronic camera device capable of reducing hardware cost and size can be provided.

【0043】[0043]

【0044】[0044]

【0045】さらにまた、第4のケースは、撮影を行う
と、この画像(ディジタル化された画像)について、ブ
ロック化を行い、次に各ブロックについて順に直交変換
を行い、周波数成分別の係数データにし、この周波数成
分別の係数データを低周波数成分から順に暫定的な周波
数成分別量子化幅係数を用いての量子化を行い、これを
可変長符号化し、次にこれにより発生した総符号量と各
ブロック別符号量から最適な目的符号量を求め、この目
的符号量を各ブロック毎の発生符号量で配分して各ブロ
ック毎の割当符号量を求め、さらに前記発生した総符号
量と目的符号量から各周波数毎の最適量子化幅を決め、
前記撮影により得られた画像のブロック化を行い、次に
各ブロックについて順に直交変換を行い、周波数成分別
の係数データにし、この周波数成分別の係数データを低
周波数成分から順に前記決定した周波数成分別最適量子
化幅係数を用いての量子化を行い、これをハフマン符号
化し、次にこれにより発生した符号を、そのブロックで
の前記割当符号量を越えない範囲で記録し、割当符号量
を越える分は符号化を打ち切る。
Further, in the fourth case, when photographing is performed, this image (digitized image) is divided into blocks, and then orthogonal transformation is sequentially performed on each block to obtain coefficient data for each frequency component. Then, the coefficient data for each frequency component is quantized using the provisional quantization component for each frequency component in order from the low frequency component, and this is variable-length coded, and then the total code amount generated by this is calculated. And the optimal target code amount is obtained from the code amount for each block, and the target code amount is distributed by the generated code amount for each block to obtain the allocated code amount for each block. Determine the optimal quantization width for each frequency from the code amount,
The image obtained by the shooting is divided into blocks, and then orthogonally transformed for each block in order to obtain coefficient data for each frequency component, and the coefficient data for each frequency component is sequentially determined from the low frequency component. Perform quantization using another optimal quantization width coefficient, perform Huffman encoding on this, and then record the code generated by the Huffman encoding within the range not exceeding the allocated code amount in the block. Exceeding stops the encoding.

【0046】この構成は、一般的に同一の量子化幅を用
いて符号化したときに、符号量が多く発生する画像は高
周波成分を多く有しており、これを高圧縮、すなわち、
少ない符号量に圧縮することは、高周波成分の切り捨て
が多く発生することを意味し、画質を損なうことになる
が、符号量発生の少い画像は高圧縮を行っても比較的画
質は損なわれないと云う性質を利用し、画像毎に適した
圧縮率を上述のようにして自動的に設定するようにした
ものである。
In this configuration, generally, an image in which a large amount of code is generated when coding is performed using the same quantization width has many high-frequency components.
Compressing to a small code amount means that high frequency components are often truncated, which impairs image quality.However, an image with a small code amount is relatively impaired even if high compression is performed. By utilizing the property of no compression, a compression ratio suitable for each image is automatically set as described above.

【0047】[0047]

【実施例】以下、本発明の実施例を図面に基づいて説明
する。初めに本発明を分かり易くするために、本発明の
基本的な考え方を説明しておく。
Embodiments of the present invention will be described below with reference to the drawings. First, to make the present invention easy to understand, a basic concept of the present invention will be described.

【0048】すなわち、本発明は最初に1パス目の処理
として目的符号量に対応して計算した暫定的な量子化幅
係数により補正した量子化幅で量子化および符号化して
統計処理を行い、最適な量子化幅係数を予測すると共
に、ブロック毎の割り当て符号量を決定する。そして、
2パス目の処理として最終的な符号化処理を実施する。
2パス目は各ブロック毎に前記予測量子化幅係数により
量子化すると共に、これを符号化し、この符号化により
得られる符号量がブロック毎の割り当て符号量に収まる
ように、そのブロックについて符号量を監視しながら、
符号化を進め、EOB符号を含め、符号量が割当符号量
に達するとそのブロックの符号化は終了させて次のブロ
ックの符号化に移って行く。また、目的符号量に近い値
に早く収束させるために、低画質モード、高画質モード
と云った撮影モードにより変わる目的の符号量に応じ、
その符号量に近い符号量が得られる標準の量子化幅係数
αを上記第1パス目に与える機能を前記統計処理の系統
に予め持たせると云うものである。
That is, the present invention first performs statistical processing by quantizing and encoding with the quantization width corrected by the provisional quantization width coefficient calculated corresponding to the target code amount as the first pass processing, The optimal quantization width coefficient is predicted, and the code amount to be allocated for each block is determined. And
A final encoding process is performed as a process of the second pass.
In the second pass, while quantizing the prediction quantization width coefficient for each block and encoding the same, the code amount of the block is set so that the code amount obtained by this encoding falls within the allocated code amount for each block. While monitoring
The coding is advanced, and when the code amount including the EOB code reaches the allocated code amount, the coding of the block is terminated and the coding of the next block is started. Also, in order to quickly converge to a value close to the target code amount, according to the target code amount that changes depending on the shooting mode such as the low image quality mode and the high image quality mode,
The function of giving a standard quantization width coefficient α that can obtain a code amount close to the code amount in the first pass is previously provided in the statistical processing system.

【0049】統計処理は最適な量子化幅を予測すると共
に、ブロック毎の割当符号量を決定するものであり、最
適符号量の予測は符号化を行った時の符号量を粗く(し
かし、かなりの精度で)近付けるための処理である。こ
の最適化された量子幅を符号化処理で使用することで、
ほぼ目的の符号量に近付けることができるようになる。
そして、この時点で符号量が目的の符号量内に収まれ
ば、この処理だけで十分であるが、1画像のデータ量の
上限が規定されている場合、1バイトはおろか、1ビッ
トでも目的の符号量をオーバーすることはできない。そ
こで、オーバーしたときの処理法が必要になる。
The statistical processing predicts the optimal quantization width and determines the allocated code amount for each block. The prediction of the optimum code amount coarsely reduces the code amount at the time of encoding (but considerably This is a process for approaching (with the accuracy of). By using this optimized quantum width in the encoding process,
It becomes possible to approximate the target code amount.
At this point, if the code amount falls within the target code amount, this processing alone is sufficient. However, if the upper limit of the data amount of one image is specified, let alone one byte, let alone one byte, The code amount cannot be exceeded. Therefore, a processing method when the overrun is required is required.

【0050】それがブロック毎の割当符号量の決定であ
る。これは符号化を行ったときの符号量が目的の符号量
をオーバーした時の微調整に使用するデータを決定する
ためのものである。実際に符号化処理を統計処理におい
て予測した最適な量子化幅で実行した結果を見て、オー
バーしなかったときは終了、オーバーしたときは後処理
と云うようにしても良いが、その場合、統計処理、符号
化処理、後処理の3ステップとなり、時間がかかるばか
りでなく、符号化処理と後処理の間で、長さの異なる符
号を繋ぎ合わせることなく区別がつくように、保存する
必要が生じ、問題であるから、符号化処理の最中に微調
整を行うことが望まれる。しかし、無闇にデータを落と
すことは画質の劣化に繋がるので、避けねばならない。
That is the determination of the allocated code amount for each block. This is for determining data to be used for fine adjustment when the code amount at the time of encoding exceeds the target code amount. Looking at the result of actually executing the encoding process at the optimal quantization width predicted in the statistical process, if it does not exceed, it may end, and if it does, it may be called post-processing. There are three steps: statistical processing, encoding processing, and post-processing. Not only is it time-consuming, but it is also necessary to save the encoding processing and post-processing so that codes of different lengths can be distinguished without joining them. Occurs, which is a problem, and it is desired to perform fine adjustment during the encoding process. However, dropping data indiscriminately leads to deterioration of image quality, and therefore must be avoided.

【0051】そこで、本発明では各ブロックの高い周波
数成分から省略して行くことにより、視覚的な影響を最
小にする。ところが、符号量がオーバーするか否かは符
号化を終了してみないと分からないので、本発明ではそ
れを各ブロック毎に判定させるようにする。
Therefore, in the present invention, visual effects are minimized by omitting high frequency components in each block. However, it is impossible to determine whether or not the code amount is exceeded until the coding is completed. Therefore, in the present invention, it is determined for each block.

【0052】これは最適な量子化幅あるいは統計処理に
より予測された量子化幅を用いて符号化を行ったときに
発生する各ブロックの符号量において、各ブロックの発
生符号量の相対的な比率が、あまり変化しないことが実
験により確認されているので、これを利用する。すなわ
ち、統計処理で暫定的な量子化幅(これは目的の符号量
によって、ごく粗く予測することが可能)を用いて、符
号化を行うときに「これを越えない限り画像全体の符
号量が目的の符号量を越えない」と云うガイドラインを
設定し、このガイドラインを各ブロック毎の割当符号量
として監視の基準にする。
This is the relative ratio of the generated code amount of each block to the code amount of each block generated when encoding is performed using the optimum quantization width or the quantization width predicted by statistical processing. However, since it has been confirmed by experiments that it does not change much, this is used. In other words, when performing encoding using a tentative quantization width (which can be estimated very coarsely depending on the target code amount) in the statistical processing, when the encoding is performed , the code amount of the entire image unless it exceeds this Do not exceed the target code amount ", and this guideline is used as a reference for monitoring as the allocated code amount for each block.

【0053】このようにして量子化幅と各ブロック毎の
割当符号量が決まったならば、これに基づき符号化処理
を実施し、最終的な符号化を行う。本発明においては、
符号化処理では各ブロックにおいて、そのブロックの割
当符号量を越えないように各ブロックにおいて符号化を
打ち切る。
When the quantization width and the assigned code amount for each block are determined in this way, an encoding process is performed based on the quantization width and final encoding is performed. In the present invention,
In the encoding process, the encoding is terminated in each block so as not to exceed the allocated code amount of the block.

【0054】各ブロックの符号化において、低い周波数
成分から高い周波数成分に順次、符号化しながら、ガイ
ドライン(割当符号量)を越えないようにチェックす
る。オーバーしなかったブロックは問題なく符号化を終
了、つまり、EOB を出力する。途中でオーバーしてしま
ったブロックはそれ以上の高周波成分は符号化せず、符
号化を打ち切り、そのブロックの符号化を終了、つま
り、EOB を出力する。このとき、EOB もハフマン符号の
一つであるから、EOB も含めて割当符号量内に収まるよ
うにする必要がある。
In the coding of each block, it is checked so as not to exceed the guideline (the amount of code to be allocated) while sequentially coding from low frequency components to high frequency components. Blocks that do not exceed the end of coding without any problem, that is, output EOB. In the block that has been exceeded in the middle, the higher frequency components are not coded, and the coding is terminated, and the coding of the block is terminated, that is, the EOB is output. At this time, since the EOB is one of the Huffman codes, it is necessary to include the EOB within the allocated code amount.

【0055】このようにして、例えば、半数のブロック
は打ち切る必要無く符号化を終了し、残りの半数はごく
高い周波数の一部が省略されて、符号化を終了したとす
れば、欠落する情報は極めてわずかであり、しかも、欠
落するのは視覚的に影響の少ない高い周波数成分の情報
にとどめることができる。そして、この方式により統計
処理、符号化処理の2ステップで必ず符号化を終了する
ことができ、総符号量を規定値内に収めることができる
ようになり、しかも、指定される総符号量の範囲内で画
質の劣化も抑制できる。
In this way, for example, if half of the blocks have completed encoding without having to be truncated, and the other half have omitted a part of the extremely high frequency and have completed encoding, the missing information will be lost. Is extremely small, and the missing information can be limited to information of high frequency components which have little visual influence. With this method, encoding can be always terminated in two steps of statistical processing and encoding processing, so that the total code amount can be kept within a specified value. Deterioration of image quality can be suppressed within the range.

【0056】以上の原理を用いた装置の実施例を説明す
る。図1に本発明による画像データの符号化装置を内蔵
したディジタル電子カメラの一実施例を、また、図2に
は本発明による画像データの符号化装置の構成をそれぞ
れブロック図で示す。なお、本発明とは直接関係のない
ディジタル電子カメラの機構は図示および説明を省略す
る。
An embodiment of the apparatus using the above principle will be described. FIG. 1 is a block diagram showing an embodiment of a digital electronic camera having a built-in image data encoding apparatus according to the present invention, and FIG. 2 is a block diagram showing the configuration of an image data encoding apparatus according to the present invention. The illustration and description of the mechanism of the digital electronic camera that is not directly related to the present invention is omitted.

【0057】図1に示すように、電子カメラ本体1は画
像を撮像する撮像系40と、この撮影系40の出力に対し、
所定の信号処理を行う信号処理回路60と、前処理、線形
量子化、エントロピー符号化機能を持ち、前記信号処理
回路60の出力を圧縮符号化して出力する符号化回路80
と、この符号化回路80により符号化された画像データお
よび量子化幅(またはこれに対応した情報)を記録媒体
71に記録する記録系70と、所望のデータ圧縮率を設定入
力するスイッチ30、システム全体の制御を司る制御回路
90とから構成される。
As shown in FIG. 1, the electronic camera body 1 has an image pickup system 40 for picking up an image and an output of the image pickup system 40.
A signal processing circuit 60 that performs predetermined signal processing; and an encoding circuit 80 that has pre-processing, linear quantization, and entropy encoding functions, and that compresses and encodes the output of the signal processing circuit 60 and outputs the result.
And the image data encoded by the encoding circuit 80 and the quantization width (or information corresponding thereto) on a recording medium.
A recording system 70 for recording data on the switch 71, a switch 30 for setting and inputting a desired data compression ratio, and a control circuit for controlling the entire system
90.

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

【0059】前記撮像系40は光学像を結像するためのレ
ンズ40a と、CCD 等の撮像素子40b とを備える。前記信
号処理回路60は増幅およびノイズ除去等を行うアンプ60
a と、アナログ信号をディジタル信号に変換するA/D 変
換器60b と、RAM 等からなるバッファメモリ60c と、色
信号形成等をプロセス回路60d とを備える。符号化回路
80は例えば、DCT (離散コサイン変換)等の直交変換を
行う直交変換部4、線形量子化を行う量子化部6、エン
トロピー符号化としてハフマン符号化を行うハフマン符
号化部8を備え、更に量子化幅予測部12,符号量算出部
14、符号量割当部20、符号打切り部16および符号化回路
80内の制御処理を行う制御回路18とを有している。
The image pickup system 40 has a lens 40a for forming an optical image and an image pickup device 40b such as a CCD. The signal processing circuit 60 includes an amplifier 60 for performing amplification, noise removal, and the like.
a, an A / D converter 60b for converting an analog signal into a digital signal, a buffer memory 60c such as a RAM, and a process circuit 60d for forming color signals. Encoding circuit
80 includes, for example, an orthogonal transformation unit 4 for performing orthogonal transformation such as DCT (discrete cosine transformation), a quantization unit 6 for performing linear quantization, and a Huffman encoding unit 8 for performing Huffman encoding as entropy encoding. Width prediction unit 12, code amount calculation unit
14, code amount allocating unit 20, code truncating unit 16, and coding circuit
And a control circuit 18 for performing control processing in 80.

【0060】前記記録系70はインタフェ−ス回路70a お
よび記録媒体として用いられるICメモリを内蔵したメモ
リカード71とからなる。メモリカード71は電子カメラ本
体1に対し、着脱可能となっている。制御回路90はマイ
クロプロセッサ(MPU) により実現されている。
The recording system 70 comprises an interface circuit 70a and a memory card 71 containing an IC memory used as a recording medium. The memory card 71 is detachable from the electronic camera body 1. The control circuit 90 is realized by a microprocessor (MPU).

【0061】図6に電子カメラ本体1の外観を斜視図で
示す。図は双眼鏡形のものを示しており、48は操作部に
おけるLCD (液晶)表示器、30は操作部におけるスイッ
チ30であり、その他、テレ・ワイド切り替えスイッチ、
シャッタ操作ボタン50等が設けられている。また、49は
ファインダである。LCD 表示器48には制御回路90の制御
のもとに撮影モードやコマ数、日付、時間等、種々の値
や状態が表示される。本電子カメラでは、電子カメラ本
体1の操作部に設けられたスイッチ30を操作することに
より、画像の圧縮率を所望の値に設定することができ
る。すなわち、制御回路90には予め標準的な複数種の圧
縮率情報が設定されており、これがスイッチ30の操作に
より設定される撮影可能枚数の値をもとに、装着されて
いるメモリカード(記録媒体)の容量から、適用する圧
縮率を求め、この求めた圧縮率の値およびメモリカード
に記録できる画像の枚数の値に換算されて操作部のLCD
表示器48に表示させるようになっている。そして、ユー
ザがスイッチ30を押すと、制御回路90はスイッチ30が押
される毎に、これらの値を変更する。
FIG. 6 is a perspective view showing the external appearance of the electronic camera body 1. The figure shows a binocular type, 48 is an LCD (liquid crystal) display in the operation unit, 30 is a switch 30 in the operation unit, and a tele-wide switch,
A shutter operation button 50 and the like are provided. 49 is a finder. Under the control of the control circuit 90, the LCD display 48 displays various values and states such as a shooting mode, the number of frames, date and time. In this electronic camera, the image compression ratio can be set to a desired value by operating the switch 30 provided on the operation unit of the electronic camera body 1. That is, standard plural types of compression ratio information are set in the control circuit 90 in advance, and based on the value of the number of recordable images set by the operation of the switch 30, this is set in the attached memory card (recording The compression rate to be applied is obtained from the capacity of the medium, and is converted into the value of the obtained compression rate and the value of the number of images that can be recorded on the memory card.
The display 48 displays the information. Then, when the user presses the switch 30, the control circuit 90 changes these values each time the switch 30 is pressed.

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

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

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

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

【0066】本実施例では、輝度系 Yのデータを読出し
てブロック化し、後段の処理系に与えて、この Y成分デ
ータについての統計処理を行わせ、該統計処理が終了し
たならば、次にクロマ系Cr、Cb成分のデータについての
統計処理に入るべく該クロマ系Cr、Cb成分のデータの読
出しとブロック化に入る。クロマ系のブロック化は、最
初にCr成分の画像データについてすべてのブロック化を
行い、その後に、Cb成分の画像データをブロック化して
行くものとする。
In this embodiment, the data of the luminance system Y is read out and divided into blocks, which are supplied to a subsequent processing system to perform statistical processing on the Y component data. In order to start the statistical processing for the data of the chroma Cr and Cb components, the data of the chroma Cr and Cb components is read out and blocked. In the chroma blocking, it is assumed that all the image data of the Cr component are firstly blocked, and then the image data of the Cb component is blocked.

【0067】符号化回路80は図2に示す構成となってい
る。図2において、4は直交変換回路であり、ブロック
化されて入力された各画像データを受けて、この画像デ
ータに対し、各ブロック毎に2次元の直交変換を行うも
のである。直交変換としてはコサイン変換、サイン変
換、フーリエ変換、アダマール変換などが使用できる。
直交変換を行うことにより、変換係数としての画像デー
タが得られる。
The encoding circuit 80 has the configuration shown in FIG. In FIG. 2, reference numeral 4 denotes an orthogonal transformation circuit, which receives each image data which has been input as a block, and performs two-dimensional orthogonal transformation on the image data for each block. As the orthogonal transform, cosine transform, sine transform, Fourier transform, Hadamard transform and the like can be used.
By performing the orthogonal transform, image data as a transform coefficient is obtained.

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

【0069】8はエントロピー符号化回路であり、エン
トロピー符号化回路8は量子化回路6の出力する前記量
子化出力をエントロピー符号化(可変長符号化)するも
のである。エントロピー符号化としてはハフマン符号
化、算術符号化などを利用する。エントロピー符号化は
可変長符号化であるために、ブロック毎の符号量画像全
体の符号量などが画像毎に変化する。どのようなエント
ロピー符号化を用いるかは本発明とは直接関係が無い
が、ここではハフマン符号化を使用した一例を示すこと
とする。
Reference numeral 8 denotes an entropy coding circuit. The entropy coding circuit 8 performs entropy coding (variable length coding) on the quantized output output from the quantization circuit 6. Huffman coding, arithmetic coding and the like are used as entropy coding. Since entropy coding is variable-length coding, the code amount of the entire code amount image for each block changes for each image. Although what kind of entropy coding is used is not directly related to the present invention, an example using Huffman coding will be described here.

【0070】エントロピー符号化回路8では、入力した
量子化された変換係数を図9に示す順序でスキャンする
ジグザグ・スキャンと呼ばれる手法により、低い周波数
成分から高い周波数成分への走査を行う。図9の走査順
序の 1番目の直流成分[DC]のデータは、直前にエント
ロピー符号化を行ったブロックの直流成分との差分値を
ハフマン符号化して出力する。交流成分[AC]について
は図9の走査順序の2番目から64番目まで順番に変換係
数を見て行き、変換係数が0でない(すなわち、(ゼロ
ラン)とその有効係数の値とで2次元のハフマン符号化
して出力すると云った動作をする。また、ある係数以降
64番目の係数まで連続して無効係数が続く場合はブロッ
クの終りを示すEOB (エンド・オブ・ブロック)の符号
を出力する。また、打ち切り信号が入力されると符号化
を終了し、EOB を付加して出力する。そして、そのブロ
ックについて発生した符号量を符号量算出回路14に出力
する。
The entropy encoding circuit 8 scans from the low frequency components to the high frequency components by a method called zigzag scanning in which the input quantized transform coefficients are scanned in the order shown in FIG. The data of the first DC component [DC] in the scanning order in FIG. 9 outputs a difference value from the DC component of the block on which entropy coding has been performed immediately before, by Huffman coding. Regarding the AC component [AC], the conversion coefficients are looked up in order from the second to the 64th in the scanning order in FIG. 9, and the conversion coefficient is not 0 (ie, (zero run) and the value of its effective coefficient are two-dimensional. The operation is to perform Huffman encoding and output.
If an invalid coefficient continues up to the 64th coefficient, an EOB (end of block) code indicating the end of the block is output. When the censor signal is input, the coding is terminated, and EOB is added and output. Then, the code amount generated for the block is output to the code amount calculation circuit 14.

【0071】符号量算出回路14は入力された Y、Cr、Cb
各成分の各ブロック毎の符号量とその符号量の積算を行
い、 Y、Cr、Cb各成分の各ブロック毎の符号量データの
収集と画像全体の符号量を計算し、この画像全体の符号
量のデータについて量子化幅予測回路12に出力すると共
に、各ブロック毎の符号量と画像全体の符号量のデータ
については符号量割当て回路20に出力する構成としてあ
る。
The code amount calculation circuit 14 receives the input Y, Cr, Cb
The code amount for each block of each component and the integration of the code amount are performed, the code amount data for each block of each component of Y, Cr, and Cb are collected, and the code amount of the entire image is calculated. The data of the amount is output to the quantization width prediction circuit 12, and the data of the code amount of each block and the code amount of the entire image are output to the code amount allocating circuit 20.

【0072】量子化幅予測回路12は第1パス目の開始に
あたり制御回路18から目的とする符号量の情報を受け、
この符号量情報から後述する式(1) の関係を用いて量子
化幅係数αの初期値を設定し、量子化回路6に出力し、
第2パス目の開始に先駆けて、符号量算出回路14から入
力された画像全体の符号量と、1画像当りの許容される
最大のデータ量である目標符号量とから、例えば、ニュ
ートン‐ラプソン法(Newton-Raphson iteration)を用
いて、目標符号量に近づけるのに最適な量子化幅係数α
を、今回実際に使用した量子化幅係数を勘案して予測す
るものである。
At the start of the first pass, the quantization width prediction circuit 12 receives information on the target code amount from the control circuit 18,
From the code amount information, an initial value of the quantization width coefficient α is set by using the relationship of Expression (1) described later, and output to the quantization circuit 6,
Prior to the start of the second pass, the code amount of the entire image input from the code amount calculation circuit 14 and the target code amount which is the maximum allowable data amount per image are calculated based on, for example, Newton-Raphson Quantization width coefficient α that is optimal for approaching the target code amount using the Newton-Raphson iteration
Is predicted in consideration of the quantization width coefficient actually used this time.

【0073】また、符号量割当回路20は符号量算出回路
14から入力された各ブロック毎の画像データの符号量、
画像全体の符号量と、目標符号量とから各ブロックの割
当符号量を算出して符号化打切回路16に出力するもので
ある。
The code amount allocating circuit 20 is a code amount calculating circuit.
Code amount of image data for each block input from 14,
The code amount assigned to each block is calculated from the code amount of the entire image and the target code amount, and the calculated code amount is output to the coding truncation circuit 16.

【0074】ここでの算出の方法は、例えば、各ブロッ
ク毎の符号量の比で、目標符号量を比例配分する。例え
ば、あるブロックの符号量と目標符号量との乗算を行
い、それを画像全体の符号量で割ることにより、そのブ
ロックの割当符号量を決定する。この結果、各ブロック
の割り当て符号量は、そのブロックでの実際の符号量に
応じて符号量が少ない場合はそれ相応に、間に合う程度
に抑えられ、符号量の多いブロックにはそれ相応に多く
割り当てられる。
In this calculation method, the target code amount is proportionally distributed, for example, by the ratio of the code amount for each block. For example, the code amount of a certain block is multiplied by the target code amount, and the result is divided by the code amount of the entire image to determine the allocated code amount of the block. As a result, the code amount allocated to each block is appropriately suppressed when the code amount is small according to the actual code amount in the block, and the code amount allocated to the block with a large code amount is correspondingly large. Can be

【0075】符号量割当回路20は符号量情報テーブルと
ブロック割当符号量データテーブルとを持ち、符号量情
報テーブルにおける該当ブロック位置の符号量情報を符
号量算出回路14から入力された符号量情報に書き替える
一方、符号量算出回路14から入力された各ブロック毎の
符号量および画像全体の符号量と、目標符号量とから各
ブロックの割当符号量を算出し、この算出した各ブロッ
クの割当符号量のデータをブロック割当符号量データテ
ーブルに格納する。
The code amount allocating circuit 20 has a code amount information table and a block allocated code amount data table. The code amount information of the corresponding block position in the code amount information table is added to the code amount information input from the code amount calculating circuit 14. On the other hand, on the other hand, the allocated code amount of each block is calculated from the code amount of each block and the code amount of the entire image input from the code amount calculation circuit 14 and the target code amount, and the calculated allocated code of each block is calculated. The amount data is stored in the block allocation code amount data table.

【0076】このブロック割当符号量データテーブルの
各ブロック別割当符号量は、該当のブロックがエントロ
ピー符号化処理される際に符号化打切回路16に与えられ
る。
The allocated code amount for each block in the block allocated code amount data table is supplied to the coding truncation circuit 16 when the corresponding block is subjected to entropy coding processing.

【0077】符号化打切回路16は、符号量割当回路20か
らの各ブロックの符号量を割当符号量から減算し、割当
符号量の残りが送出すべき符号量とEOB の符号との合計
符号量より小さくなった場合には打切り信号を出力して
エントロピー符号化回路8に与え、そのブロックの符号
化を終了させると云った機能を有する。
The coding truncation circuit 16 subtracts the code amount of each block from the code amount allocation circuit 20 from the allocated code amount, and the remainder of the allocated code amount is the total code amount of the code amount to be transmitted and the EOB code. When it becomes smaller, a function of outputting an abort signal and supplying it to the entropy encoding circuit 8 to terminate the encoding of the block is provided.

【0078】従って、符号化打切回路16ではこの割当符
号量を参照し、入力された送出すべき符号量およびEOB
の符号を送出しても割当符号量を越えない場合は、打切
りは行われず、そのブロックの符号化を終了し、該ブロ
ックの割当符号量から送出すべき符号量を減ずると云っ
た動作を行う。
Therefore, the coding truncation circuit 16 refers to the allocated code amount, and inputs the code amount to be transmitted and the EOB
If the code amount does not exceed the allocated code amount even if the code is transmitted, the truncation is not performed, the coding of the block is terminated, and an operation of reducing the code amount to be transmitted from the allocated code amount of the block is performed. .

【0079】10は符号出力回路であり、この符号出力回
路10はエントロピー符号化回路8より入力される可変長
の符号をつなぎ合わせるもので、この繋ぎ合わせた符号
をメモリカード等の記録媒体にて構成される記録系22に
書き込むように機能する。
Reference numeral 10 denotes a code output circuit. The code output circuit 10 connects variable-length codes input from the entropy coding circuit 8, and connects the connected codes to a recording medium such as a memory card. It functions to write to the configured recording system 22.

【0080】本システムでは撮影モードに応じて定めた
初期時用標準の量子化幅係数αを使用して最初に統計処
理を行い(第1パス)、最適化するに必要なブロック毎
の情報量や画像全体の情報量等を調べ、次にこの統計処
理により得た情報をもとに最適化された符号化を行うた
めの処理に入る(第2パス)。
In this system, statistical processing is first performed (first pass) using the standard quantization width coefficient α for the initial time determined according to the shooting mode, and the amount of information for each block necessary for optimization is obtained. And the amount of information of the entire image is checked, and then the process enters into a process for performing an optimized coding based on the information obtained by the statistical process (second pass).

【0081】そのため、最初に画像のブロック化、この
ブロック化された画像の要素に対する標準の量子化幅係
数αを使用しての量子化、量子化により得られた変換係
数のエントロピー符号化、そして、このエントロピー符
号化により得られる各ブロックの各要素の符号量情報と
画像全体の符号量情報より最適な符号量にするに必要な
符号化幅係数αの予測、各ブロックの各要素における割
当符号量の決定、これらに基づく処理対象画像への最適
符号化の処理モードへの移行、この処理モードの実施に
おける画像のブロック化処理、このブロック化された画
像の要素に対する前記予測量子化幅αを使用しての量子
化処理、この量子化により得られた変換係数のエントロ
ピー符号化、処理対象画像の全符号の保存のための出力
処理と云った手順を実施させるが、その全体の制御管理
は図における制御回路18により行うようにしてあるもの
とする。尚、制御回路18のこのような機能はマイクロプ
ロセッサ(CPU)を使用することで容易に実現でき
る。以上が符号化回路80の構成である。
Therefore, first, image blocking, quantization using the standard quantization width coefficient α for the elements of the blocked image, entropy coding of the transform coefficients obtained by quantization, and , Prediction of the coding width coefficient α required for obtaining the optimum code amount from the code amount information of each element of each block obtained by this entropy coding and the code amount information of the entire image, and the assigned code in each element of each block. Determination of the amount, transition to the processing mode of the optimal coding for the image to be processed based on these, the blocking processing of the image in the execution of this processing mode, the predicted quantization width α for the elements of the blocked image Procedures such as quantization processing used, entropy coding of transform coefficients obtained by this quantization, and output processing for storing all codes of the image to be processed. Thereby subjected, but it is assumed that the entire control management are to perform by the control circuit 18 in FIG. Note that such a function of the control circuit 18 can be easily realized by using a microprocessor (CPU). The above is the configuration of the encoding circuit 80.

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

【0083】次に上記構成の本装置の作用を説明する
が、全体の概要を掴むために初めに動作遷移図である図
8を参照して基本動作を説明する。カメラの使用者がカ
メラを使用するにあたり、スイッチ30を操作して所望と
する撮影可能枚数を設定する。これにより設定撮影可能
枚数に応じ、制御回路90が最適符号量を求めて、これを
目的符号量設定情報として符号化回路80に与えることで
実現している。このようにして撮影可能枚数が設定され
る。
Next, the operation of the present apparatus having the above-described configuration will be described. First, the basic operation will be described with reference to FIG. When the camera user uses the camera, the user operates the switch 30 to set a desired number of recordable images. Thus, the control circuit 90 obtains the optimum code amount in accordance with the set number of recordable images, and supplies this to the encoding circuit 80 as target code amount setting information. Thus, the number of shootable images is set.

【0084】次に撮影を行うと、撮影レンズ40a の後方
に置かれた撮像素子40b 上に、被写体像が光学像として
結像される。そして、この撮像素子40b はこの結像され
た光学像を画像信号に変換して出力する。撮像素子40b
により得られた画像信号は信号処理回路60に入力されこ
こで信号処理回路60内の増幅回路60a による増幅、A/D
変換器60b によるA/D 変換後、バッファメモリ60c に一
時保持される。そして、この後、バッファメモリ60c か
ら読み出され、信号処理回路60内のプロセス回路60d に
より帯域補正、色信号形成等の処理が行われる。
Next, when photographing is performed, a subject image is formed as an optical image on the image pickup device 40b placed behind the photographing lens 40a. The imaging device 40b converts the formed optical image into an image signal and outputs the image signal. 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 A / D
After A / D conversion by the converter 60b, the data is temporarily stored in the buffer memory 60c. Thereafter, the data is read from the buffer memory 60c, and the process such as band correction and color signal formation is performed by the process circuit 60d in the signal processing circuit 60.

【0085】ここで、後の符号化処理が Y(輝度)、C
r,Cb(いずれも色差)信号の順序で行われるため、色
信号形成もこれに合わせて行われる。すなわち、画像信
号は8×8のマトリックスでブロック化されて読み出さ
れ、プロセス回路ではこのブロック化された画像信号デ
ータから Y成分、Cr成分(R-Y 成分) 、Cb成分(B-Y 成
分)の順序でこれら各色成分の信号を分離させると共に
ガンマ補正やホワイトバランス処理等を行う。
Here, the following encoding processing is performed for Y (luminance),
Since the r and Cb (both color difference) signals are performed in this order, the color signal formation is also performed in accordance with this. That is, the image signal is read by being blocked in an 8 × 8 matrix, and the process circuit uses the blocked image signal data in the order of Y component, Cr component (RY component), and Cb component (BY component). These signals of each color component are separated, and gamma correction and white balance processing are performed.

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

【0087】本実施例では、信号処理回路60からは1画
像分の画像信号データにおける Y成分(輝度成分)につ
いて出力が行われ、これについての後段での処理(統計
処理)が済んだ後に、次にCr成分の画像データについて
総てのブロック化を行い、これについて後段での統計処
理を行い、その後に、Cb成分の画像をブロック化し、こ
れについて後段での統計処理を行ってゆくと云った処理
を行う。符号化回路80では信号処理回路60より受けたこ
の入力データを直交変換回路4に与える。
In this embodiment, the Y component (luminance component) of the image signal data for one image is output from the signal processing circuit 60, and after the subsequent processing (statistical processing) for this is completed, Next, it is said that all blocking is performed on the image data of the Cr component, statistical processing is performed on the block at a later stage, and then the image of the Cb component is blocked, and the statistical processing is performed on the block at a later stage. Perform the following processing. The encoding circuit 80 supplies the input data received from the signal processing circuit 60 to the orthogonal transformation circuit 4.

【0088】すると、直交変換回路4はブロック化され
た入力画像データ(以下、ブロック画像データと呼ぶ)
に対し、各ブロック毎に例えば、離散コサイン変換(DC
T) による2次元の直交変換を行う。このDCT による直
交変換と云うのは、ある波形を周波数成分に分割し、こ
れを入力サンプル数と同じ数だけのコサイン波で表現す
ると云った処理である。
Then, the orthogonal transform circuit 4 outputs the input image data which is divided into blocks (hereinafter, referred to as block image data).
For each block, for example, discrete cosine transform (DC
T) performs two-dimensional orthogonal transformation. The orthogonal transform by DCT is a process of dividing a certain waveform into frequency components and expressing this by the number of cosine waves equal to the number of input samples.

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

【0090】すると量子化回路6はこのブロック画像デ
ータ(変換係数)に対して1パス目(第1回目)の量子
化を行う。この第1回目の量子化では、予め設定された
各周波数成分毎(周波数成分はブロックの各マトリック
ス位置に対応して決まる)の量子化マトリックスに対
し、撮影に当り使用者が設定した画質設定値に対応して
制御回路18より与えられる標準(暫定)の量子化幅係数
αを掛けた量子化幅で、変換係数の量子化を行う(図8
(h1 ,i))。この時の量子化マトリックスは輝度系とク
ロマ系とでそれぞれで同じであっても良いが、それぞれ
に適した量子化マトリックスを設定する方が良い結果が
得られる。
Then, the quantization circuit 6 performs the first pass (first pass) quantization on the block image data (transform coefficients). In the first quantization, an image quality set value set by a user upon photographing is applied to a predetermined quantization matrix for each frequency component (frequency components are determined corresponding to each matrix position of a block). The quantization of the transform coefficient is performed by the quantization width obtained by multiplying the standard (temporary) quantization width coefficient α given by the control circuit 18 in correspondence with the processing (FIG. 8).
(h1, i)). The quantization matrix at this time may be the same for each of the luminance system and the chroma system. However, better results can be obtained by setting appropriate quantization matrices.

【0091】量子化されたブロック画像データ(変換係
数)はエントロピー符号化回路8に入力され、ここで、
エントロピー符号化される。エントロピー符号化回路8
では量子化されて入力された変換係数を図8に示す順序
でジグザグスキャンし、低い周波数成分から高い周波数
成分への走査を行う。すなわち、変換係数は8×8のマ
トリックスに周波数成分に対応して格納されており、原
点に近いほど、周波数が低いので、ジグザグスキャンす
ることで低い周波数成分から高い周波数成分へと走査で
きる。
The quantized block image data (transformation coefficient) is input to an entropy encoding circuit 8, where
Entropy coded. Entropy coding circuit 8
Then, the quantized and inputted transform coefficients are zigzag-scanned in the order shown in FIG. 8 to scan from low frequency components to high frequency components. That is, the transform coefficients are stored in a 8.times.8 matrix corresponding to the frequency components. Since the frequency is lower as the position is closer to the origin, zigzag scanning enables scanning from a lower frequency component to a higher frequency component.

【0092】図9の走査順序の1番目のデータは直流成
分DCであるから、この直流成分DCのデータは直前にエン
トロピー符号化を行ったブロック(一つ前のブロック)
の直流成分DCとの差分値diff-DC をハフマン符号化する
(図8(d1),(e1))。
Since the first data in the scanning order in FIG. 9 is the DC component DC, the data of this DC component DC is the block (the immediately preceding block) on which entropy coding was performed immediately before.
The difference value diff-DC from the DC component DC is subjected to Huffman coding (FIGS. 8 (d1) and (e1)).

【0093】交流成分ACについては図9の走査順序の 2
番目から64番目まで順番に変換係数を見て行き、変換係
数が0でない(すなわち、有効な)係数が出て来たらそ
の直前に存在した連続した0(無効)の係数の数(ゼロ
ラン)とその有効係数の値とで2次元のハフマン符号化
を行う((d2),(e2))。
The AC component AC is the same as that in the scanning order shown in FIG.
Look at the transform coefficients in order from the 64th to the 64th, and if a transform coefficient that is not 0 (ie, valid) comes out, the number of consecutive 0 (invalid) coefficients that existed immediately before (zero run) and Two-dimensional Huffman coding is performed with the value of the effective coefficient ((d2), (e2)).

【0094】また、エントロピー符号化回路8は、ある
係数以降64番目の係数まで連続して無効係数が続く場合
はブロックの終りを示すEOB (エンド・オブ・ブロッ
ク)の符号を与える。
Further, the entropy encoding circuit 8 gives an EOB (end of block) code indicating the end of a block when an invalid coefficient continues from a certain coefficient up to the 64th coefficient.

【0095】そして、そのブロックについて発生した符
号量を符号量算出回路14に出力する(g1)。そして、1画
像分の全ブロックについてこのような処理を実行して行
く。
Then, the code amount generated for the block is output to the code amount calculation circuit 14 (g1). Then, such processing is executed for all blocks of one image.

【0096】Y成分についてのこのような処理が終了し
たなら、次にCr、Cb各成分についても同様の処理を行
う。一方、符号量算出回路14は入力された Y、Cr、Cb各
成分の1画像全体の符号量の計算をすべく、 Y、Cr、Cb
各成分の各ブロック毎の符号量の算出とその符号量の積
算を行う(g2)と共に、各ブロック毎の符号量のデータは
符号量割当回路20に出力する。符号量割当回路20はこの
各ブロック毎の符号量のデータを符号量情報テーブルに
おける該当ブロック位置の符号量情報として書き込む。
When such processing for the Y component is completed, similar processing is performed for each of the Cr and Cb components. On the other hand, the code amount calculation circuit 14 calculates Y, Cr, and Cb in order to calculate the code amount of one input image of each of the input Y, Cr, and Cb components.
The calculation of the code amount of each block of each component and the integration of the code amount are performed (g2), and the data of the code amount of each block is output to the code amount allocation circuit 20. The code amount allocating circuit 20 writes the code amount data for each block as code amount information of the corresponding block position in the code amount information table.

【0097】そして、1画像分の全ブロックについて
Y、Cr、Cb各成分すべてのハフマン符号化処理を終了し
た段階で、制御回路18の制御により符号量算出回路14
は、この画像全体の符号量のデータを量子化幅予測回路
12に出力すると共に、画像全体の符号量のデータを、符
号量割当回路20に出力する。
Then, for all blocks of one image
At the stage where the Huffman encoding process for all the Y, Cr, and Cb components is completed, the code amount calculation circuit 14 is controlled by the control circuit 18.
Is the quantization width prediction circuit
In addition to outputting to the code amount data, the code amount data of the entire image is output to the code amount assignment circuit 20.

【0098】量子化幅予測回路12はこの入力された画像
全体の符号量データと目標符号量データとから、例え
ば、Newton-Raphson iteration法を用いて、目標符号量
の値に近づけるのに最適な量子化幅係数αを、実際に使
用した量子化幅係数に基づいて予測する(図8(h2))。
The quantization width prediction circuit 12 uses the input code amount data of the entire image and the target code amount data by using, for example, the Newton-Raphson iteration method to optimize the code amount close to the target code amount. The quantization width coefficient α is predicted based on the actually used quantization width coefficient (FIG. 8 (h2)).

【0099】また、符号量割当回路20は入力された各ブ
ロック毎の符号量および画像全体の符号量と、目標符号
量とから各ブロックの割当符号量を、例えば各ブロック
毎の符号量の比で、目標符号量を比例配分する等して算
出する(図8(h3))。具体的には、あるブロックの割当
符号量を決定するには、当該ブロックの符号量と目標符
号量とを乗算し、それを画像全体の符号量で割ることで
得た結果を以て割当符号量とする。そして、この算出し
た各ブロックの割当符号量のデータをブロック割当符号
量データテーブルに格納する。このブロック割当符号量
データテーブルの各ブロック別割当符号量のデータは、
該当のブロックがエントロピー符号化処理される際に符
号化打切回路16に与えられることになる。
The code amount allocating circuit 20 determines the allocated code amount of each block from the input code amount of each block, the code amount of the entire image, and the target code amount, for example, the ratio of the code amount of each block. Then, the target code amount is calculated by, for example, proportional distribution (FIG. 8 (h3)). Specifically, to determine the allocated code amount of a block, the code amount of the block is multiplied by the target code amount, and the result obtained by dividing the result by the code amount of the entire image is used as the allocated code amount. I do. Then, the data of the calculated allocated code amount of each block is stored in the block allocated code amount data table. The data of the allocated code amount for each block in the block allocated code amount data table is as follows:
When the corresponding block is subjected to the entropy coding process, the block is supplied to the coding truncation circuit 16.

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

【0101】次に2パス目の処理に入る。この2パス目
の処理は第2の符号化(符号化処理)であり、目標符号
量に収まるように最適化した最終の符号化出力を得る処
理である。
Next, the process enters the second pass. The processing of the second pass is the second encoding (encoding processing), and is the processing of obtaining the final encoded output optimized to be within the target code amount.

【0102】この処理はまず、 Y成分について行い、 Y
成分が終了した後にCr,Cb成分について行うようにす
る。すなわち、初めに画像データをブロック化して読出
し、これについて抽出されて信号処理回路60から出力さ
れる Y成分(輝度系)の画像信号データを符号化回路80
に入力する(a) 。入力されたブロック化画像データは符
号化回路80における直交変換回路4に入力され、再び直
交変換が行われる(b) 。この直交変換により得られた変
換係数は量子化回路6に入力され、再び量子化が行われ
る(c) 。ただし、このとき使用する量子化幅係数αは前
回のパスにおいて量子化幅予測回路12が算出した予測の
最適量子化幅係数αである。
This processing is first performed for the Y component.
After the completion of the components, the process is performed for the Cr and Cb components. That is, first, the image data is divided into blocks and read out, and the Y-component (luminance-based) image signal data extracted and output from the signal processing circuit 60 is encoded.
(A). The input block image data is input to the orthogonal transform circuit 4 in the encoding circuit 80, and the orthogonal transform is performed again (b). The transform coefficient obtained by the orthogonal transform is input to the quantization circuit 6, where the quantization is performed again (c). However, the quantization width coefficient α used at this time is the optimum quantization width coefficient α for the prediction calculated by the quantization width prediction circuit 12 in the previous pass.

【0103】次に、量子化したブロック画像データの変
換係数は、エントロピー符号化回路8に入力される。エ
ントロピー符号化は統計処理の時と同様、このブロック
画像データの変換計数のうち、まず直流成分DCの差分値
diff-DC をハフマン符号化し((d1),(e1))、次に交流
成分ACをジグザグスキャンで順次データ抽出して2次元
のハフマン符号化を行う((d2),(e2))。
Next, the quantized transform coefficients of the block image data are input to the entropy encoding circuit 8. In the entropy coding, as in the case of the statistical processing, the difference value of the DC component DC is first included in the conversion count of the block image data.
The diff-DC is Huffman-coded ((d1), (e1)), and the AC component AC is sequentially extracted by zigzag scanning to perform two-dimensional Huffman coding ((d2), (e2)).

【0104】但し、一つの要素(マトリックス内の一つ
の位置)に対するハフマン符号が発生する度に符号量割
当回路20から、そのブロック割当符号量データテーブル
に格納されている当該要素位置における送出すべき割当
符号量を符号化打切回路16に出力し、一方、符号化打切
回路16ではこの各ブロックの割当符号量をもとに、送出
すべき符号量およびEOB の符号を送出しても割当符号量
を越えない場合は、打切り信号を発生せず、該ブロック
の割当符号量から送出すべき符号量を減ずる処理を行
う。そして、送出すべき該ブロックの符号量とEOB の符
号との合計の符号量が割当符号量の残りの符号量を上ま
わったときに、符号化打切回路16はエントロピー符号化
回路8に打切り信号を出力し、そのブロックのハフマン
符号化を終了させる。そして、エントロピー符号化回路
8は量子化回路6より得られる次のブロックのハフマン
符号化に移る。
However, every time a Huffman code is generated for one element (one position in the matrix), the code amount allocation circuit 20 should transmit the data at the element position stored in the block allocated code amount data table. The allocated code amount is output to the coding truncation circuit 16. On the other hand, the coding truncation circuit 16 outputs the code amount to be transmitted and the EOB code even if the code amount of EOB is transmitted based on the allocated code amount of each block. If the value does not exceed the threshold value, a process of reducing the code amount to be transmitted from the allocated code amount of the block is performed without generating the truncation signal. Then, when the total code amount of the code amount of the block to be transmitted and the code of the EOB exceeds the remaining code amount of the allocated code amount, the coding truncation circuit 16 sends the truncation signal to the entropy coding circuit 8. Is output, and Huffman coding of the block is terminated. Then, the entropy coding circuit 8 shifts to the Huffman coding of the next block obtained from the quantization circuit 6.

【0105】従って、エントロピー符号化回路8は符号
化打切回路16から打切り信号が入力されるまで、変換さ
れたハフマン符号を、符号出力回路10に出力し、打切り
信号発生前にマトリックスのすべての要素に対するハフ
マン符号化が終わった場合には、エントロピー符号化回
路8はEOB の符号を符号出力回路10に出力する。また、
エントロピー符号化回路8はマトリックスの全ての要素
に対するハフマン符号化が終わらない前に打切り信号が
入力された場合には、その符号の代りにEOB の符号を符
号出力回路10に出力することになる。
Therefore, the entropy encoding circuit 8 outputs the converted Huffman code to the code output circuit 10 until the truncation signal is input from the encoding truncation circuit 16, and outputs all the elements of the matrix before the truncation signal is generated. Is completed, the entropy encoding circuit 8 outputs the code of EOB to the code output circuit 10. Also,
If a truncation signal is input before Huffman coding for all elements of the matrix is not completed, the entropy coding circuit 8 outputs a code of EOB to the code output circuit 10 instead of the code.

【0106】符号出力回路10ではこの符号化されたデー
タを一時記憶する。そして、エントロピー符号化回路8
は量子化回路6より得られる次のブロックのハフマン符
号化に移る。
The code output circuit 10 temporarily stores the encoded data. Then, the entropy encoding circuit 8
Shifts to Huffman coding of the next block obtained from the quantization circuit 6.

【0107】このような動作を繰り返し、1画面の画像
の全ブロックの処理が終わることにより、全ての符号化
処理を終了する。 Y成分に対するこのような処理が終る
と、次に同様の手法でクロマ系成分(Cr,Cb)の処理に
入る。クロマ系成分の処理でも量子化回路6は前回のパ
スにおいて量子化幅予測回路12が算出した予測の最適量
子化幅係数αを使用する。
By repeating the above operation, the processing of all the blocks of the image of one screen is completed, thereby completing all the encoding processing. After such processing for the Y component is completed, processing for chroma-based components (Cr, Cb) is started in a similar manner. The quantization circuit 6 uses the optimum quantization width coefficient α of the prediction calculated by the quantization width prediction circuit 12 in the previous pass also in the processing of the chroma component.

【0108】クロマ系成分について、1画面分の画像の
全ブロックの上記2パス目の処理が終わることにより、
全ての符号化処理を終了する。この終了にあたり、符号
出力回路10では最適化された1画像分のハフマン符号化
データを記録系22に出力し、記録系22におけるメモリカ
ードと云った記憶媒体71に書き込む (f)。これは、符号
出力回路10の出力により行われるが、符号出力回路10は
エントロピー符号化回路8からの可変長のハフマン符号
をつなぎ合わせ、記憶媒体71であるメモリカードに与え
ることで書き込む。
As for the chroma components, the processing of the second pass for all the blocks of the image for one screen is completed.
All encoding processing ends. At the end of this, the code output circuit 10 outputs the optimized Huffman coded data for one image to the recording system 22 and writes it to a storage medium 71 such as a memory card in the recording system 22 (f). This is performed by the output of the code output circuit 10. The code output circuit 10 writes by connecting the variable-length Huffman codes from the entropy coding circuit 8 to give to the memory card as the storage medium 71.

【0109】この符号出力回路10の出力による記憶媒体
71への書き込みは、第2パスが終わった段階でまとめて
行うようにしても良いが、第1パスが終って第2パス実
行に入った段階で可変長のハフマン符号をつなぎ合わせ
た結果が、1バイト若しくは数バイト単位、まとまり次
第、順次、記憶媒体へ書き込むようにしても良い。尚、
これに先立ち、符号出力回路10では符号化に使用した最
適量子化幅係数αを当該符号化した画像の記憶データに
おけるヘッダ部分に書き込み、再生時の手掛かりとして
残す。
A storage medium based on the output of the code output circuit 10
Writing to 71 may be performed collectively at the end of the second pass, but the result of joining variable-length Huffman codes at the end of the first pass and execution of the second pass may be obtained. The data may be written to the storage medium sequentially in units of one byte or several bytes as soon as they are collected. still,
Prior to this, the code output circuit 10 writes the optimum quantization width coefficient α used for coding in the header portion of the storage data of the coded image and leaves it as a clue at the time of reproduction.

【0110】以上、本装置においては、撮影可能枚数の
選択により画質を指定すると、この指定画質に応じて定
まる記録画像一枚当りの総符号量(目的符号量)に対応
して暫定的な量子化幅を算出し、この算出した暫定的な
量子化幅を用いて統計処理を行い(第1パス目)、その
データをもとに最適な量子化幅を予測して次にこの予測
した量子化幅を使用し、量子化してこれを符号化し、最
終的な符号化画像データを得るようにする(第2パス)
ことにより、符号化処理における符号量を目標の符号量
に近づけると共に、更に各ブロックの割当符号量を決定
することにより符号化処理における符号量が目的の符号
量を越えないようにしたものであり、この点が本発明の
重要なポイントとなっている。
As described above, in the present apparatus, when the image quality is designated by selecting the number of recordable images, the provisional quantum amount corresponding to the total code amount per target image (target code amount) determined according to the designated image quality is determined. The calculated quantization width is calculated, statistical processing is performed using the calculated provisional quantization width (first pass), an optimum quantization width is predicted based on the data, and then the predicted quantization width is calculated. Using the quantization width, quantize and encode it to obtain the final encoded image data (second pass)
Thereby, the code amount in the encoding process is made closer to the target code amount, and the code amount in the encoding process is prevented from exceeding the target code amount by further determining the assigned code amount of each block. This is an important point of the present invention.

【0111】よって、本実施例で使用したブロックサイ
ズ、直交変換の種類、エントロピー符号化の種類などに
限定されるものではない。また画像データバッファメモ
リは直交変換回路4と量子化回路6との間にあっても良
く、むしろこのようにすると符号化処理におけるブロッ
ク化と直交変換のプロセスを省略できる。しかし、精度
を保つためには、この場合、画像メモリのサイズが大き
くなる。また、プロセス処理も、A/D 変換の前に行うよ
うにし、その後にディジタル化するようにしても構わな
い。また、本装置においては、ブロック毎のエントロピ
ー符号化を低周波成分側より行い、画質への影響の比較
的小さい高周波成分は割り当て符号量に余裕のある範囲
で符号化して利用するようにしているので、画質の劣化
を最小限に抑えて、しかも、高圧縮で符号化できるよう
になる。
Therefore, the present invention is not limited to the block size, the type of orthogonal transform, the type of entropy coding, and the like used in this embodiment. Further, the image data buffer memory may be provided between the orthogonal transformation circuit 4 and the quantization circuit 6, and in this case, the processes of blocking and orthogonal transformation in the encoding process can be omitted. However, in order to maintain accuracy, the size of the image memory is increased in this case. Also, the processing may be performed before the A / D conversion and digitized thereafter. Further, in the present apparatus, entropy coding for each block is performed from the low-frequency component side, and high-frequency components having a relatively small effect on image quality are coded and used within a range where the allocated code amount has a margin. Therefore, it is possible to perform encoding with high compression while minimizing deterioration of image quality.

【0112】以上、詳述した図1および図2の構成の本
発明は、要するに、第1パスの暫定的な量子化幅として
目的符号量から設定した最適な量子化幅に近い量子化幅
を用いて第1パスの量子化を行い、その結果、得られた
符号量データを用いてさらに最適な量子化幅を予測し、
これを最終処理である第2パスにおける符号化に使用す
ると云うものである。これは、目的符号量に近い符号量
が得られる量子化幅係数αを用いて統計処理すると、早
く、しかも、より精度良く、最適量子化幅係数αを見付
けることができることを利用したものであり、暫定的な
量子化幅係数として、目的符号量に基づいて設定した最
適な量子化幅に近い量子化幅係数を用いて第1パスの量
子化を行い、これにより得た総符号量から目的符号量に
収めることができる量子化幅係数を知って、これを第2
パス目で使用して最終的な符号化を行うようにしたもの
である。
The present invention having the configurations shown in FIGS. 1 and 2 described above is, in short, a quantization width close to the optimum quantization width set from the target code amount as the provisional quantization width for the first pass. To perform a first pass quantization, and as a result, further optimize a quantization width using the obtained code amount data,
This is used for the encoding in the second pass which is the final processing. This is based on the fact that, when statistical processing is performed using a quantization width coefficient α that provides a code amount close to the target code amount, the optimum quantization width coefficient α can be found quickly and more accurately. The first pass quantization is performed using a quantization width coefficient close to the optimum quantization width set based on the target code amount as a provisional quantization width coefficient, and the target code amount is calculated based on the total code amount thus obtained. Knowing the quantization width coefficient that can be contained in the code amount,
This is used in the pass to perform final encoding.

【0113】そして、これにより、撮影することにより
撮像系で得た画像データを短い時間で、精度良く目的符
号量の枠一杯に符号化し、これによって、許される符号
量に目一杯近付けることができることで、失うデータを
最小限にとどめ、画質も維持できるようにすると云うも
のであり、予測精度が高く、符号化による画質劣化の少
ない、すなわち、高画質の量子化を行うことができる。
また、目的符号量が変わっても、同じハードウェアで対
処でき、従って、目的符号量別(圧縮率別)のハードウ
ェアを用意する必要がないから、装置のコストダウンと
小形化が図れる。
Thus, the image data obtained by the imaging system by shooting can be coded in a short time and with high accuracy and in the entire frame of the target code amount, so that the code amount can be brought close to the allowable code amount as much as possible. Thus, lost data is kept to a minimum and the image quality can be maintained, so that the prediction accuracy is high and the image quality is hardly degraded due to encoding, that is, high-quality quantization can be performed.
In addition, even if the target code amount changes, the same hardware can cope with the change. Therefore, it is not necessary to prepare hardware for each target code amount (for each compression ratio), so that the cost and size of the apparatus can be reduced.

【0114】ここで、暫定的な量子化幅係数を如何にし
て最適な値にするかが、重要な課題となるので、この点
について少し説明する。画像データを前処理し、この出
力を量子化し、この量子化出力を可変長符号化する場
合、この量子化の量子化幅を変化させることにより、発
生する符号量が変化することは周知の事実である。これ
は、ハフマン符号化に代表される可変長符号化は、符号
化するデータの発生確率の偏りを利用してそのデータを
表現するのに必要な符号量を減少させると云うものであ
ることから、前記「量子化幅を変化させる」と云うこと
は、量子化値の発生確率を変化させることでもあるか
ら、量子化幅を変化させることにより発生符号量も変化
することがわかる。
Here, how to set the provisional quantization width coefficient to an optimum value is an important issue, and this point will be described briefly. It is a well-known fact that when image data is pre-processed, this output is quantized, and when this quantized output is subjected to variable-length encoding, the generated code amount changes by changing the quantization width of this quantization. It is. This is because variable-length coding represented by Huffman coding reduces the amount of code required to represent the data using the bias in the probability of occurrence of the data to be coded. Since "changing the quantization width" means changing the probability of occurrence of the quantization value, it can be seen that changing the quantization width also changes the generated code amount.

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

【0116】具体的には多くの場合、次の関係が得られ
た。すなわち、ある量子化幅に対する相対的な比をSFと
し、発生符号量1画素あたりのビット数(ビットレー
ト)で表わしてこれをBRとすると、 log BR=a ×log SF+b …(1) なる関係になる。a は同一の符号化であれば、画像によ
らず略一定であり、b は画像に依存する。このb の値は
画像により、一定の分布を持ち、この発生頻度分布から
代表的なb が得られる。
Specifically, in many cases, the following relationship was obtained. That is, assuming that a relative ratio with respect to a certain quantization width is SF, which is represented by the number of bits per one pixel (bit rate) of generated code amount and is BR, log BR = a × log SF + b (1) It becomes a relationship. If a is the same encoding, it is substantially 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 b can be obtained from the occurrence frequency distribution.

【0117】以上、一例をあげて説明をしたが、いずれ
にせよ、本発明の特徴は量子化幅と符号量との関係を利
用して目的の符号量に応じて量子化幅を設定すると云う
ところにある。
In the above, an example has been described. In any case, the feature of the present invention is that the quantization width is set in accordance with the target code amount by utilizing the relationship between the quantization width and the code amount. There.

【0118】上述した図2の構成の符号化回路80は、圧
縮符号化において、一連の処理を目的符号量に基づき算
出した暫定的な量子化幅で第1パスの処理を行い、その
結果を元に最適量子化幅を求めてこの最適量子化幅によ
り第2パスを実施し、最終的な圧縮符号化データを得る
と云った二回の処理で完成させるもので、第1パスによ
り最適αを見付けるようにするものである。図3におい
ては符号化回路80の処理の流れをわかりやすくするため
に、第1パスでの信号の流れを点線の矢印P1で、また、
第2パスでの信号の流れを実線の矢印P2でそれぞれ図示
してある。この信号の流れに沿ってざっと動作を追って
みると次のようになる。
The encoding circuit 80 having the configuration shown in FIG. 2 performs a series of processes in the first pass with a provisional quantization width calculated based on the target code amount in the compression encoding. The optimum quantization width is obtained in advance, the second pass is performed using the optimum quantization width, and the processing is completed by two processes of obtaining the final compressed and encoded data. It is to find out. In FIG. 3, the signal flow in the first pass is indicated by a dotted arrow P1,
The signal flow in the second path is shown by a solid arrow P2. The following is a brief description of the operation following the flow of this signal.

【0119】画像データの符号化が行われるに当り、目
的とする総符号量が符号化回路80の制御回路18内に設定
される。これはスイッチ30の操作により、使用者が所望
の撮影可能枚数を設定することにより、この設定した撮
影可能枚数に応じて制御回路90が最適符号量を選択し、
これを目的符号量の情報として符号化回路80に与えるこ
とで実現している。尚、初期状態ではあらかじめ定めた
標準的な撮影可能枚数に設定される。
When the image data is encoded, the target total code amount is set in the control circuit 18 of the encoding circuit 80. This is because, by operating the switch 30, the user sets the desired number of shootable images, and the control circuit 90 selects the optimum code amount according to the set number of shootable images.
This is realized by giving this to the encoding circuit 80 as information on the target code amount. Note that in the initial state, the standard number of recordable images is set in advance.

【0120】撮影が行われると、これにより撮像系40内
の撮像素子から画像信号が出力される。この出力された
画像信号は信号処理回路60内においてディジタル信号に
変換され、バッファメモリに記憶された後、8×8画素
のブロック単位で読み出され、 Y成分、次にCr成分、次
にCb成分に分離される。この分離は最初に Y成分につい
て行われ、8×8画素のブロック単位で出力される Y成
分の画像データは直交変換回路4に入力されて、ブロッ
ク毎に直交変換(本例ではDCT ;離散コサイン変換(Dis
crete Cosine Transform) ;尚、予測符号化(DPCM)を
使用しても良い)が行われる。直交変換回路4で得られ
たDCT 変換変換係数は量子化回路6に入力され、一方、
制御回路18から目的とする符号量が量子化幅予測回路12
に出力され、量子化幅予測回路12では目的の符号量から
式(1) の関係を用いて量子化幅係数αの初期値を設定
し、量子化回路6に出力する。量子化回路6では、入力
された量子化幅係数αを用いて、変換係数を線形量子化
する。量子化された変換係数はエントロピー符号化回路
8に入力され、可変長符号化(本例ではハフマン符号
化)が行われる。
When the photographing is performed, an image signal is output from the image pickup device in the image pickup system 40. The output image signal is converted into a digital signal in the signal processing circuit 60, stored in the buffer memory, read out in block units of 8 × 8 pixels, and read out from the Y component, then the Cr component, and then the Cb component. Separated into components. This separation is first performed for the Y component, and the image data of the Y component output in block units of 8 × 8 pixels is input to the orthogonal transform circuit 4 and orthogonally transformed (DCT; discrete cosine in this example) for each block. Conversion (Dis
crete Cosine Transform); prediction coding (DPCM may be used). The DCT transform coefficients obtained by the orthogonal transform circuit 4 are input to the quantization circuit 6, while
The control circuit 18 determines that the target code amount is the quantization width prediction circuit 12.
The quantization width prediction circuit 12 sets an initial value of the quantization width coefficient α from the target code amount using the relationship of the equation (1) and outputs the initial value to the quantization circuit 6. The quantization circuit 6 linearly quantizes the transform coefficient using the input quantization width coefficient α. The quantized transform coefficients are input to the entropy coding circuit 8, where variable length coding (Huffman coding in this example) is performed.

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

【0122】交流成分については走査順序の2番目から
64番目まで順番に変換係数を見てゆき、変換係数が0で
ない(すなわち、有効な)係数が出てきたら、その直前
に存在した連続した0(零;無効)の係数の数(ゼロラ
ン)とその有効係数との値で、2次元のハフマン符号化
が行われる。また、ある係数以降、64番目の係数まで、
連続して無効出力が続く場合には、ブロックの終りを示
すEOF (エンド・オブ・ファイル)の符号を出力する。
可変長符号化回路8は、以上のような符号化が各ブロッ
クで終了する毎に、そのブロックで発生した符号量を符
号量算出回路14に出力する。
For the AC component, from the second in the scanning order
The conversion coefficients are examined in order up to the 64th, and if a conversion coefficient that is not 0 (ie, valid) comes out, the number of consecutive 0 (zero; invalid) coefficients that exist immediately before (zero run) and Two-dimensional Huffman coding is performed with the value of the effective coefficient. Also, after a certain coefficient, up to the 64th coefficient,
If invalid output continues, an EOF (end of file) code indicating the end of the block is output.
The variable length coding circuit 8 outputs the code amount generated in each block to the code amount calculation circuit 14 each time the above-described coding is completed in each block.

【0123】Y成分についてのこのような処理が終了す
ると、次にCr成分、そしてCb成分についても同様の処理
を行う。一画像について、符号化が終了すると、符号量
算出回路14は入力されたブロック毎の符号量を累積して
画像全体の符号量を総符号量値として算出する。この総
符号量値は量子化幅予測回路12に出力され、また、各ブ
ロック毎の符号量及び画像全体の符号量割当回路20に出
力される。
When such processing for the Y component is completed, the same processing is performed for the Cr component and the Cb component. When encoding of one image is completed, the code amount calculation circuit 14 accumulates the input code amount of each block 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 of each block and the entire image.

【0124】以上の第1パスの符号化処理が終了する
と、続いて同じ画像データに対して第2パスの符号化処
理が行われる。第2パスでは信号処理回路60内のメモリ
から読み出された画像データは、最初に Y成分、次にCr
成分、次にCb成分に分離され、それぞれの成分の画像デ
ータは8×8画素のブロック化等の処理が行われた後、
直交変換回路4に入力され、ブロック毎に直交変換(DC
T 変換)され、これにより、直交変換回路4で得られた
DCT 変換係数は量子化回路6に入力される。
When the above-described first pass encoding process is completed, the second pass encoding process is subsequently performed on the same image data. In the second pass, the image data read from the memory in the signal processing circuit 60 is first Y component, then Cr
Component, and then into Cb components, and image data of each component is subjected to processing such as blocking of 8 × 8 pixels.
The signal is input to the orthogonal transformation circuit 4 and orthogonal transformation (DC
T transformation), thereby obtaining the orthogonal transform
The DCT transform coefficient is input to the quantization circuit 6.

【0125】一方、量子化幅予測回路12では第1パスで
の符号化により求められた総画像符号量と、制御回路18
から与えられた目的符号量とから、より適した量子化幅
係数αを予測し、量子化回路6に出力する。量子化回路
6においては与えられたこの予測による新たな量子化幅
係数αによる補正済み量子化幅を用いて、DCT 変換係数
を線形量子化する。量子化された係数は可変長符号化回
路8に入力され、第1パスの符号化時と同様の方式でハ
フマン符号化される。
On the other hand, in the quantization width prediction circuit 12, the total image code amount obtained by the encoding in the first pass and the control circuit 18
And a more suitable quantization width coefficient α is predicted from the target code amount given from the above and output to the quantization circuit 6. The quantization circuit 6 linearly quantizes the DCT transform coefficient using the corrected quantization width based on the given new quantization width coefficient α based on the prediction. The quantized coefficients are input to the variable length coding circuit 8, and are subjected to Huffman coding in the same manner as in the first pass coding.

【0126】ここで符号化時に発生した符号量は第1パ
スの符号化時に求められ、符号量割当回路20に記憶され
ている各ブロックの割当符号量との比較が行われ、これ
を越えた場合には符号打切回路16の働きにより、そのブ
ロック内でそれ以降の符号化が打ち切られる。以上の方
法により目的符号量に制御された符号化データは順次、
符号出力回路10を経由して記録系70に出力され、記録さ
れる。
Here, the code amount generated at the time of encoding is obtained at the time of the encoding of the first pass, and is compared with the allocated code amount of each block stored in the code amount allocating circuit 20, and exceeds the amount. In such a case, the subsequent coding is terminated in the block by the function of the code discontinuing circuit 16. The coded data controlled to the target code amount by the above method is sequentially
The data is output to the recording system 70 via the code output circuit 10 and recorded.

【0127】次に記録系70にて記録された記録媒体71の
圧縮符号化記録画像データの再生について説明する。図
4に再生機の構成を示す。図において、100 は再生機本
体であり、この再生機本体100 は読取部102 、復号化回
路104 および処理回路106 および制御回路108 を備え
る。読取部102 は記憶媒体71を着脱でき、記憶媒体71の
内容をインタフェ−ス回路110 を介して読出すようにな
っている。
Next, reproduction of the compression-encoded recording image data of the recording medium 71 recorded by the recording system 70 will be described. FIG. 4 shows the configuration of the playback device. Referring to FIG. 1, reference numeral 100 denotes a reproducing apparatus main body, which 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 reads the contents of the storage medium 71 via the interface circuit 110.

【0128】復号化回路104 は図5のような機能ブロッ
クを有する。すなわち、112 はハフマン符号化データを
復号化するハフマン復号部、114 はこのハフマン復号さ
れて得られたデータを、記憶媒体71から読み出されて設
定入力された量子化幅の情報に基づいて逆量子化する逆
量子化部、116 はこの逆量子化されて得られたデータを
逆 DCT変換して映像信号データとして出力するIDCT(逆
DCT変換)部、そして、118 はこれらの制御を司る制御
部である。
The decoding circuit 104 has functional blocks as shown in FIG. That is, reference numeral 112 denotes a Huffman decoding unit for decoding Huffman-coded data, and 114 denotes the Huffman-decoded data read out from the storage medium 71 based on the quantization width information read and set and input. An inverse quantization unit 116 for performing quantization performs inverse DCT conversion on the data obtained by the inverse quantization and outputs an IDCT (inverse
A DCT transform section 118 is a control section that controls these controls.

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

【0130】前記制御回路108 は再生機本体100 全体の
制御を司るものであり、再生機本体100 の読取部102 に
対し、符号化時の量子化幅の情報を読み出すべく制御し
て、その結果、記録媒体71から読み出された符号化時の
量子化幅の情報を復号化回路104 の逆量子化部114 に設
定させ、続いて制御回路108 は記録媒体71から圧縮符号
化された映像信号データを読出すべく、読取部102 を制
御すると云った制御を行う。また、図示しないが再生機
本体100 には、コマ送りスイッチ等があり、このスイッ
チにより指定されたコマ位置の映像を再生したりするこ
とができる。このような制御も制御回路108 が行う。
The control circuit 108 controls the entire reproduction apparatus main body 100. The control circuit 108 controls the reading section 102 of the reproduction apparatus main body 100 to read the information of the quantization width at the time of encoding. Then, the information of the quantization width at the time of encoding read from the recording medium 71 is set in the inverse quantization unit 114 of the decoding circuit 104, and then the control circuit 108 controls the video signal compressed and encoded from the recording medium 71. In order to read the data, control for controlling the reading unit 102 is performed. Although not shown, the playback device main body 100 has a frame feed switch or the like, and can reproduce a video at a frame position designated by the switch. The control circuit 108 also performs such control.

【0131】次に上記構成の再生機の動作を説明する。
圧縮符号化された映像信号データが記録された記録媒体
(メモリカード)71が再生機本体100の読取部102 に装
着されると、まず、制御回路108 は読取部102 に対し、
符号化時の量子化幅の情報を読み出すべく制御する。そ
の結果、読取部102 において記録媒体71から符号化時の
量子化幅の情報が読み出され、この情報は復号化回路10
4 の逆量子化部114 に設定される。続いて制御回路108
は記録媒体71から映像信号を読出すべく、読取部102 を
制御するので、読取部102 は記録媒体71から映像信号を
順次読み出し、復号化回路104 に入力する。これを受け
た復号化回路104 では、ハフマン復号部112 においてハ
フマン符号を復号し、量子化係数を得る。こうして得ら
れた量子化係数は逆量子化回路114 に与えて逆量子化す
る。ここでの逆量子化は先に設定されている前記量子化
幅の情報を用いて行われる。
Next, the operation of the reproducing apparatus having the above configuration will be described.
When the recording medium (memory card) 71 on which the compression-encoded video signal data is recorded is mounted on the reading unit 102 of the playback device main body 100, first, the control circuit 108
Control is performed to read out information on the quantization width at the time of encoding. As a result, in the reading unit 102, information on the quantization width at the time of encoding is read from the recording medium 71, and this information is
4 is set to the inverse quantization unit 114. 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 sequentially reads the video signal from the recording medium 71 and inputs the video signal to the decoding circuit 104. Upon receiving this, the decoding circuit 104 decodes the Huffman code in the Huffman decoding unit 112 to obtain a quantized coefficient. The quantized coefficients thus obtained are supplied to an inverse quantization circuit 114 for inverse quantization. Here, the inverse quantization is performed by using the information of the quantization width previously set.

【0132】逆量子化により得られた変換係数は、IDCT
部116 においてブロック毎に逆 DCT変換され、元の映像
信号に復元される。このようにして Y,Cr,Cbの順で映
像信号が復元されて復号化回路104 から出力され、処理
回路106 内のバッファメモリ120 に書き込まれる。1画
面の映像信号データの書き込みが終了すると、バッファ
メモリ120 から通常のテレビ信号の走査順で映像信号デ
ータが読み出され、エンコーダ122 においてNTSC方式の
映像信号に変換される。更にD/A 変換器124 によりアナ
ログ信号に変換され、出力される。この映像信号をテレ
ビモニタに入力することにより、画像がテレビ映像とし
て再生され、映像として鑑賞でき、また、ビデオプリン
タ等のプリント装置に与えてプリントすることにより、
ハードコピーが得られるので、写真等と同様な形で鑑賞
することがきるようになる。
The transform coefficient obtained by the inverse quantization is IDCT
In the section 116, the inverse DCT is performed for each block, and the original video signal is restored. In this way, the video signal is restored in the order of Y, Cr, and Cb, output from the decoding circuit 104, and written into the buffer memory 120 in the processing circuit 106. When the writing of the video signal data for one screen is completed, the video signal data is read out from the buffer memory 120 in the normal scanning order of the television signal, and is converted into the NTSC video signal by the encoder 122. Further, the signal is converted into an analog signal by the D / A converter 124 and output. By inputting this video signal to a television monitor, the image is reproduced as a television video and can be viewed as a video.
Since the hard copy is obtained, it can be viewed in the same manner as a photograph or the like.

【0133】以上説明したように、カメラは所望の撮影
可能枚数を設定でき、撮影可能枚数を設定することでカ
メラではこれに対応する圧縮率を自動設定すると共に、
この設定圧縮率に応じて定まる暫定的な量子化幅を用い
て、1画面分の撮影画像データを量子化し、エントロピ
ー符号化し、その結果得られるその1画面分の撮影画像
データの符号量より最適量子化幅を予測し、この予測し
た最適量子化幅により前記1画面分の撮影画像データを
量子化し、エントロピー符号化するようにし、符号化さ
れた映像信号の再生時には撮影時に使用した前記最適量
子化幅を用いて復号することにより、所望の圧縮率での
符号化を圧縮率別にハードウェアを設けることなく、共
通の一つのハードウェアで実現でき、同様に所望の圧縮
率で符号化された画像データの復号化を圧縮率別にハー
ドウェアを設けることなく、共通の一つのハードウェア
で実現できる。
As described above, the camera can set a desired number of recordable images, and by setting the number of recordable images, the camera automatically sets the corresponding compression ratio,
Using the provisional quantization width determined according to the set compression ratio, the captured image data for one screen is quantized and entropy-encoded, and the optimal code amount is obtained from the code amount of the captured image data for one screen obtained as a result. A quantization width is predicted, the captured image data for one screen is quantized by the predicted optimal quantization width, and entropy encoding is performed. When reproducing an encoded video signal, the optimal quantization used at the time of photographing is reproduced. By decoding using the compression width, encoding at a desired compression rate can be realized with one common hardware without providing hardware for each compression rate, and similarly, encoding at a desired compression rate can be performed. Decoding of image data can be realized by one common hardware without providing hardware for each compression ratio.

【0134】以上の実施例では符号化の過程が第1パ
ス、第2パスの2回の処理で終了する2パス方式とした
が、これに限るものではなく、圧縮率から設定した量子
化幅を用いて1回のパスで符号化する方式でも実用上、
十分に圧縮率制御できる。また、記録媒体にメモりカー
ドを用いた例を示したが、その他、フロッピディスク、
光ディスク、磁気テープ等を利用することもできる。ま
た、カメラと再生機が別体となっているものを示した
が、カメラが再生機の機能を合せ持つ一体型のものでも
良い。量子化幅の値そのものを記録媒体に記録するよう
にしたが、量子化幅値を変換あるいは符号化して記録す
るようにしても良い。前処理符号化はKL変換、DPC
M変換等でも良い。エントロピー符号化は算術符号化、
ランレングス符号化等でも良い。
In the above-described embodiment, the two-pass method is used in which the encoding process is completed in two processes of the first pass and the second pass. In practice, even a method of encoding in one pass using
The compression ratio can be controlled sufficiently. Also, an example using a memory card as a recording medium has been described, but in addition, a floppy disk,
Optical disks, magnetic tapes and the like can also be used. Although the camera and the playback device are shown as being separated from each other, the camera and the playback device may be of an integrated type having the functions of the playback device. Although the quantization width value itself is recorded on the recording medium, the quantization width value may be converted or encoded and recorded. Preprocessing encoding is KL conversion, DPC
M conversion may be used. Entropy coding is arithmetic coding,
Run-length coding or the like may be used.

【0135】本発明は撮影可能枚数等の設定により、画
像の最終的な目的符号量が自動可変されるようにし、最
終的な目的符号量が設定されると、その符号量を得るに
必要な量子化幅係数αを該目的符号量から算出して、符
号化に使用する点にあり、これによって最初から目的符
号量に近い符号量が得られることに着目して、1回のパ
スで略最適値にすることもできる。この例を示す。
According to the present invention, the final target code amount of an image is automatically varied by setting the number of images that can be taken, and when the final target code amount is set, it is necessary to obtain the code amount. The point is that the quantization width coefficient α is calculated from the target code amount and is used for encoding. By paying attention to the fact that a code amount close to the target code amount can be obtained from the beginning, the quantization width coefficient α is approximately calculated in one pass. It can be an optimal value. This example is shown.

【0136】本例は第1パスの符号化処理を1回のみ行
うもので、第1パスのみで最適値にするものである。図
7に構成を示す。本例では前述の実施例と同一の構成要
素については、同一符号で示し、説明は省略する。
In this example, the encoding process of the first pass is performed only once, and the optimum value is obtained only in the first pass. FIG. 7 shows the configuration. In this example, the same components as those in the above-described embodiment are denoted by the same reference numerals, and description thereof will be omitted.

【0137】本システムでは任意の画質設定値を制御回
路18a に与えると、これに応じて定まる標準の量子化幅
係数αを使用して符号化を行うもので、画像データは直
交変換(DCPMでも可)による前処理がなされ、一方、制
御回路18a から与えられる目的符号量から量子化幅予測
回路12は標準の量子化幅係数αを算出してこれを量子化
回路6に与え、量子化回路6はこの設定された量子化幅
係数αで補正した量子化幅で線形量子化を行う。この量
子化された変換係数はエントロピー符号化回路8でエン
トロピー符号化され、符号出力回路10に出力される。そ
して、この符号化された出力は符号出力回路10より記録
系に送られて記録媒体に記録される。
In the present system, when an arbitrary image quality setting value is given to the control circuit 18a, encoding is performed using a standard quantization width coefficient α determined in accordance with the image quality setting value. A), the quantization width prediction circuit 12 calculates a standard quantization width coefficient α from the target code amount provided from the control circuit 18a, and supplies the standard quantization width coefficient α to the quantization circuit 6, and the quantization circuit 6 Numeral 6 performs linear quantization with the quantization width corrected by the set quantization width coefficient α. The quantized transform coefficients are entropy-encoded by an entropy encoding circuit 8 and output to a code output circuit 10. Then, the encoded output is sent from the code output circuit 10 to a recording system and recorded on a recording medium.

【0138】上記の例のように、一回のみのパスで符号
化する場合でも、量子化幅を目的符号量に基づいて設定
するようにしたことにより、最適な量子化幅に近くな
り、得られる符号量をおおよそ目的符号量と一致させる
ことができる。そして、この場合、処理は一回で終わる
ので、極めて高速で符号化を行えるようになる。
Even when encoding is performed in a single pass as in the above example, the quantization width is set based on the target code amount, so that the quantization width approaches the optimum quantization width. It is possible to make the code amount to be approximately equal to the target code amount. In this case, since the processing is completed in one time, encoding can be performed at an extremely high speed.

【0139】以上の各実施例では目的符号量から量子化
幅を設定していたが、複数の目的符号量をモードで切換
えて使用するようなアプリケーションにおいては、それ
ぞれのモードに対応する量子化幅を予め用意しておき、
これをモードで切り換えて使用するようにしても勿論差
支えない。
In each of the above embodiments, the quantization width is set based on the target code amount. However, in an application in which a plurality of target code amounts are switched between modes, the quantization width corresponding to each mode is used. Prepare in advance,
Of course, it can be used by switching between modes.

【0140】本発明によれば、目的の符号量を変化させ
ても、発生符号量を目的の符号量に近付けるのに最適な
量子化幅が得られる。この量子化幅を用いて量子化する
ことにより、1回の符号化処理のみで符号化を終了する
場合(1パス方式)でも、得られる符号量を目的の符号
量に近付けることができ、2回の符号化処理で符号量を
制御する2パス方式では、第一回目の符号化処理(統計
処理)における暫定的な量子化幅を用いて得た符号量に
基づいて量子化幅を補正するので、最適量子化幅の予測
精度を向上させる効果があり、高画質の符号化が行える
とともに、総符号量が十分目標値に近付き、また、目的
の符号量以内になるまで、符号化処理と最適な量子化幅
の予測を繰り返すnパス方式とすることもでき、この方
式では第1パスでの符号化処理(統計処理)において、
符号量を目標値に収めるに最適な量子化幅を見付けるま
での(量子化幅が最適値に収束するまでの)繰り返し回
数が少なくなり、符号化に要する処理時間が短くなると
云う効果が得られる。
According to the present invention, even if the target code amount is changed, an optimum quantization width for making the generated code amount close to the target code amount can be obtained. By performing quantization using this quantization width, the obtained code amount can be made close to the target code amount even when the coding is completed only by one coding process (one-pass method). In the two-pass method in which the code amount is controlled in the first encoding process, the quantization width is corrected based on the code amount obtained using the temporary quantization width in the first encoding process (statistical process). Therefore, it has the effect of improving the prediction accuracy of the optimal quantization width, can perform high-quality encoding, and can perform encoding processing until the total code amount is sufficiently close to the target value and is within the target code amount. An n-pass method that repeats the prediction of the optimal quantization width can be used. In this method, in the encoding process (statistical process) in the first pass,
The number of repetitions (until the quantization width converges to the optimum value) until finding the optimum quantization width for keeping the code amount within the target value is reduced, and the effect that the processing time required for encoding is reduced is obtained. .

【0141】尚、本発明は上記し、且つ、図面に示す実
施例に限定することなくその要旨を変更しない範囲内で
適宜変形して実施し得るものであり、本発明はスチル画
像に限らず動画像等、種々の画像に対しての圧縮符号化
に適用できるものである。
The present invention is not limited to the embodiments described above and shown in the drawings, but can be appropriately modified and implemented without departing from the scope of the invention. The present invention is not limited to still images. The present invention can be applied to compression encoding of various images such as moving images.

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

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

【0144】本発明の更に別の実施例を次に説明する。
本例は、画質設定を手動で行うことなく、自動的に設定
できるようにしたものである。すなわち、本例では暫定
的な量子化幅を用いて符号化を行い、この時に発生した
符号量を用いて最適な画質モ−ドを設定する。一般的に
同一の量子化幅を用いて符号化したときに、符号量が多
く発生する画像は高周波成分を多く有しており、これを
高圧縮、すなわち、少ない符号量に圧縮することは、高
周波成分の切り捨てが多く発生することを意味し、画質
を損なうことになる。
Next, still another embodiment of the present invention will be described.
In this example, the image quality can be automatically set without manually setting the image quality. That is, in this example, encoding is performed using the provisional quantization width, and the optimal image quality mode is set using the code amount generated at this time. In general, when encoding using the same quantization width, an image in which a large amount of code occurs has many high-frequency components, and high compression, that is, compressing this to a small amount of code, This means that high-frequency components are often cut off, which impairs image quality.

【0145】一方、符号量発生の少い画像は、高圧縮を
行っても比較的画質は損なわれない。この性質を利用
し、画像毎に適した圧縮率を自動的に設定するようにし
たものがこの実施例である。
On the other hand, the quality of an image with a small amount of code generation is not relatively deteriorated even if high compression is performed. This embodiment utilizes this property and automatically sets a suitable compression ratio for each image.

【0146】本実施例の符号化回路の構成を図11に示
す。上述の実施例と同一の構成要素については同一符号
を付し、説明は省略する。この実施例は撮影を行うと、
この画像(ディジタル化された画像)について、ブロッ
ク化を行い、次に各ブロックについて順にDCT を行い、
周波数成分別の係数にし、この周波数成分別のDCT 係数
データを低周波数成分から順に暫定的な周波数成分別量
子化幅係数αを用いての量子化を行い、これをハフマン
符号化し、次にこれにより発生した総符号量と各ブロッ
ク別符号量から最適な目的符号量を決め、この目的符号
量を各ブロック毎の発生符号量で配分して各ブロック毎
の割当符号量を決め、さらに前記発生した総符号量と目
的符号量から各周波数毎の最適量子化幅を決め、前記撮
影により得られた画像のブロック化を行い、次に各ブロ
ックについて順にDCT を行い、周波数成分別の係数に
し、この周波数成分別のDCT 係数データを低周波数成分
から順に前記決定した周波数成分別最適量子化幅係数α
を用いての量子化を行い、これをハフマン符号化し、次
にこれにより発生した符号を、そのブロックでの前記割
当符号量を越えない範囲で記録し、割当符号量を越える
分は符号化を打ち切る。
FIG. 11 shows the configuration of the encoding circuit of this embodiment. The same components as those in the above-described embodiment are denoted by the same reference numerals, and description thereof will be omitted. In this embodiment, when taking a picture,
This image (digitized image) is divided into blocks, and then DCT is performed on each block in turn.
The DCT coefficient data for each frequency component is quantized using a temporary quantization width coefficient α for each frequency component in order from the low frequency component, and this is Huffman coded. The optimal target code amount is determined from the total code amount generated by the above and the code amount for each block, and the target code amount is distributed by the generated code amount for each block to determine the allocated code amount for each block. Determine the optimal quantization width for each frequency from the total code amount obtained and the target code amount, perform blocking of the image obtained by the shooting, and then perform DCT on each block in order to obtain coefficients for each frequency component, The DCT coefficient data for each frequency component is sequentially converted from the low frequency component to the optimal quantization width coefficient α for each determined frequency component.
Is performed using Huffman coding, and the generated code is recorded within a range not exceeding the allocated code amount in the block. abort.

【0147】制御回路90にはこのような処理を行うため
の制御機能を持たせる。そして、最初に制御回路90に統
計処理時の総符号量の値(第1パスの処理での発生総符
号量の値)から、当該処理中の画像に最も適した目的符
号量を決定させ、この制御回路90が決定した目的符号量
を制御回路18に設定すると共に、制御回路18では量子化
幅予測回路12に対して、この決定した目的符号量と前記
統計処理時の総符号量とから各周波数成分毎の最適量子
化幅係数αを予測させるべく制御させ、この予測した各
周波数成分毎の最適量子化幅係数αにて補正して得られ
た各周波数成分毎の最適量子化幅を量子化幅予測回路12
より、量子化回路 6に与え、量子化回路6にこの各周波
数成分毎の最適量子化幅で各ブロック毎の画像データ
(DCT 変換値)の量子化を行わせるようにする。
The control circuit 90 has a control function for performing such processing. Then, first, the control circuit 90 is caused to determine the target code amount most suitable for the image being processed from the value of the total code amount at the time of the statistical processing (the value of the total code amount generated in the processing of the first pass), The target code amount determined by the control circuit 90 is set in the control circuit 18, and the control circuit 18 instructs the quantization width prediction circuit 12 from the determined target code amount and the total code amount at the time of the statistical processing. The optimal quantization width coefficient α for each frequency component is controlled to be predicted, and the optimal quantization width for each frequency component obtained by correcting with the predicted optimal quantization width coefficient α for each frequency component is calculated. Quantization width prediction circuit 12
Thus, the quantization data is supplied to the quantization circuit 6 so that the quantization circuit 6 quantizes the image data (DCT transform value) for each block with the optimum quantization width for each frequency component.

【0148】そして、この量子化出力をエントロピー符
号化回路 8に与えて、該発生した符号を、そのブロック
での割当符号量内に収まるように符号化を進め、割当符
号量を越える場合はそのブロックでの符号化を打ち切
り、割当符号量の範囲内に符号量を収めるようにするも
のである。
The quantized output is supplied to an entropy coding circuit 8, and the generated code is coded so as to be within the allocated code amount of the block. The coding in the block is discontinued so that the code amount falls within the range of the allocated code amount.

【0149】このような構成において、撮影が行われる
と、撮像系40内の撮像素子から画像信号が出力される。
撮像系40から出力された画像信号は、信号処理回路60に
おいて、ディジタル信号に変換され、8×8画素のブロ
ック単位で読み出される。このブロック単位で読み出さ
れたディジタル信号の画像データは符号化回路80に入力
される。符号化回路80に入力された画像データは、符号
化回路80における直交変換回路4により、まず、各ブロ
ック毎にDCT が行われ、各周波数成分別の値であるDCT
係数を得る。そして、この得られたDCT 係数に対し、符
号化回路80における量子化回路6により、各周波数成分
毎に各周波数成分毎の予め設定された暫定量子化幅を用
いて、線形量子化が行われる。量子化された変換係数
は、符号化回路80内のエントロピー符号化回路8により
ハフマン符号化される。
In such a configuration, when photographing is performed, an image signal is output from the image pickup device in the image pickup system 40.
The image signal output from the imaging system 40 is converted into a digital signal in the signal processing circuit 60, and is read out in blocks of 8 × 8 pixels. The image data of the digital signal read in block units is input to the encoding circuit 80. The image data input to the encoding circuit 80 is first subjected to DCT for each block by the orthogonal transformation circuit 4 in the encoding circuit 80, and the DCT which is a value for each frequency component is obtained.
Get the coefficients. Then, the quantized circuit 6 in the encoding circuit 80 performs linear quantization on the obtained DCT coefficient by using a preset provisional quantization width for each frequency component. . The quantized transform coefficients are subjected to Huffman coding by the entropy coding circuit 8 in the coding circuit 80.

【0150】一方、符号化回路80内の符号量算出回路14
はエントロピー符号化回路8の出力をもとに、符号化さ
れた画像データの符号量を計算し、符号量割当回路20に
出力する。符号化回路80内の符号量割当回路20は各ブロ
ック毎に、発生した符号量を記憶する。
On the other hand, the code amount calculation circuit 14 in the coding circuit 80
Calculates the code amount of the coded image data based on the output of the entropy coding circuit 8 and outputs it to the code amount allocating circuit 20. The code amount allocating circuit 20 in the encoding circuit 80 stores the generated code amount for each block.

【0151】このような処理が制御回路90の制御のもと
に、各ブロック毎に順次、行われる。そして、1枚の画
面分のブロックの処理が終了した時点で、当該1画面に
ついて発生した総符号量を符号量算出回路14から符号化
回路80内の量子化幅予測回路12および制御回路90に出力
させる。制御回路90では総符号量の値から処理中の画像
に最も適した目的符号量を決定し、制御回路18に設定す
る。
Such processing is sequentially performed for each block under the control of the control circuit 90. When the processing of the block for one screen is completed, the total code amount generated for the one screen is sent from the code amount calculation circuit 14 to the quantization width prediction circuit 12 and the control circuit 90 in the coding circuit 80. Output. The control circuit 90 determines a target code amount most suitable for the image being processed from the value of the total code amount, and sets it in the control circuit 18.

【0152】この後、制御回路90の制御のもとに、信号
処理回路60では第2パス目の処理である符号化処理に入
る。これは、再度、バッファメモリ60c から画像データ
を読み出し、ブロック化処理して符号化回路80に入力す
ることからはじめる。符号化回路80ではこの入力された
画像データを直交変換回路4に与え、この直交変換回路
4により、DCT を行い、その結果、得られたDCT 係数を
量子化回路6に与える。
Thereafter, under the control of the control circuit 90, the signal processing circuit 60 starts the encoding processing which is the processing of the second pass. This is started by reading out the image data from the buffer memory 60c again, performing block processing, and inputting the block data to the encoding circuit 80. The encoding circuit 80 supplies the input image data to the orthogonal transform circuit 4, performs DCT by the orthogonal transform circuit 4, and supplies the obtained DCT coefficients to the quantization circuit 6.

【0153】一方、符号化回路80の量子化幅予測回路12
では第1パスでの符号化により、求められた総画像符号
量と、目的符号量とから、より適した各周波数成分毎の
量子化幅係数αを予測し、この予測値を量子化回路6に
出力する。また、符号量割当回路20は前記記憶している
各ブロック毎の符号量と制御回路90からの目的総符号量
とから比例配分等により、各ブロック毎の割当符号量を
決め、これを記憶する。
On the other hand, the quantization width prediction circuit 12 of the encoding circuit 80
In the first pass, a more suitable quantization width coefficient α for each frequency component is predicted from the obtained total image code amount and the target code amount by the encoding in the first pass, and this predicted value is Output to Further, the code amount allocating circuit 20 determines an allocated code amount for each block by proportional distribution from the stored code amount for each block and the target total code amount from the control circuit 90, and stores this. .

【0154】量子化回路6においては、与えられたこの
新たな各周波数成分毎の量子化幅係数αに、量子化マト
リックスにより与えられる各周波数成分毎の重みをかけ
た補正済み量子化幅を用いて、前記直交変換回路4より
出力されるDCT 変換係数を低い周波数領域から順に線形
量子化する。
The quantization circuit 6 uses the corrected quantization width obtained by multiplying the given quantization width coefficient α for each frequency component by the weight for each frequency component given by the quantization matrix. Then, the DCT transform coefficients output from the orthogonal transform circuit 4 are linearly quantized in order from a low frequency region.

【0155】この線形量子化された係数はエントロピー
符号化回路8により、ハフマン符号化される。ここで第
2パスでの処理である符号化処理時に発生した符号量
は、先の暫定的な符号化時(第1パスでの処理である統
計処理での符号化時)に求められ、符号量割当回路20に
記憶されている各ブロックの割当符号量との比較が行わ
れ、これを越えた場合には、符号打切回路16がエントロ
ピー符号化回路8に符号化打切りを指令する。これによ
り、当該符号化中のブロックに対するエントロピー符号
化回路8での符号化処理は打切られ、そのブロック内
で、それ以降の符号化が打ち切られる。この符号化打切
りの指令は制御回路90にも送られ、制御回路90は次のブ
ロックに対する上述のような符号化処理制御に移る。
The linearly quantized coefficients are Huffman-coded by the entropy coding circuit 8. Here, the code amount generated at the time of the encoding process which is the process of the second pass is obtained at the time of the above-mentioned provisional encoding (at the time of encoding at the statistical process which is the process of the first pass). A comparison is made with the allocated code amount of each block stored in the amount allocation circuit 20. If the amount exceeds this, the code discontinuation circuit 16 instructs the entropy encoding circuit 8 to terminate the encoding. As a result, the encoding process of the block being encoded in the entropy encoding circuit 8 is discontinued, and the subsequent encoding is discontinued in the block. The command to terminate the encoding is also sent to the control circuit 90, and the control circuit 90 shifts to the above-described encoding processing control for the next block.

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

【0157】以上のように最初の符号化(第1パスでの
処理)、すなわち、暫定的な量子化幅係数を用いた符号
化である統計処理時の符号化では各ブロック毎の直交変
換値を周波数成分毎に定めた暫定的な量子化幅係数を用
いて可変長符号化し、撮影した1画面分の画像について
の、暫定的量子化幅係数による発生総符号量を求め、こ
の符号量から画質を損なわない最適な圧縮率になる符号
量を目的符号量として決定し、設定すると共に、この目
的符号量と統計処理時の発生符号量とから各周波数成分
毎の最適な量子化幅係数を決定し、符号化処理(第2パ
スでの処理)時には各ブロック毎の直交変換値を前記周
波数成分毎に決定した量子化幅係数で符号化し、各ブロ
ック別の割当符号量を越えない範囲で符号化を進め、割
当符号量を越える場合にはそのブロックでの符号化を打
ち切り、次のブロックの符号化に移るようにしたので、
自動的に各画像に適した圧縮率を選択することができ
る。
As described above, in the first encoding (processing in the first pass), that is, in the encoding at the time of statistical processing, which is encoding using a provisional quantization width coefficient, the orthogonal transform value for each block is used. Is subjected to variable-length coding using a provisional quantization width coefficient determined for each frequency component, and the generated total code amount by the provisional quantization width coefficient for one captured image is calculated. The amount of code at which the optimal compression rate does not impair image quality is determined and set as the target code amount, and the optimal quantization width coefficient for each frequency component is determined from the target code amount and the code amount generated during the statistical processing. At the time of the encoding process (the process in the second pass), the orthogonal transform value for each block is encoded with the quantization width coefficient determined for each frequency component, and the allocated code amount for each block is not exceeded. Proceed with encoding and exceed the allocated code amount The case truncation coding in the block. Thus proceeds to encode the next block,
A compression ratio suitable for each image can be automatically selected.

【0158】すなわち、圧縮率選択の基準として符号化
回路により出力される符号量を用いているため、圧縮率
選択のために特別の回路を必要としない。また、同一の
ハードウェアで種々の目的符号量に制御することができ
る。
That is, since the code amount output from the encoding circuit is used as a criterion for selecting the compression ratio, no special circuit is required for selecting the compression ratio. Further, it is possible to control various target code amounts with the same hardware.

【0159】なお、この方式では先の実施例のようにY
(輝度)成分,C (クロマ)成分(C 成分は更にCr、Cb
に細分化することも可能)の色成分別に異なる量子化マ
トリックスで量子化するようにしても良い。また、目的
符号量は記録媒体における最小記録可能枚数の規格もあ
ることから、予め選択可能な何種類かの目的符号量を決
めておき、発生符号量から最適と考えられる値を選択す
る方式が最適である。
In this system, Y as in the previous embodiment is used.
(Luminance) component, C (chroma) component (C component is further Cr, Cb
(It is also possible to subdivide into color components). In addition, since the target code amount has a standard of the minimum recordable number of recording media, there is a method in which several selectable target code amounts are determined in advance, and a value considered to be optimal from the generated code amount is used. Optimal.

【0160】[0160]

【発明の効果】以上詳述したように、本発明によれば、
所望の圧縮率で画像の圧縮符号化を行うことができ、し
かも、圧縮率が変わっても圧縮率別でなく、ひとつの共
用のハードウェハで圧縮符号化が実現でき、同様に再生
系も圧縮率別でなく、ひとつの共用のハードウェアで再
生できると共に、目的符号量に対応してこの符号量に近
い圧縮された符号量が得られて、目的符号量の範囲で最
良の画質を得ることができる等、画質劣化がなく、ハー
ドウェアのコストダウンと小形化を図ることができる電
子カメラシステムを提供できる。また、本発明によれ
ば、映像信号を輝度信号成分と色信号成分に分離した後
に、これらの各成分に応じた量子化幅の情報を用いて符
号化処理を行っているので、再生画像の画質を高画質に
保ちながらも、容量の小さい情報量に圧縮できること
で、撮影可能枚数が多く、速写性にも優れた電子カメラ
装置を提供することができる。また、量子化幅の情報を
記録媒体に記録することで、画像の再生時にこの量子化
幅の情報を用いれば、簡単且つ迅速に画像再生が可能に
なる。
As described in detail above, according to the present invention,
Compression encoding of images can be performed at a desired compression ratio. Even if the compression ratio changes, compression encoding can be realized with one shared hardware, not by compression ratio, and the reproduction system can also be compressed. It is possible to reproduce with one common hardware, not rate, and to obtain a compressed code amount close to this code amount corresponding to the target code amount, and to obtain the best image quality in the range of the target code amount Thus, it is possible to provide an electronic camera system in which image quality does not deteriorate and hardware cost can be reduced and the size can be reduced. According to the present invention,
For example, after separating a video signal into a luminance signal component and a chrominance signal component,
Then, using the quantization width information corresponding to each of these components,
Since the encoding process is performed, the quality of the reproduced image is improved.
Can be compressed to a small amount of information while maintaining
An electronic camera that has a large number of images that can be taken
An apparatus can be provided. Also, the information of the quantization width is
By recording on a recording medium, this quantization
Easy and quick image playback using width information
Become.

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

【図1】本発明の第1の実施例を示すブロック図。FIG. 1 is a block diagram showing a first embodiment of the present invention.

【図2】本発明装置の要部構成例を示すブロック図。FIG. 2 is a block diagram showing a configuration example of a main part of the apparatus of the present invention.

【図3】図2の回路の動作の流れを説明するためのブロ
ック図。
FIG. 3 is a block diagram for explaining an operation flow of the circuit of FIG. 2;

【図4】再生機の構成を示すブロック図。FIG. 4 is a block diagram showing a configuration of a playback device.

【図5】再生機の構成を示すブロック図。FIG. 5 is a block diagram showing a configuration of a playback device.

【図6】本発明による電子カメラ本体の外観を示す斜視
図。
FIG. 6 is a perspective view showing the appearance of an electronic camera body according to the present invention.

【図7】1パス方式の場合の符号化回路の構成例を示す
ブロック図。
FIG. 7 is a block diagram illustrating a configuration example of an encoding circuit in the case of a one-pass method.

【図8】本発明の原理的な作用を説明するための動作遷
移図。
FIG. 8 is an operation transition diagram for explaining the principle operation of the present invention.

【図9】8×8画素に分けられたブロックのジグザグ・
スキャンを説明するための図。
FIG. 9 shows a zigzag pattern of a block divided into 8 × 8 pixels.
FIG. 4 is a diagram for explaining scanning.

【図10】従来技術を説明するための動作遷移図。FIG. 10 is an operation transition diagram for explaining a conventional technique.

【図11】本発明の別の実施例を示すブロック図。FIG. 11 is a block diagram showing another embodiment of the present invention.

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

1…電子カメラ本体、6…量子化回路、8…エントロピ
ー符号化回路、10…符号出力回路、12…量子化幅予測回
路、14…符号量算出回路、16…符号打切回路、18,18a
…制御回路、20…符号量割当回路、24…DCPM回路、30…
スイッチ、40…撮像系、48…LCD 表示器、60…信号処理
回路、80…符号化回路、70…記録系、71…記録媒体、90
…制御回路、100 …再生機本体、102 …読取部、104 …
復号化回路、106 …処理回路、108 …制御回路、110 …
インタフェ−ス回路、112 …ハフマン復号部、114 …逆
量子化部、116 …IDCT(逆 DCT変換)部、118 …制御
部。
DESCRIPTION OF SYMBOLS 1 ... Electronic camera main body, 6 ... Quantization circuit, 8 ... Entropy coding circuit, 10 ... Code output circuit, 12 ... Quantization width prediction circuit, 14 ... Code amount calculation circuit, 16 ... Code termination circuit, 18, 18a
... control circuit, 20 ... code amount allocation circuit, 24 ... DCPM circuit, 30 ...
Switch, 40: imaging system, 48: LCD display, 60: signal processing circuit, 80: encoding circuit, 70: recording system, 71: recording medium, 90
... Control circuit, 100 ... Reproducer body, 102 ... Reading unit, 104 ...
Decoding circuit, 106 ... processing circuit, 108 ... control circuit, 110 ...
Interface circuit, 112: Huffman decoding unit, 114: inverse quantization unit, 116: IDCT (inverse DCT transform) unit, 118: control unit.

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 平3−65886(JP,A) 特開 平2−248180(JP,A) 特開 平1−292987(JP,A) 特開 昭63−286078(JP,A) (58)調査した分野(Int.Cl.7,DB名) H04N 5/91 - 5/956 H04N 5/225 H04N 5/907 H04N 9/79 - 9/898 ────────────────────────────────────────────────── ─── Continuation of the front page (56) References JP-A-3-65886 (JP, A) JP-A-2-248180 (JP, A) JP-A 1-292987 (JP, A) JP-A-63-1988 286078 (JP, A) (58) Fields investigated (Int. Cl. 7 , DB name) H04N 5/91-5/956 H04N 5/225 H04N 5/907 H04N 9/79-9/898

Claims (5)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】映像信号を生成する撮影系を有し、この撮
影系により得た画像信号を、直交変換もしくは予測符号
化等を行う画像情報圧縮手段により画像データを前処理
した後、量子化手段により量子化し、この量子化出力を
可変長符号化手段により可変長符号化し、この可変長符
号化した画像信号データを、読出し可能に記録する記録
媒体に記録して保存するようにした電子カメラ装置にお
いて、 所望の圧縮率に対応する情報を入力する入力手段と、 可変長符号化手段の出力を受け、画面単位の総符号量を
求めてこれを算出符号量情報として出力する符号量算出
手段と、 前記入力手段により入力された圧縮率対応情報より、画
像当りの収めるべき総符号量の情報を与えると共に初め
に統計処理指令を発令し、統計処理が終わると符号化処
理指令を発令する制御手段と、 前記統計処理指令による実行開始時には前記制御手段か
らの総符号量の情報に基づき、該総符号量の枠に対応し
た量子化幅の予測を行って該予測した量子化幅の情報を
前記量子化手段に与え、符号化処理指令による実行開始
時には入力される前記算出符号量情報に基づき前回予測
した量子化幅の情報に対して前記総符号量の枠に収まる
よう補正した量子化幅の情報を得て、この補正した量子
化幅の情報を前記量子化手段に与える量子化幅予測手段
と、 この量子化幅予測手段の予測した量子化幅の情報を前記
記録媒体に読出し可能に記録する手段とを設けると共
に、前記量子化手段は量子化幅の情報を受けてその量子
化幅で前記前処理済み画像データを量子化する構成とす
ることを特徴とする電子カメラ装置。
An imaging system for generating a video signal;
The image signal obtained by the shadow system is transformed by orthogonal transformation or prediction code.
Preprocessing image data by image information compression means
After that, it is quantized by quantization means, and this quantized output is
The variable-length code is encoded by the variable-length encoding means.
Recording that records encoded image signal data in a readable manner
An electronic camera device that is recorded and stored on a medium
Input means for inputting information corresponding to a desired compression ratio, and the output of the variable-length coding means,
Code amount calculation to obtain and output this as calculated code amount information
From the compression ratio correspondence information input by the input means.
Give information on the total amount of code to be stored per image
A statistical processing command is issued to the
Control means for issuing a processing command, and said control means at the start of execution according to said statistical processing command.
Based on the total code amount information,
Prediction of the quantization width is performed, and information of the predicted quantization width is obtained.
Start to be given to the quantization means and to be executed by an encoding process command
Sometimes a previous prediction based on the calculated code amount information input
Fit in the frame of the total code amount for the information of the quantized width
Obtained information on the quantization width corrected as described above,
Quantization width prediction means for providing quantization width information to the quantization means
And information of the quantization width predicted by the quantization width prediction means,
Means for readable recording on a recording medium is provided.
The quantization means receives the information of the quantization width and
The pre-processed image data is quantized by a quantization width.
An electronic camera device, comprising:
【請求項2】映像信号を生成する撮影系を有し、この撮
影系により得た画像信号を画像データ化すると共に、こ
の画像データは所定画素単位でブロック化し、この各ブ
ロックについて順に直交変換を行って周波数成分別係数
データ化した後、量子化手段により量子化し、この量子
化出力を可変長符号化手段により可変長符号化し、こ
可変長符号化した画像信号データを読出し可能に記録す
る記録媒体に記録して保存するようにした電子カメラ装
置において、 前記量子化手段には前記ブロック毎の周波数成分別前記
係数データを、統計処理には暫定的な量子化幅係数を用
いて低周波数成分から順に量子化を行わせ、符号化処理
時には最適量子化幅係数を用いて低周波数成分から順に
量子化を行わせる構成とし、また、可変長符号化手段か
らの符号化出力の符号量を算出する算出手段と、最初に
統計処理を行い、その後に符号化処理を行うべく制御す
ると共に、統計処理においては前記ブロック毎の周波数
成分別前記係数データを、低周波数成分から順に予め定
めた暫定的な周波数成分別量子化幅係数を用いて量子化
を行うべく量子化手段を制御し、符号化処理時には前記
ブロック毎の周波数成分別前記係数データを、低周波数
成分から順に周波数成分別最適量子化幅係数を用いて量
子化を行うべく量子化手段を制御すると共に、前記算出
手段から得られる前記統計処理時の発生総符号量から画
像の収めるべき最適な総符号量を決定してこれを前記最
適目的符号量とする制御手段と、最適目的符号量および
統計処理時に得られる算出手段からの符号量情報から得
られる画像あたりの発生した総符号量と各ブロック別符
号量とから各ブロック別の割当符号量を決定する符号割
当手段と、前記符号化処理時に前記可変長符号化手段の
出力する前記各ブロック毎の符号化出力がそのブロック
での前記割当符号量を超えないように符号化を打ち切る
打ち切り手段とを具備してなる電子カメラ装置。
2. An imaging system for generating a video signal.
The image signal obtained by the shadow system is converted into image data, and
Image data is divided into blocks in predetermined pixel units, and each block is
Performs orthogonal transform on the lock in order to obtain the coefficients for each frequency component.
After the data is converted, the data is quantized by a quantization means.
The variable length coding means of the output variable length coding, this
Record variable-length coded image signal data in a readable manner.
Electronic camera device that records and saves data on a recording medium
In the apparatus, the quantization means includes a frequency component for each block.
Uses coefficient data and provisional quantization width coefficients for statistical processing
And perform quantization in order from the low frequency component
Sometimes, using the optimal quantization width coefficient,
Quantization is performed, and the variable length coding means
Calculating means for calculating the code amount of the coded output,
Performs statistical processing, and then controls to perform encoding processing.
In the statistical processing, the frequency of each block
The coefficient data for each component is predetermined in order from the low frequency component.
Using the provisional quantization component for each frequency component
Control the quantization means to perform
The coefficient data for each frequency component for each block is
Quantities using the optimal quantization width coefficient for each frequency component in order from the component
Controlling the quantization means to perform the quantization,
From the total code amount generated during the statistical processing obtained from the
Determine the optimal total code amount to contain the image, and
Control means for setting an appropriate target code amount;
Obtained from code amount information from calculation means obtained during statistical processing
Code amount generated per image and code for each block
Code allocation that determines the allocated code amount for each block from the code amount
The means and the variable length encoding means during the encoding process.
The encoded output of each block to be output is
The coding so as not to exceed the allocated code amount in
An electronic camera device comprising a termination unit.
【請求項3】映像信号を生成する撮影系を有し、この撮
影系により得た画像信号を画像データ化すると共に、こ
の画像データは所定画素単位でブロック化し、この各ブ
ロックについて順に直交変換を行って周波数成分別係数
データ化した後、量子化手段により量子化し、この量子
化出力を可変長符号化手段により可変長符号化し、この
可変長符号化した画像信号データを読出し可能に記録す
る記録媒体に記録して保存するようにした電子カメラ装
置において、 前記量子化手段には前記ブロック毎の周波数成分別前記
係数データを、統計処理時には暫定的な周波数成分別量
子化幅係数を用いて低周波数成分から順に量子化を行わ
せ、符号化処理時には周波数成分別最適量子化幅係数を
用いて低周波数 成分から順に量子化を行わせる構成と
し、また、可変長符号化手段からの符号化出力の符号量
を算出する算出手段と、最初に統計処理を行い、その後
に符号化処理を行うべく制御すると共に、統計処理にお
いては前記ブロック毎の周波数成分別前記係数データ
を、低周波数成分から順に予め定めた暫定的な周波数成
分別量子化幅係数を用いて量子化を行うべく量子化手段
を制御し、符号化処理時には前記ブロック毎の周波数成
分別前記係数データを、低周波数成分から順に周波数成
分別最適量子化幅係数を用いて量子化を行うべく量子化
手段を制御すると共に、前記算出手段から得られる前記
統計処理時の発生総符号量から画像の収めるべき最適な
総符号量を決定してこれを前記最適目的符号量とする制
御手段と、最適目的符号量および統計処理時に得られる
算出手段からの符号量情報から得られる画像あたりの発
生した総符号量と各ブロック別符号量とから各ブロック
別の割当符号量を決定する符号割当手段と、前記符号化
処理時に前記可変長符号化手段の出力する前記各ブロッ
ク毎の符号化出力がそのブロックでの前記割当符号量を
越えないように符号化を打ち切る打ち切り手段とを具備
してなる電子カメラ装置。
3. An imaging system for generating a video signal.
The image signal obtained by the shadow system is converted into image data, and
Image data is divided into blocks in predetermined pixel units, and each block is
Performs orthogonal transform on the lock in order to obtain the coefficients for each frequency component.
After the data is converted, the data is quantized by a quantization means.
The variable output is variable length encoded by the variable length encoding means.
Record variable-length coded image signal data in a readable manner.
Electronic camera device that records and saves data on a recording medium
In the apparatus, the quantization means includes a frequency component for each block.
The coefficient data is tentatively calculated for each frequency component during statistical processing.
Quantization is performed in order from the low frequency component using the quantization width coefficient
In the encoding process, the optimal quantization width coefficient for each frequency component is
Configuration that performs quantization in order from the low frequency component using
And the code amount of the encoded output from the variable length encoding means.
Calculating means for calculating
Control to perform encoding processing, and to statistical processing.
And the coefficient data for each frequency component for each block
From the low-frequency component in order.
Quantization means to perform quantization using fractional quantization width coefficient
During the encoding process, the frequency component of each block is controlled.
The coefficient data is sorted in order of frequency components from low frequency components.
Quantization to perform quantization using fractional optimal quantization width coefficient
Controlling the means and obtaining from the calculating means
From the total code amount generated during statistical processing, the optimal
A system in which the total code amount is determined and is used as the optimal target code amount.
Control means and optimal target code amount and obtained during statistical processing
The number of sounds per image obtained from the code amount information from the calculation means
Each block is calculated from the total code amount generated and the code amount for each block.
Code allocating means for determining another allocated code amount;
Each block output by the variable length coding means during processing.
The coded output for each block indicates the allocated code amount in the block.
With truncation means for truncating the encoding so as not to exceed
Electronic camera device.
【請求項4】画像信号を生成する撮影系を有し、この撮
影系により得た1画面分の画像信号のデータをブロック
に分割し、この分割されたブロック毎に直交変換等を行
って前処理した後、量子化手段により量子化し、この量
子化出力を可変長符号化手段により可変長符号化し、こ
の可変長符号化した画像信号データを、再生可能に記録
する記録媒体に記録して保存するようにした電子カメラ
装置において、 所望の圧縮率に対応する情報を入力する入力手段と、 可変長符号化手段の出力を受け、画面単位の総符号量を
求めてこれを算出符号量情報として出力する符号量算出
手段と、 前記入力手段により入力された圧縮率対応情報より、画
像当りの収めるべき総符号量の情報を与えると共に初め
に統計処理指令を発令し、統計処理が終わると符号化処
理指令を発令する制御手段と、 前記統計処理指令による実行開始時には前記制御手段か
らの総符号量の情報に基づき、該総符号量の枠に対応し
た量子化幅の予測を行って該予測した量子化幅の情報を
前記量子化手段に与え、符号化処理指令による実行開始
時には入力され る前記算出符号量情報に基づき前回予測
した量子化幅の情報に対して前記総符号量の枠に収まる
よう補正した量子化幅の情報を得て、この補正した量子
化幅の情報を前記量子化手段に与える量子化幅予測手段
と、 前記統計処理指令による実行時に前記算出符号量情報と
前記収めるべき総符号量の情報とに基づき、前記各ブロ
ックの割当て符号量を求める符号量割当手段と、前記符
号化処理指令による実行時、前記各ブロック毎の前記算
出符号量情報がそのブロックでの前記割当て符号量に達
すると前記可変長符号化手段の当該ブロックに対する符
号化を打切るべく制御する符号化打切手段と、 前記量子化幅予測手段の予測した量子化幅の情報を前記
記録媒体に読出し可能に記録する手段とを設けると共
に、前記量子化手段は量子化幅の情報を受けてその量子
化幅で前記前処理済み画像データを量子化する構成と
し、前記可変長符号化手段は前記打切り指令を受ける毎
に現在処理中のブロックに対する符号化を打切る構成と
することを特徴とする電子カメラ装置。
4. An imaging system for generating an image signal.
Block image signal data for one screen obtained by shadow system
And perform orthogonal transformation etc. for each of the divided blocks.
After the pre-processing, the quantization means
The variable output is variable length coded by the variable length coding means.
Variable length coded image signal data is recorded in a reproducible manner
Camera that records and saves data on a recording medium
In the device, input means for inputting information corresponding to a desired compression ratio and output of the variable length coding means, and the total code amount for each screen is calculated.
Code amount calculation to obtain and output this as calculated code amount information
From the compression ratio correspondence information input by the input means.
Give information on the total amount of code to be stored per image
A statistical processing command is issued to the
Control means for issuing a processing command, and said control means at the start of execution according to said statistical processing command.
Based on the total code amount information,
Prediction of the quantization width is performed, and information of the predicted quantization width is obtained.
Start to be given to the quantization means and to be executed by an encoding process command
Last predicted based on sometimes the calculated code quantity information are entered
Fit in the frame of the total code amount for the information of the quantized width
Obtained information on the quantization width corrected as described above,
Quantization width prediction means for providing quantization width information to the quantization means
And the calculated code amount information at the time of execution by the statistical processing command
Based on the information of the total code amount to be stored,
Code amount allocating means for determining an allocated code amount of the code;
At the time of execution according to the decoding process command,
Outgoing code amount information reaches the allocated code amount in the block.
Then, the code for the block of the variable length
Encoding discontinuation means for controlling the encoding to be discontinued, and information of the quantization width predicted by the quantization width prediction means.
Means for readable recording on a recording medium is provided.
The quantization means receives the information of the quantization width and
A configuration for quantizing the preprocessed image data with a quantization width
The variable length encoding means receives the truncation command
Configuration to abort coding for the block currently being processed
An electronic camera device characterized in that:
【請求項5】映像信号を生成する撮影系を有し、この撮
影系により得た画像信号を、A/D変換し、輝度信号成
分と色信号成分に分離し直交変換もしくは予測符号化等
を行う画像情報圧縮手段により前処理した後、量子化手
段により量子化し、この量子化出力を可変長符号化手段
により可変長符号化し、この可変長符号化した画像信号
データを、読出し可能に記録する記録媒体に記録して保
存するようにした電子カメラ装置であって、 所望の圧縮率に対応する情報を入力する入力手段と、 各種の圧縮率に対応した量子化幅の情報を予め有し、前
記入力手段により入力された圧縮率対応情報より、該圧
縮率対応情報に対応した輝度信号成分と色信号成分に対
する量子化幅の情報を各々出力する量子化幅設定手段
と、 この量子化幅設定手段より出力された前記量子化幅の情
報を前記記録媒体に読出し可能に記録する手段とを設け
ると共に、前記量子化手段は前記量子化幅設定手段から
出力される量子化幅の情報を受けてその量子化幅で前記
前処理済み画像信号データを量子化する構 成とすること
を特徴とする電子カメラ装置。
5. An imaging system for generating a video signal.
A / D conversion is performed on the image signal obtained by the shadow system to generate a luminance signal.
Orthogonal transform or predictive coding by separating into minute and color signal components
Pre-processed by the image information compressing means that performs
And quantizes the quantized output by a variable length coding means.
, And the variable-length coded image signal
Data is recorded and recorded on a recording medium that can be read
An electronic camera device having input means for inputting information corresponding to a desired compression ratio, and information of a quantization width corresponding to various compression ratios in advance.
From the compression ratio corresponding information input by the input means,
The luminance and chrominance signal components corresponding to the
Width setting means for respectively outputting quantization width information to be changed
And information on the quantization width output from the quantization width setting means.
Means for recording information on the recording medium in a readable manner.
In addition, the quantization means is provided from the quantization width setting means.
Upon receiving the output quantization width information, the quantization width
It is a configuration of quantizing the pre-processed image signal data
An electronic camera device characterized by the above-mentioned.
JP2404233A 1990-04-19 1990-12-20 Electronic camera device Expired - Lifetime JP3038022B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2404233A JP3038022B2 (en) 1990-04-25 1990-12-20 Electronic camera device
US07/771,791 US5291282A (en) 1990-04-19 1991-10-04 Image data coding apparatus and method capable of controlling amount of codes

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP10754690 1990-04-25
JP2-107546 1990-04-25
JP2404233A JP3038022B2 (en) 1990-04-25 1990-12-20 Electronic camera device

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP37182199A Division JP3192133B2 (en) 1990-04-25 1999-12-27 Electronic camera device

Publications (2)

Publication Number Publication Date
JPH04211588A JPH04211588A (en) 1992-08-03
JP3038022B2 true JP3038022B2 (en) 2000-05-08

Family

ID=26447571

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2404233A Expired - Lifetime JP3038022B2 (en) 1990-04-19 1990-12-20 Electronic camera device

Country Status (1)

Country Link
JP (1) JP3038022B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7215818B2 (en) 2002-03-07 2007-05-08 Canon Kabushiki Kaisha Image compression coding apparatus and control method therefor
US7257264B2 (en) 2001-08-29 2007-08-14 Canon Kabushiki Kaisha Image processing apparatus and method for compression-encoding image area information

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7257264B2 (en) 2001-08-29 2007-08-14 Canon Kabushiki Kaisha Image processing apparatus and method for compression-encoding image area information
US7215818B2 (en) 2002-03-07 2007-05-08 Canon Kabushiki Kaisha Image compression coding apparatus and control method therefor

Also Published As

Publication number Publication date
JPH04211588A (en) 1992-08-03

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
JP3093233B2 (en) Image encoding apparatus and method
JP3085465B2 (en) Image data encoding apparatus and encoding method
US6144763A (en) Method and apparatus for compression coding of image data representative of a color image and digital camera including the same
KR100616262B1 (en) Digital camera apparatus and recording method thereof
US6885395B1 (en) Selectively adjusting the resolution levels or the quality levels of digital images stored in a digital camera memory
EP1377071A1 (en) Image processing device, image processing method, image processing program, and recording medium
JP2003199019A (en) Imaging apparatus and method therefor, recording medium and program
JP2959831B2 (en) Image data encoding device
JP2952000B2 (en) Image data encoding apparatus and encoding method
JP3038022B2 (en) Electronic camera device
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
JP4306035B2 (en) Encoding method, encoding device, and camera device
JP3192133B2 (en) Electronic camera device
JP4430731B2 (en) Digital camera and photographing method
JP4154178B2 (en) Video camera
JPH0537901A (en) Image recorder
JP3384910B2 (en) Imaging device and image reproducing 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
JPH0481176A (en) Electronic still camera

Legal Events

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20000125

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

Free format text: PAYMENT UNTIL: 20090225

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20090225

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20100225

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20110225

Year of fee payment: 11

EXPY Cancellation because of completion of term
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110225

Year of fee payment: 11